I am trying to send an image from from the camera when an automation is sent
The trigger works as i get the notification, but no image
where is the confg
alias: 'Notify Doorbell Pressed'
initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.doorbell
from: 'off'
to: 'on'
action:
service: notify.ios_iphonename
data:
message: 'Some has pressed the door bell at {{now().strftime("%H:%M %d-%m-%y")}}'
data:
push:
category: camera
entity_id: camera.front_door_camera
is there way to send a static image at the point and time of the automation, as these sends a stream, and i might miss who has pressed the door bell if looked a few mins after
If you want a static camera snapshot image instead of a streaming one, make a “snapshots” directory under the “www” directory where your config is then use:
action:
- service: camera.snapshot
data_template:
entity_id: camera.front_door_camera
filename: "/config/www/snapshots/front_door_camera_{{ trigger.to_state.last_changed }}.jpg"
- service: notify.ios_iphone
data_template:
message: 'Someone has pressed the door bell at {{now().strftime("%H:%M %d-%m-%y")}} '
data:
attachment:
content-type: jpeg
url: "https://hass.yourdomain.com/local/snapshots/front_door_camera_{{ trigger.to_state.last_changed|urlencode }}.jpg"
entity_id: camera.front_door_camera
Note that /local/ maps to the “www” subdirectory of your config directory.