I have an amcrest video doorbell. I’m not using the Amcrest app, but instead have it tied to blue iris, which includes two way talk.
I want to have this automation trigger when the doorbell is pressed. The trigger should occur when 'Action: Invite" is present in the event, as shown below:
event_type: amcrest
data:
camera: Amcrest Camera
event: _DoTalkAction_
payload:
Code: _DoTalkAction_
action: Pulse
index: "0"
data:
Action: Invite
CallID: 20220917154725@[email protected]
CallSrcMask: 4
origin: LOCAL
time_fired: "2022-09-17T22:47:27.379409+00:00"
context:
id: xxxxxxxxxxxxxxxxxxxxxxxxxxx
parent_id: null
user_id: null
I can’t figure out what home assistant wants the format to be when trying to watch for “Action: Invite”.
This fails:
payload.data.Action: Invite
This triggers on any event from the device:
payload:
data:
Action: Invite
I’ve seen a few somewhat related posts where the solution involved templating, which I don’t have a whole lot of experience with. All I’m asking HA to do is trigger the automation if this key/value is present in the event, so I’d be surprised if it requires that.
If there is good documentation regarding this, I haven’t found it, so I’d love to have some links if you know of any.
Thank you in advance!
Post the full event of interest using the event listener under the dev tools.
event_type: amcrest
data:
camera: Amcrest Camera
event: _DoTalkAction_
payload:
Code: _DoTalkAction_
action: Pulse
index: "0"
data:
Action: Invite
CallID: 20220917154725@[email protected]
CallSrcMask: 4
origin: LOCAL
time_fired: "2022-09-17T22:47:27.379409+00:00"
context:
id: xxxxxxxxxxxxxxxxxxxxxxxxxxx
parent_id: null
user_id: null
I was able to get this working through trial and error by using the full yaml up to the Key I’m trying to match as the trigger:
trigger:
- platform: event
event_type: amcrest
event_data:
camera: Amcrest Camera
event: _DoTalkAction_
payload:
Code: _DoTalkAction_
action: Pulse
index: "0"
data:
Action: Invite
It seems silly that you would have to include all previous elements with exact values, as those could easily be a timestamp or something. So I still feel like this is not the correct/best way to accomplish this.
Sorry, I see you posted it before, but I missed it. But seeing the full automations was helpful too.
You only need to match as many fields to make the trigger unique for your purposes. For example, if you’re going to add a second camera and want to add the name of the camera to a notification, the index or call ID fields may matter (you wouldn’t want to match on them if you want a generic notification, but you want access to the data, which will be on the trigger object).
So, if there’s a timestamp you can ommit that field. You already e.g. ommit call ID.