Amcrest AD410 doorbell cannot snap photo and send through Telegram

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

according to Telegram docs you should add “photo” before user/pass details and “notify” service should be used.

thanks for the link.
i fixed accordingly and still no luck :frowning:

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

maybe there is something wrong with my Telegram. this is what i see in the log:

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

a normal text telegram will go through. just photos refuses to. i expanded the error log to see this:

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:

action:
  - data:
      target: 546(my telegram)
      url: http://192.168.1.74/cgi-bin/snapshot.cgi?channel=1
      authentication: digest
      username: admin
      password: pass123
    service: telegram_bot.send_photo
mode: single

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.

how do you do that? can you show me your yaml code for this automation? thanks!

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.

1 Like

Are there any news? I have the same problem. I can send the photo with the app notification but telegram fails.

if you have a NVR, then it works as seen in my post #7. otherwise, no way.

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.

could you please show me how to use this go2rtc?
the instructions make no sense to me without any examples.

the RTSP for my amcrest 410 is rtsp://admin:[email protected]:554
i added it into the ADD tab

in Streams, i can see it here
image

now, how to call up the service to send a photo via Telegram?
thanks!

Hello,
the following home-assistant service should work:

service: telegram_bot.send_photo
data:
  url: "http://YOUR-GO2RTC-IP-ADDRESS:1984/api/frame.mp4?src=front bell"
  target: YOUR-TELEGRAM-CHAT-ID
  caption: Some caption text!

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.