New Camera Snapshot Service Not Working

I am trying to use the new camera.snapshot service in 0.57.1 initially using the development Service Tool. It keeps erroring with - Can’t write [my filename], no access to path!

I have tried numerous folders to no joy.

Has anyone got this service working?

EDIT: never mind, my error is the same as yours. Didn’t work in 0.57.0 and still doesn’t work in 0.57.1. I thought I got a permissions issue, but that was something else. I get the “no access to path!” error when calling the camera.snapshot service. I run a docker container for what it’s worth.

See https://github.com/home-assistant/home-assistant/issues/10356

i can confirm putting the folder in whitelist_external_dirs fixes the problem.

are you using HASS.io? What path to the directory did you use for whitelist_external_dirs?

Trying to get snapshots working, saving to a folder I’ve created in config called camera_snapshots but not sure what the full file path is?

Yes I am using Hass.io, and I created a folder in config called camera and used the whitelist path of /config/camera

Hi what is the camer, and can you view the camera feed on the HA front end?
I ask because I know that raspberry pi cameras don’t yet work with Hassio.

It’s a Foscam clone which I have setup as MJPEG Generic as the Foscam component didn’t work. And yes I can view the feed on the Hass.io front end.

Thank you - finally got it working now, not sure what I was doing wrong but its saving screenshots into the right folder now!

My new question is about calling the service as part of my automations. I’ve managed to set up telegram to send me a push notification of my picture, but I can’t work out how to actually take a photo as part of this sequence.

I’m can use developer services to take a photo manually

{"entity_id":"camera.catflap_camera", "filename":"/config/camera_snapshot/catflap.jpg"}

and my code for uploading to telegram is here…

script: 
  Catflap:
  sequence:
    - service: <code to take photo here?> 
    - service: notify.telegram
      data:
        title: catflap
        message: "Cat Detected!"
        data:
          photo:
            - file: /config/camera_snapshot/catflap.jpg

The bit Im missing the the first - service: in the sequence. Any pointers on what to put here? I see you have a python script to take photos with timestamps… I did originally test this, again working with developer services, but I figured it would be too hard to upload using telegram notifications as I wouldn’t know what the file name would be if that makes sense?

I am stuck on the same code too, so looking forward to see how this is done :slight_smile:

This is what is now working for me. Captures a photo from my catflap camera and uploads to telegram when I trigger with a light turning on. (this will be change to a sensor on the catflap once I wire it in… probably a reed switch. Thanks for the help guys I appreciate it.

- alias: 'Catflap Camera Snapshot'
  trigger:
   - platform: state
     entity_id: light.lamp 
     to: 'on'   
  action:
   - service: camera.snapshot
     data:
       entity_id: camera.catflap_camera
       filename: /config/camera_snapshot/catflap.jpg
   - service: notify.telegram
     data:
       title: one
       message: two
       data:
         photo:
           - file: /config/camera_snapshot/catflap.jpg
             capture: Catflap Capture

Hello all, How my cam can take a snapshot while motion detection. I can only see the cam view. I want to push notification with pictures when motion detect. I have Dahua cam DH-IPC-HDBW4433R-S in my setup. I make a folder

config/camera_snapshot

Component -platform: generic i must click on the card for view cam, but platform: ffmpeg i can see the view without a click on the card.

i use motion detection with component binary_sensor:

binary_sensor:
  - platform: ffmpeg_motion
    input: rtsp://admin:[email protected]:12100
    name: Outdoor motion
    changes: 50
    reset: 20

Camera view method 1

camera:
  - platform: generic
    stream_source: rtsp://admin:[email protected]:12100/VideoInput/1/h264/1
    still_image_url: http://192.168.1.223:12100/cgi-bin/snapshot.cgi
    verify_ssl: true
    authentication: basic
    name: cam

and Camera view method 2

  - platform: ffmpeg
    input: !secret Dahua_dome_cam_ffmpeg
    name: Outdoor

Automation

- id: '15555455212827'    
      alias: 'Camera Snapshot'
      trigger:
        platform: state
        entity_id: binary_sensor.outdoor_motion 
        to: 'on'   
      action:
       - service: camera.snapshot
         data:
           entity_id: camera.outdoor
           filename: /config/camera_snapshot/snapshot.jpg
       - service: notify.telegram
         data:
           photo:
             - file: /config/camera_snapshot/snapshot.jpg
               capture: snapshot

@smile that looks correct, is there a problem?

@robmarkcole Yes, unable to take Picture while motion detect.

Try moving the quotation marks from around on

@robmarkcole

Invalid config without quotation marks around on.

Invalid config for [automation]: expected str for dictionary value @ data[‘trigger’][0][‘to’]. Got None. (See /config/configuration.yaml, line 89). Please check the docs at https://home-assistant.io/components/automation/`

OK not that then

This is working for me try data_template.

script:
    camera_bi_front_snapshot:
      sequence:
        - service: camera.snapshot
          data_template:
              entity_id: camera.bi_door_camera
              filename: '/config/www/snapshots/front_door_camera.jpg'