i have all the parts but cannot get it to work properly.
my Amcrest AD410 works great using the amcrest app but im trying to steer clear of using another app if i dont have to.
the idea is have Telegram send me a snapshot of someone at the door when the bell button is pressed.
button: binary_sensor.cam_front_door_alarm_local
this URL works in FireFox: http://192.168.1.112/cgi-bin/snapshot.cgi
putting them all together and it refuses to work:
alias: alert doorbell ring front send photo
description: ''
trigger:
- entity_id: binary_sensor.cam_front_door_alarm_local
platform: state
to: 'on'
condition: []
action:
- data:
authentication: digest
password: pass123
target: 54xxxxxxxx
url: http://192.168.1.112/cgi-bin/snapshot.cgi
username: admin
service: telegram_bot.send_photo
mode: single
thanks for the link.
i fixed accordingly and still no luck
alias: alert doorbell ring front send photo
description: ''
trigger:
- entity_id: binary_sensor.cam_front_door_alarm_local
platform: state
to: 'on'
condition: []
action:
service: notify.telegram
data:
title: Send an images
message: "That's an example that sends an image."
data:
photo:
- url: http://192.168.1.112/cgi-bin/snapshot.cgi
username: admin
password: pass123
mode: single
Let me start with, I don’t use telegram so I only point my out doc to assist.
Now. If I were you I’d First verify you can send telegram message without image
If that success, I’d work on image send
If you click on the errors from the log you get more detail about error. The detail more clearly points you to error.
EDIT
Try removing quotes (“) from message
For some reason message is “none” so seems it not recognize the data maybe.
After that the photo still seem like not working but maybe add the digest and other info you had befor and it help there. It was valid data just not shown in example. Add just like you do user and pass. 401 error for image mean it could not authenticate/login
so i am finding out it is NOT possible to get snapshot from the doorbell cam and send through Telegram for whatever reason. all my other amcrest 4k can do it though.
the solution is to have a NVR. add the doorbell into the NVR. then get the snapshot from the NVR. works perfectly now.
the code looks something like this:
I am experiencing the same problem and I found out that when I remove the dpi information from the photo (jpg file) Telegram accepts it. Not sure if that’s just a weird behaviour or rather a bug in the Telegram integration.
Unfortunately no yaml code yet, but am looking into a possible solution using the pyscript addon.
In fact I found out that a simple ‘save as…’ from a photo editor (IrfanView for example) fixes the jpg file and then it can be send with Telegram inside HA.
There seem to be a bug with the current firmware of the AD410 doorbell when retrieving snapshot images. The jpg file contains ‘Corrupt JPEG data: 608 extraneous bytes before marker 0xfe’.
I opened a support ticket with Amcrest and will keep you posted.
Thank you for the hint - found a way to run it over go2rtc (so without real hardware NVR):
This solution works great for me, as I already had go2rtc already running for latency free streaming,
but didn’t realize the snapshot functionality so far.
I’m running go2rtc in a separate docker container so if have to add my IP address to YOUR-GO2RTC-IP-ADDRESS. If you have installed go2rtc as a home-assistant addon “localhost” should work.
thank you for the sample code. it works!
a little off topic… but go2rtc conflicts with Frigate. so i have go2rtc running very well, now Frigate refuses to work. error “Port ‘8555’ is already in use by something else on the host”
seems others experience this as seen here. too bad the solution is to start Frigate first, then start go2rtc. no idea how i can enforce that if my HA machine reboot.