Camera.snapshot not generating file

I’m having a hard time generating a camera.snapshot for use in automations. I have the camera setup and working in HA. Both still and motion URL’s work as well. I also have the directory allowlisted… But calling the camera.snapshot service does not generate anything.

calling this:

service: camera.snapshot
target:
  entity_id: camera.front
data:
  filename: config/tmp/snapshots/test1.jpg

The camera is RCL-520

config.yaml entry is:

camera:
    - platform: generic
      name: "front"
      still_image_url: http://192.168.2.46/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&amp&user=user&password=password
      stream_source: rtsp://user:[email protected]:554/h264Preview_01_main
      verify_ssl: false

obviously with the name and passwords filled.

Any help would be appreciated on this step.

First make 100% sure if you “browse” to this location with the correct credentials you get a snapshot:

http://192.168.2.46/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&amp&user=user&password=password
1 Like

Thanks @sender . Yes, definitely displays and image at that link.

Are you sure the path is writable/existing?

try e.g. and look in the config/www folder:

service: camera.snapshot
data:
  filename: /config/www/test.jpg
target:
  entity_id: camera.front
1 Like

I was struggling with this for a minute. But it passes a configuration check when entered as the following. And not if the directory doesn’t exist or otherwise. Perhaps I’m not looking in the correct folder afterall.when connecting via smb which doesn’t have config/www. I think my confusion lies in there somewhere.

  allowlist_external_dirs:
  - /config/tmp/snapshots

You should also see if a file (snapshot) is created via the file editor addon and/or visio studio code or others. besides your “configuration.yaml” file there must be a www folder with the snapshot in it…?

I also do not know if you “just started” and just created a www folder yourself. if so you must restart homeassistant or you cant use it.

Strange. No www folder at all on the same level as config.yaml via file editor. The tmp/snapshots directory is there though as I created it. Is there some special assignation to the www folder? Sorry, I’m not aware of the history of that folder. This is an install that has been running for about a year and a bit (though updated to current versions).

try it?

and there is no snapshot file in it?

the www folder is a “special” folder…

If you place a picture in it, you can also access them in yaml or lovelace by calling out the location:

local\picture.jpg

local = www folder.

Thank you. That’s awesome. Strangely, it now works with:

service: camera.snapshot
target:
  entity_id: camera.front
data:
  filename: tmp/snapshots/test1.jpg

But I will migrate things over to www. The next step is figuring out how to attach this to a notification from behind duckdns and SSL.

1 Like