Node Red File Size

What would be the best approach to get the filesize of a .jpg file being stored at /media/camera/snapshot_camera.doorbell.jpg? I am sending an alert with the jpg when motion is detected however sometimes i receive an empty image so I want to check for file > 0 MB file size.

Is this how the flow is structured? If not make the adjustment.


Take snapshot shouldn’t send the next message until the snapshot is triggered. If it is this way you have it add a 1/2 second delay node in between.

hmmm interesting, i’ll add the delay:


No dice after adding the delay. Heres what I see sometimes. Sometimes it works fine.


Make a manual check when that happens.
Check that the file exist and that the filename is correct.
If the file exist and the name is correct, then increase the delay until it works.

1 Like

When it doesn’t are you on your local wifi? If I am away form home and I lose connection to HA, I will get the text message but the picture will not be there. If it is only happening off wifi check your outside access connection is not failing.

If it fails on wifi, you can trigger the text message from a watch file node instead of the snapshot node. Set the path to the snapshot in the watch file node. When the photo is updated, the node will fire.



1 Like contains both a size and stats node that will give you the size of the file (among many other file operations).

1 Like

Thanks for this! I’m going to give this a try.

It is failing on wifi.