Hi all, I’m struggling to figure out the easiest way to implement this across the couple cameras I have so far. One supports ffmpeg and the other only mjpeg. I’ve tried the following as an automation with the ffmpeg enabled camera (a Hikvision cube) and I get an error when checking the yaml.
From automations.yaml
- id: garagetakepicture
alias: Take picture in garage on motion
initial_state: true
trigger:
- platform: state
entity_id: camera.hikvision
to: 'on’
action:
- service: camera.snapshot
data:
entity_id: camera.hikvision
filename: 'garage_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
The error
Error loading /config/configuration.yaml: while parsing a block mapping in "/config/automations/automations.yaml", line 257, column 7 expected <block end>, but found '<scalar>' in "/config/automations/automations.yaml", line 264, column 20
My camera setup in cameras.yaml (called from configuration.yaml)
Thanks, it’s unclear to me what trigger I need. The camera docs (to me) are not clear about how I trigger a snapshot when motion is detected using that motion service.
Thanks, think I’m getting there. Does the link in hastbin.com for the camera need to be the ffmpeg URL or the MJPEG url (or something else)? Reason I ask is that my camera (Hikvision DS-2CD2420F) dosen’t seem to support MJEPG (only RTSP) so I’m struggling to get it working (I tried testing it with the curl command in the command line on the docker image and using the RTSP link returns nothing).
Well there’s a foscam component in HA, but im not using that. Im using zoneminder which pulls the image with rtsp.
if you get nothing try changing the url, use http and the recommended port for your camera.