I have a Xiaomi door sensor and a Wanscam HW0049.
I am trying to send an email (notify_email) when my sensor detect that my door is open. The email should contain 8 snapshot (with 1 second delay) of my camera.
It is not working (some of my snapshot are old ones, sometimes it takes refreshed ones, and sometimes it takes some old snapshot files)
My first suspicion is you are asking too much too quickly. I would suggest dropping your photo count in half and doubling the time delay between snapshots⌠just to see if that is the issue.
Hi @Dixey, it seems to work for now, thanks for the tip
Except my problem of delay, is my file optimized? I wasnât able to make on call like this :
-camera.snapshot (5 times with 2 seconds of delay) in one line.
My problem is still here.
I receive an email with 5 snapshot on my email (jpg files)
The problem is that the 5 pictures are not what they should be (they are 5 old jpg of camera snapshot). It doesnât update the snapshot. It is very frustratingâŚ
Anyone knows how I can take 5 snapshot (with 1 second of delay) ?
This code is not working properly with my Wanscam HW0049
- data:
entity_id: camera.camera
filename: /tmp/snapshot1.jpg
service: camera.snapshot
- delay:
seconds: 1
Hola @juan11perez,
Thanks for the reply.
Do you know how can I take all the images to my notify email ?
For now I have that, but with the timestamp, I donât know how to tell Home assistant Automation to take all the files from tmp
And more, I would like then to delete the file from tmp, to clean the tmp.
data:
data:
images:
- /tmp/1.jpg
- /tmp/2.jpg
- /tmp/3.jpg
- /tmp/4.jpg
- /tmp/5.jpg
- /tmp/6.jpg
- /tmp/7.jpg
- /tmp/8.jpg
message: Who is here?
title: someone is here
service: notify.mail_enter
I have a shell command that I run after sending snapshot that deletes all the images. Reduces the âold pictureâ issues.
in my configuration.yaml
#shell_command:
# snapshot_frontdoor_gif: /home/homeassistant/.homeassistant/www/tmp/gif.sh
shell_command:
delete_snapshots: 'rm -f /tmp/*.jpg'
at the end of my automation that sends snapshots
- delay:
seconds: 10
- service: shell_command.delete_snapshots
Iâll say that if you are getting old snaps that you probably want to include a delay before the email sending, to allow the snapshots to finish taking
You try to send the mail too early, if you look at script that @juan11perez linked to I have an 10 second delay between taking the picture and sending it and the same goes for @ptdalen and his automation. He also have an 10 second delay. I tried with a shorter time but then I got the same result as you that it sent old pictures instead.
Try to add an 10 seconds delay between the last picture and sending.