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?
Hi, thank you for the code. It helped me to finally show my FTP based CCTV DVR snapshots on my UI. One question, each camera snapshot is saved with a different first part ie “ch01_XXX.jpg”, “ch02_XXX.jpg” etc. How do I get this automation to use a condition based on the first 4 characters to run? I want to run a different automation based on the file names…
alias: Kguard FTP File Path Update
trigger:
event_data:
event_type: created
event_type: folder_watcher
platform: event
condition: []
action:
Help is much appreciated. Also, something I came across. For the folder_watcher component, using a patterns “ch0*.jpg” does not work, but “ch0.jpg” does work: (with the extra “*”
Hi, I’ve read all the topic and I’ve tested some of the suggestion that I’ve read and this automation is that it’s working in my HA:
- id: fotogaraje
alias: Pta garaje abierta tiempo
trigger:
- entity_id: cover.sonoffgarage
for: 0:05:00
platform: state
to: open
condition: []
action:
- data:
entity_id: camera.garaje
filename: /config/www/cam_captures/garaje_{{ now ().year }}_{{ now ().month
}}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
service: camera.snapshot
- delay: 00:00:05
- alias: ''
data:
message: Puerta garaje abierta mucho tiempo con foto
service: telegram_bot.send_message
- data:
file: /config/www/cam_captures/garaje_{{ now ().year }}_{{ now ().month }}_{{
now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
service: telegram_bot.send_photo
Do I need to open ports on my router or something else?
Also when I remove the time/date stamp I still don’t get the image. It can be viewed on the browser though.
Thank you so much for your scripts. It took me a very look time to get these to work, but I’m pleased to say with your samples I have managed to do so. Thank you.
I should point out, I am new to Hass.io and I relay a LOT on other people’s input. Finally to get this working I had to keep looking for the errors inside the log file, eventually after many hours of Googling and trying to understand what the errors meant I got it to work. It’s not easy. Far from it.
Thanks so much.
This post helped me a lot with a android IP webcam. But I run it directly the longest time - Hoped it the bash file takes care of the timeout wich I had to use first.
maybe with a wait template… but I dont know.
I also had problems with files with files more then 2mb
So i used
-t 4 -b:v 2048k -vcodec libx264 -fs 2048k
Edit:
Said and done - I changed your Script therefore a little more