Today i find this tutorial:https://partofthething.com/thoughts/?p=1037#comment-4008
and made some changes.
**inside automation.yaml**
- alias: Burglar Alarm Door
trigger:
platform: time
after: '02:52:00'
action:
service: script.turn_on
entity_id: script.burglar
**inside script.yaml**
burglar:
alias: Burglar Alarm
sequence:
- service: shell_command.snapshot
data:
filename: /home/pi/snapshot1.jpg
- service: shell_command.fix_camera_jpg
data:
filename: /home/pi/snapshot1.jpg
- delay:
seconds: 1
- service: shell_command.snapshot
data:
filename: /home/pi/snapshot2.jpg
- service: shell_command.fix_camera_jpg
data:
filename: /home/pi/snapshot2.jpg
- service: notify.emailer
data:
title: 'Intruder alert'
message: 'Intruder alert at apartment!!'
data:
images:
- /home/pi/snapshot1.jpg
- /home/pi/snapshot2.jpg
**inside shell_comand.yaml**
shell_command:
snapshot: wget "http://camip:port/snapshot.cgi?user=<user>&pwd=<password>&resolution=32" -O {{filename}}
fix_camera_jpg: convert {{filename}} {{filename}}
today i made some tests, when i put in shh:
wget “http://192.168.1.239:81/videostream.cgi?user=admin&pwd=teste&resolution=32” -O {{filename}} wget “http://192.168.1.239:81/videostream.cgi?user=admin&pwd=teste&resolution=32” -O {{filename}}
ssh response me:Connecting to 192.168.1.239:81… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [multipart/x-mixed-replace]
Saving to: ‘{{filename}}’
{{filename}} [ <=> ] 15.59M 193KB/s
but when i run the script on HA i dont receive any email or photo. anyone help me?