This enabled the snapshot to save to the correct folder. I am now having issues sending this file on pushbullet.
My automation is:
- action:
- delay: '2'
- alias: ''
data:
filename: /config/tmp/snapshot.jpg
message: motion detected
service: notify.home_assistant_alert
alias: Motion Camera
condition: []
id: '1517144410974'
trigger:
- entity_id: sensor.name_motion
from: inactive
platform: state
to: active
I am getting this error:
2018-01-30 10:14:21 ERROR (MainThread) [homeassistant.core] Invalid service data for notify.home_assistant_alert: extra keys not allowed @ data[āfilenameā]. Got ā/config/tmp/snapshot.jpgā
I have tried with āfileā rather than āfilenameā with the same error.
In my case I use telegram and based on the docs i needed yo use this way:
data:
photo:
- file: "/config/www/cam_captures/kitchen_{{ now ().year }}_{{ now ().month }}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg"
capture: Snapshoot
Please chechk if you have the data & photo tags for pushbullet ā¦
Donāt supposed youāve tried this with Pushbullet? Iāve used your template (thank you!) and have the notify set up like this:
- service: notify.pushbullet
data:
title: Doorbell Pushed
message: Photo from front door attached
data:
file: /config/www/cam_captures/porch_{{ now ().year }}{{ now ().month }}{{ now ().day }}-{{ now ().hour }}{{ now ().minute }}.jpg
Trouble is, Pushbullet is not finding the file that gets created returning the following error:
FileNotFoundError: [Errno 2] No such file or directory: '/config/www/cam_captures/porch_{{ now ().year }}{{ now ().month }}{{ now ().day }}-{{ now ().hour }}{{ now ().minute }}.jpg'
The file is there and called porch_2018327-1246.jpg but the template code is obviously wrong as it is looking for the template code itself rather than the correct file name.
Any suggestions would be appreciated.
P.S If I create a static image like this, it works fine:
- service: notify.pushbullet
data:
title: test
message: test
data:
file: /config/www/cam_captures/camera.jpg
I struggled mightily with this, too. Turns out this is what works for my notify.smtp setup. Your mileage may vary:
- service: notify.gmail
data:
message: Gameroom door was opened
title: We've been attacked
data:
html: <h4>Check the gameroom</h4>
images:
- /config/www/snapshots/new/gameroom.jpg
indent preformatted text by 4 spaces
I had already made a node-red flow using json that worked. I would never have figured out the yaml with a converter. JSON to YAML converter
Iāve done a script + automation, with ffmpeg, which creates a small video from the CCTV feed when someone goes past the motion detector which is next to the CCTV.
Thanks for the example scripts! Do you guys also delete the screenshots after e.g. a week to prevent the sd card gets full? Or do you have another solution for this?