Hardware involved - Amcrest AD110 Video Doorbell, Galaxy S9+, Chromecast w/Google TV, Google Hub/Displays and Google Home
Software - Running HA 2022.5.5 Core on Docker on Ubuntu, Notifications for Android TV (for the Chromecast)
Object - get a doorbell press to 1) play a doorbell chime on all the Google Homes and Displays in the house, 2) send a notification to the Galaxy phone with a still shot from the doorbell, and 3) send a pop up notification to the Chromecast with an image from the doorbell.
Here’s my automation:
alias: Doorbell Ring Speaker Chimes
description: ''
trigger:
- platform: event
event_type: amcrest
event_data:
event: CallNoAnswered
payload:
action: Start
condition: []
action:
- service: media_player.play_media
data:
media_content_id: http://<HA-IP>:8123/local/media/sounds/doorbell-1.mp3
media_content_type: audio/mp3
target:
entity_id: media_player.doorbell_chimes
- service: notify.mobile_app_<device>
data:
message: Someone just rang the doorbell
title: Doorbell
data:
ttl: 0
priority: high
color: red
image: /api/camera_proxy/camera.doorbell
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
enabled: true
- service: camera.snapshot
data:
filename: /config/www/doorbell_snapshot.jpg
target:
entity_id: camera.doorbell
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
enabled: true
- service: notify.android_tv_fire_tv
data:
title: Doorbell Ringing
message: Someone is at the door
data:
duration: 4
position: center
fontsize: max
transparency: 25%
color: red
interrupt: 0
image:
path: /config/www/doorbell_snapshot.jpg
mode: single
The doorbell chimes work every time. So, all good there.
The notify.mobile_app_ action works and sends an image if I run that specific action from the automation builder, or as a developer tools call-service notify.mobile_app_, or if I run the developer tools call-service for trigger for the event, or if I run all of the actions from the automation builder. However, it does NOT send an image if I actually ring the doorbell; it only sends an imageless notification (Someone just range the doorbell).
I use the camera.snapshot service to build an image to be used for the notify.android_tv_fire_tv service… and that works most of the time, now. I put delays in to ensure the camera was not getting used simultaneously from HA, and to make sure the write of the image was completed before trying to read the image and send it.
So… why is it my phone notification only works if I manually run the actions via the automation builder or various call-service methods, but will not send an image if the actual button is pressed on the actual doorbell?
There are no “trigger event” services. There’s a trigger automation service, but that skips the trigger and conditions and just runs the actions. Though you can make it check the conditions (skip_condition: false), you cant actually make it fire the event.
Have you used Developer Tools > Events to listen to that amcrest event type when you press the doorbell?
Sorry about that, I meant if I go to Developer Tools, Events, and use the info in the trigger section to fire the event (CallNoAnswered, action Start) to simulate the button getting pressed, that’s when everything works as expected (all images are displayed where I expect them). But if the button is pressed on the doorbell, the image going to the phone notification system never shows.
Yes, I have used that page to listen to the events from amcrest when the actual doorbell is pressed, and the info is the same (in my memory) as what is in the trigger. I can get that info and paste it in here, tomorrow… it’s late right now, and I don’t want to be ding-dong-dashing my family this late at night.
When I push the button on the doorbell, the first two events have payload codes of VideoMotion with a start action and _DoTalkAction_ with pulse and invite action. Those seem inline with what the doorbell is doing, IMO… sensing motion, and doing something related to voice communication or notification. Then…
{
"event_type": "amcrest",
"data": {
"camera": "Doorbell",
"event": "CallNoAnswered",
"payload": {
"Code": "CallNoAnswered",
"action": "Start",
"index": "0",
"data": {
"CallID": "3"
}
}
},
"origin": "LOCAL",
"time_fired": "<snipped>",
"context": {
"id": "<snipped in case it is unique to my doorbell>",
"parent_id": null,
"user_id": null
}
}
and immediately after that, a similar one with action of “Stop”, followed by the DoTalk with pulse and hangup, and VideoMotion again with Stop, and then some entries for file updates to update data files on the option SD card.
Like I said… when the physical button is pushed, all the actions in the automation fire off as expected… except when the action for notify.mobile_app_mydevice goes off, the image is not included. The only time the image is included is if I run the action manually, or use the developer tools to manually fire the above event.
No worries… thx for trying!
So… tl;dr is… works 100% in simulations, and debugging… only works 90% when actually triggered (the image doesn’t come through on the notification). I’ve even looked at the trace output and it sure looks like it’s grabbing an image to send, but it’s not there.
I did some additional testing, changing the trigger from the event to a time pattern, every 10 minutes. It worked every time that way; I got a picture from the doorbell camera every 10 minutes. So, there’s something HA is doing, or having trouble doing, when the physical doorbell press event is generated. I’ve put in delays to see if that helps (a delay in front of the action), but it hasn’t helped yet. I guess I’m looking for help troubleshooting this… where to look in HA for anomalies or errors, what to look for, that sort of thing.
So, there are two actions that are not executing properly when the actual event occurs in the above mentioned automation. Both actions fire and execute properly when run as a “run action” from that automation builder, and both run properly when run as a “call service” from Developer Tools, Services. But when the event actually occurs, the actions fire, but with no picture.
- service: notify.mobile_app_<device>
data:
message: Someone just rang the doorbell
title: Doorbell
data:
ttl: 0
priority: high
color: red
image: /api/camera_proxy/camera.doorbell