To simplify my question, I am going to reference this example from the Dahua integration github page:
Given the following event data:
{
"event_type": "dahua_event_received",
"data": {
"name": "Cam13",
"Code": "VideoMotion",
"action": "Start",
"index": "0",
"data": {
"Id": [
0
],
"RegionName": [
"Region1"
],
"SmartMotionEnable": false
},
"DeviceName": "Cam13"
},
"origin": "LOCAL",
"time_fired": "2021-06-30T04:00:28.605290+00:00",
"context": {
"id": "199542fe3f404f2a0a81031ee495bdd1",
"parent_id": null,
"user_id": null
}
}
… this event trigger works perfectly fine.
platform: event
event_type: dahua_event_received
event_data:
name: Cam13
Code: VideoMotion
action: Start
However, taking this to the next step by including the RegionName as a component of the trigger does not seem to work. I have similar event triggers in other automations, the only difference I can see in this example is that the RegionName data is represented as an array. I assumed this would work, but it does not trigger when ‘Region1’ is represented in the array during a dahua_event_received event. Here is what I am using:
platform: event
event_type: dahua_event_received
event_data:
name: Cam13
Code: VideoMotion
action: Start
data:
RegionName: 'Region1'
Regardless if Region1 is the only item in the array, or if the array contains other items in the list, i.e., Region0, Region1, Region2… the event does not trigger.
I have attempted several different ways to format, but nothing seems to work. Any thoughts?