Cannot distinguish between different button presses on Dahua VTO3221D
Version of the custom_component
0.9.39
Configuration
Add your logs here.
Describe the bug
I have Dahua VTO 3221D with 2 intercom buttons and can control 2 locks (via external relay). The integration works fine, and I can see all events, and open both doors. However, in the events I do not see the difference between button 1 and button 2 in the event data. In the Invite event the LockNum is always 2. In the BackLigs event Index is always -1 Is there any way to obtain the information which button was pressed ?
Debug log
Button 2 pressed:
Event 147 fired 18:25:
{
"event_type": "dahua_event_received",
"data": {
"Action": "Pulse",
"Code": "BackKeyLight",
"Data": {
"LocaleTime": "2022-03-10 18:25:34",
"State": 0,
"UTC": 1646933134
},
"Index": -1,
"deviceType": "VTO3221D",
"serialNumber": "6G0BF38PAJ03C85",
"DeviceName": "Intercom Gate"
},
"origin": "LOCAL",
"time_fired": "2022-03-10T17:25:35.653646+00:00",
"context": {
"id": "dbd06eea6a74ef1099a88eaaf283b42c",
"parent_id": null,
"user_id": null
}
}
Event 146 fired 18:25:
{
"event_type": "dahua_event_received",
"data": {
"Action": "Pulse",
"Code": "BackKeyLight",
"Data": {
"LocaleTime": "2022-03-10 18:25:29",
"State": 1,
"UTC": 1646933129
},
"Index": -1,
"deviceType": "VTO3221D",
"serialNumber": "6G0BF38PAJ03C85",
"DeviceName": "Intercom Gate"
},
"origin": "LOCAL",
"time_fired": "2022-03-10T17:25:31.151641+00:00",
"context": {
"id": "97859059046b006e5b3f4a6e63acaf93",
"parent_id": null,
"user_id": null
}
}
Event 145 fired 18:25:
{
"event_type": "dahua_event_received",
"data": {
"Action": "Pulse",
"Code": "Invite",
"Data": {
"CallID": "7",
"IsEncryptedStream": false,
"LocaleTime": "2022-03-10 18:25:29",
"LockNum": 2,
"SupportPaas": false,
"TCPPort": 37777,
"UTC": 1646933129
},
"Index": 0,
"deviceType": "VTO3221D",
"serialNumber": "6G0BF38PAJ03C85",
"DeviceName": "Intercom Gate"
},
"origin": "LOCAL",
"time_fired": "2022-03-10T17:25:31.120376+00:00",
"context": {
"id": "18f8397fac0a08ba75bb734251680134",
"parent_id": null,
"user_id": null
}
}
Button 1 pressed:
"event_type": "dahua_event_received",
"data": {
"Action": "Pulse",
"Code": "BackKeyLight",
"Data": {
"LocaleTime": "2022-03-10 18:25:20",
"State": 2,
"UTC": 1646933120
},
"Index": -1,
"deviceType": "VTO3221D",
"serialNumber": "6G0BF38PAJ03C85",
"DeviceName": "Intercom Gate"
},
"origin": "LOCAL",
"time_fired": "2022-03-10T17:25:21.586220+00:00",
"context": {
"id": "3710461f3c7a9f27b8af4046cc135c74",
"parent_id": null,
"user_id": null
}
}
Event 137 fired 18:25:
{
"event_type": "dahua_event_received",
"data": {
"Action": "Pulse",
"Code": "BackKeyLight",
"Data": {
"LocaleTime": "2022-03-10 18:25:19",
"State": 1,
"UTC": 1646933119
},
"Index": -1,
"deviceType": "VTO3221D",
"serialNumber": "6G0BF38PAJ03C85",
"DeviceName": "Intercom Gate"
},
"origin": "LOCAL",
"time_fired": "2022-03-10T17:25:21.465062+00:00",
"context": {
"id": "d9b20293c7540665516416d5f19ed0b6",
"parent_id": null,
"user_id": null
}
}
Event 136 fired 18:25:
{
"event_type": "dahua_event_received",
"data": {
"Action": "Pulse",
"Code": "Invite",
"Data": {
"CallID": "6",
"IsEncryptedStream": false,
"LocaleTime": "2022-03-10 18:25:19",
"LockNum": 2,
"SupportPaas": false,
"TCPPort": 37777,
"UTC": 1646933119
},
"Index": 0,
"deviceType": "VTO3221D",
"serialNumber": "6G0BF38PAJ03C85",
"DeviceName": "Intercom Gate"
},
"origin": "LOCAL",
"time_fired": "2022-03-10T17:25:21.456770+00:00",
"context": {
"id": "4832fd3b2d1d7aa3da030eae761a6816",
"parent_id": null,
"user_id": null
}
}
maybe you can make a different on event bus with the "CallID:. If you have 2 different screens maybe the callid is the display he try to call so you can make button 1 ="CallID : 6" button 2 = "CallID: 7" look at the event bus if the callid is always the same
I have checked, call id is different every time. It looks like it's just incremental counter that is updated after every new call
This is the event_bus and my Indoor Display has the "UserID: 101" Always if i press the first button its call the ID 101 and to test i triggered home assistant to send message to my phone is working.
Try to config your System with the Configtool from dahua: https://dahuawiki.com/Video_Intercom/SIP_2.0/How_To_Add_VTO4202_To_VTH_Via_Configtool
This is from the Eventbus event_type: dahua_event_received data: Action: Pulse Code: Invite Data: CallID: "6" IsEncryptedStream: false LocaleTime: "2022-09-17 20:05:14" LockNum: 2 SupportPaas: false TCPPort: 37777 UTC: 1663445114 UserID: "101"
This is the trigger to config:
platform: event event_type: dahua_event_received event_data: Action: Pulse Code: Invite Data: UserID: "101" id: sensor.dahua_vto

I hava a similar problem. My doorbell sends the same events for either of the 2 buttons. I am using DHI-VTO4202FB-P without indoor monitors (I want to use Android tablets with Home Assistant). In the VTO, I configured the button presses to different rooms (100 and 101). I don't get the "Invite" event as shown above. I can get the information that a button was pressed via the Pulse Action with Code BackKeyLight. But I always get user_id: null in the context. Also all relevant data in the event is the same even when I press different buttons. Is there any other way of differentiating between the buttons?