Camera Snapshot

Hey All,

For some reason i’m getting zero bytes (empty jpg file) when saving a camera snapshot. any ideas whats is causing it?

I have whitelist_dir the appropriate directory but getting empty jpg file.

Have you included username and password in the url requesting that snapshot?

I previously made this mistake myself: when visiting http://cam/snap.jpg in my browser, it would display the Image because I had previously logged into the camera interface though that browser. But home assistant needed something like http://cam/snap.jpg?user=me&password=verysecret or it would not download the image because it had not logged in before so the camera did not authorize it to access the still image.

I was having this issue with a TAPO camera and came across this discussion. The solution I found was to disable “preload stream” in HA, which keeps the feed open.

It appears some cameras only allow access to 1 external steam at a time and if HA is preloading 1, it means there isn’t a stream for camera.snapshot to use.

1 Like