Dahua VTO to MQTT Broker

thanks for the logs,
it provides more clearity, will try to reproduce it, but it will take few days, bit overloaded

Hi, congratulation for hard work,
i have an VTO2211G-WP, have installed DahuaVTO2MQTT in a LCX container on Proxmox, my config is
version: “3”
services:
dahuavto2mqtt:
image: “registry.gitlab.com/elad.bar/dahuavto2mqtt:latest”
container_name: “dahuavto2mqtt”
hostname: “dahuavto2mqtt”
restart: “unless-stopped”
ports:
- 9563:9563
environment:
- DAHUA_VTO_HOST=192.168.1.150
- DAHUA_VTO_USERNAME=XXXX
- DAHUA_VTO_PASSWORD=XXXXX
- MQTT_BROKER_HOST=192.168.1.34
- MQTT_BROKER_PORT=1883
- MQTT_BROKER_USERNAME=XXXXX
- MQTT_BROKER_PASSWORD=XXXXXX
- MQTT_BROKER_TOPIC=DahuaVTO/Events
- MQTT_BROKER_TOPIC_PREFIX=DahuaVTO
- MQTT_BROKER_CLIENT_ID=DahuaVTO2MQTT
- EXPORTER_PORT=9563
- DEBUG=True
- TZ=Europe/Rome

I have the following errors

HELP dahuavto2mqtt_dahua_failed_messages Dahua Failed Messages

TYPE dahuavto2mqtt_dahua_failed_messages gauge

In Home Assistant Dahua Mqtt is not showed… :pensive:
How can i fix?
Thanks

PS i attach the links with events files from my Nextcloud

And here is the log file

Thank you for sharing. I thought I was alone in experiencing this problem. I also own a Lorex 2K Doorbell and I’m encountering the same magicBox alerts. I’m really hoping there’s a solution soon because I miss receiving HomeKit alerts. @bar, please let me know if you need any logs from me to assist in resolving this issue. thank you both

Not to take away from the work that @bar has and is doing, but there’s a working repo of a fork here: baudneo/dahuavto2mqtt: DahuaVTO2MQTT Image with some improvements. (github.com). If you’ve got a Lorex doorbell and desperately want working mqtt events, I’d suggest to give it a shot until such time as this repo supports Lorex’s whacked out implementation.

releasing new version to tackle the prasing, managed to reproduce the issue, not related to non Dahua branded devices.

tested it for Dahua device, feel free to test it to non-dahua-branded device and report back.

except variable name changing and documentation, i don’t get the difference in that repo,
the bug was related to the message that being received as byte array with headers, given the lack of documentation it was hard to understand how to match it to all cases, with the latest release, it is working as in the web page of the unit.

if the protocol is the same, it should work for Lorex as well,
if you find a gap and can provide sample data that I will be able to compare and apply fix for it, feel free.

thanks

Hello,
I’ve just bought a VTO2211G-WP.
I’ve set up DahuaVTO2MQTT on raspberry 4, through docker-ce, with the image of DahuaVTO2Mqtt that you released 2 days ago, with tag arm64v8.
When I start DahuaVTO2Mqtt I receive in mqtt all configuration informations.
But after that, no events at all are received. I’ve got only keepalive in the logs, even when I make a call, press button, open lock and so on.
I’ve try several settings on the VTO about security but fir instance with no success.

such like that :
2024-04-27 18:53:42,088 DEBUG clients.DahuaAPI Processing message #93, Endpoint: global.keepAlive, Message: {‘id’: 93, ‘params’: {‘timeout’: 55}, ‘result’: True, ‘session’: 1572811516}
2024-04-27 18:53:42,088 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-04-27 18:53:42,088 DEBUG clients.DahuaAPI Message #93 handled
2024-04-27 18:54:37,088 DEBUG clients.DahuaAPI Keep alive
2024-04-27 18:54:37,089 DEBUG clients.DahuaAPI Sending message, Data: {‘id’: 94, ‘session’: 1572811516, ‘magic’: ‘0x1234’, ‘method’: ‘global.keepAlive’, ‘params’: {‘timeout’: 55, ‘action’: True}}
2024-04-27 18:54:37,097 DEBUG clients.DahuaAPI Received data, Raw Data: b’ \x00\x00\x00DHIP\xfc2\xbf]^\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00{“id”:94,“params”:{“timeout”:55},“result”:true,“session”:1572811516}\n’
2024-04-27 18:54:37,098 DEBUG clients.DahuaAPI Processing message #94, Endpoint: global.keepAlive, Message: {‘id’: 94, ‘params’: {‘timeout’: 55}, ‘result’: True, ‘session’: 1572811516}
2024-04-27 18:54:37,098 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-04-27 18:54:37,098 DEBUG clients.DahuaAPI Message #94 handled
2024-04-27 18:55:32,120 DEBUG clients.DahuaAPI Keep alive
2024-04-27 18:55:32,165 DEBUG clients.DahuaAPI Sending message, Data: {‘id’: 95, ‘session’: 1572811516, ‘magic’: ‘0x1234’, ‘method’: ‘global.keepAlive’, ‘params’: {‘timeout’: 55, ‘action’: True}}
2024-04-27 18:55:32,196 DEBUG clients.DahuaAPI Received data, Raw Data: b’ \x00\x00\x00DHIP\xfc2\xbf]_\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00{“id”:95,“params”:{“timeout”:55},“result”:true,“session”:1572811516}\n’
2024-04-27 18:55:32,205 DEBUG clients.DahuaAPI Processing message #95, Endpoint: global.keepAlive, Message: {‘id’: 95, ‘params’: {‘timeout’: 55}, ‘result’: True, ‘session’: 1572811516}
2024-04-27 18:55:32,206 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-04-27 18:55:32,211 DEBUG clients.DahuaAPI Message #95 handled
2024-04-27 18:56:27,212 DEBUG clients.DahuaAPI Keep alive
2024-04-27 18:56:27,212 DEBUG clients.DahuaAPI Sending message, Data: {‘id’: 96, ‘session’: 1572811516, ‘magic’: ‘0x1234’, ‘method’: ‘global.keepAlive’, ‘params’: {‘timeout’: 55, ‘action’: True}}
2024-04-27 18:56:27,237 DEBUG clients.DahuaAPI Received data, Raw Data: b’ \x00\x00\x00DHIP\xfc2\xbf]`\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00{“id”:96,“params”:{“timeout”:55},“result”:true,“session”:1572811516}\n’
2024-04-27 18:56:27,237 DEBUG clients.DahuaAPI Processing message #96, Endpoint: global.keepAlive, Message: {‘id’: 96, ‘params’: {‘timeout’: 55}, ‘result’: True, ‘session’: 1572811516}
2024-04-27 18:56:27,237 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-04-27 18:56:27,238 DEBUG clients.DahuaAPI Message #96 handled
2024-04-27 18:57:22,238 DEBUG clients.DahuaAPI Keep alive
2024-04-27 18:57:22,238 DEBUG clients.DahuaAPI Sending message, Data: {‘id’: 97, ‘session’: 1572811516, ‘magic’: ‘0x1234’, ‘method’: ‘global.keepAlive’, ‘params’: {‘timeout’: 55, ‘action’: True}}
2024-04-27 18:57:22,256 DEBUG clients.DahuaAPI Received data, Raw Data: b’ \x00\x00\x00DHIP\xfc2\xbf]a\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00E\x00\x00\x00\x00\x00\x00\x00{“id”:97,“params”:{“timeout”:55},“result”:true,“session”:1572811516}\n’
2024-04-27 18:57:22,256 DEBUG clients.DahuaAPI Processing message #97, Endpoint: global.keepAlive, Message: {‘id’: 97, ‘params’: {‘timeout’: 55}, ‘result’: True, ‘session’: 1572811516}
2024-04-27 18:57:22,256 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-04-27 18:57:22,257 DEBUG clients.DahuaAPI Message #97 handled

Do I make a mistake ?

Best regards

thanks for the log, it seems that for your device messages are being sent as Unicode while in other devices messages are UTF-8,
as result of that it failed to parse the message, I hope that that finding will assist supporting more devices.

I released new version and will test it, once will have more details will share if it address issues above.

thanks

hi, sorry for the long time to identify the issue,
found the issue and fixed it locally, testing and will update once it is ready

seems that both issues of Dahua events not being triggered and parsing messages is gone with latest.
feel free to test and report back

thanks

Hello,

I’ve done the tests today, it’s work perfectly. Thank you !!!

You said “hi, sorry for the long time to identify the issue”. I said instead that you have take it into account very very quickly ! Thank you once again.

1 Like

Still not work, my event:

HELP python_gc_objects_collected_total Objects collected during gc

TYPE python_gc_objects_collected_total counter

python_gc_objects_collected_total{generation=“0”} 2560.0
python_gc_objects_collected_total{generation=“1”} 462.0
python_gc_objects_collected_total{generation=“2”} 0.0

HELP python_gc_objects_uncollectable_total Uncollectable objects found during GC

TYPE python_gc_objects_uncollectable_total counter

python_gc_objects_uncollectable_total{generation=“0”} 0.0
python_gc_objects_uncollectable_total{generation=“1”} 0.0
python_gc_objects_uncollectable_total{generation=“2”} 0.0

HELP python_gc_collections_total Number of times this generation was collected

TYPE python_gc_collections_total counter

python_gc_collections_total{generation=“0”} 59.0
python_gc_collections_total{generation=“1”} 5.0
python_gc_collections_total{generation=“2”} 0.0

HELP python_info Python platform information

TYPE python_info gauge

python_info{implementation=“CPython”,major=“3”,minor=“12”,patchlevel=“3”,version=“3.12.3”} 1.0

HELP process_virtual_memory_bytes Virtual memory size in bytes.

TYPE process_virtual_memory_bytes gauge

process_virtual_memory_bytes 4.2336256e+07

HELP process_resident_memory_bytes Resident memory size in bytes.

TYPE process_resident_memory_bytes gauge

process_resident_memory_bytes 2.920448e+07

HELP process_start_time_seconds Start time of the process since unix epoch in seconds.

TYPE process_start_time_seconds gauge

process_start_time_seconds 1.7149018788e+09

HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.

TYPE process_cpu_seconds_total counter

process_cpu_seconds_total 0.38

HELP process_open_fds Number of open file descriptors.

TYPE process_open_fds gauge

process_open_fds 13.0

HELP process_max_fds Maximum number of open file descriptors.

TYPE process_max_fds gauge

process_max_fds 1024.0

HELP dahuavto2mqtt_mqtt_status MQTT Connectivity Status

TYPE dahuavto2mqtt_mqtt_status gauge

dahuavto2mqtt_mqtt_status{instance=“DahuaVTO2MQTT”,version=“2024.04.28.59597”} 1.0

HELP dahuavto2mqtt_mqtt_incoming_messages MQTT Incoming Messages

TYPE dahuavto2mqtt_mqtt_incoming_messages gauge

HELP dahuavto2mqtt_mqtt_outgoing_messages MQTT Outgoing Messages

TYPE dahuavto2mqtt_mqtt_outgoing_messages gauge

dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/magicBox.getDeviceType”,version=“2024.04.28.59597”} 2.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/magicBox.getSoftwareVersion”,version=“2024.04.28.59597”} 2.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/magicBox.getSystemInfoNew”,version=“2024.04.28.59597”} 2.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/accessControl.factory.instance”,version=“2024.04.28.59597”} 2.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/magicBox.getSerialNo”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VideoWaterMark”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VideoWidget”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/ChannelTitle”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Web”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/RTSP”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Https”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/UserGlobal”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/AccessFilter”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Network”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/UPnP”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/BuildingExternal”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Multicast”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Qos”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/WMM”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/MotionDetect”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/BlindDetect”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/General”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/NTP”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/AutoMaintain”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/FlashLight”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Sound”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VideoTalkPhoneBasic”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Alarm”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Comm”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/SSHD”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VSP_CGI”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/MobilePhoneApplication”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/PwdReset”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/SafetyAbnormalAlarm”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/MediaEncrypt”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VSP_ONVIF”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/AccessControl”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/T2UServer”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/DialRule”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VTOBasicInfo”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Building”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VideoTalkPhoneGeneral”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VTOCall”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/RTMP”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/VideoStandard”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“Device/configManager.getConfig/Lighting”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“AlarmLocal/Event”,version=“2024.04.28.59597”} 2.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“AutoRegister/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“CallNoAnswered/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“DoorNotClosed/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“HangupPhone/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“IgnoreInvite/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“ProfileAlarmTransmit/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“RtspSessionDisconnect/Event”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“SIPRegisterResult/Event”,version=“2024.04.28.59597”} 8.0
dahuavto2mqtt_mqtt_outgoing_messages{instance=“DahuaVTO2MQTT”,topic=“NTPAdjustTime/Event”,version=“2024.04.28.59597”} 1.0

HELP dahuavto2mqtt_mqtt_failed_outgoing_messages MQTT Failed Outgoing Messages

TYPE dahuavto2mqtt_mqtt_failed_outgoing_messages gauge

HELP dahuavto2mqtt_dahua_status Dahua Connectivity Status

TYPE dahuavto2mqtt_dahua_status gauge

dahuavto2mqtt_dahua_status{instance=“DahuaVTO2MQTT”,version=“2024.04.28.59597”} 1.0

HELP dahuavto2mqtt_dahua_messages Dahua Messages

TYPE dahuavto2mqtt_dahua_messages gauge

dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“0”,topic=“global.login”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“global.login”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getSerialNo”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“accessControl.factory.instance”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getBootParameter”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getProductDefinition”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getProcessInfo”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getDeviceType”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getSoftwareVersion”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.factory.instance”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getDeviceClass”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“magicBox.getSystemInfoNew”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“configManager.getConfig”,version=“2024.04.28.59597”} 42.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“system.multicall”,version=“2024.04.28.59597”} 5.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“eventManager.attach”,version=“2024.04.28.59597”} 1.0
dahuavto2mqtt_dahua_messages{instance=“DahuaVTO2MQTT”,session_id=“2109691834”,topic=“global.keepAlive”,version=“2024.04.28.59597”} 4.0

HELP dahuavto2mqtt_dahua_failed_messages Dahua Failed Messages

TYPE dahuavto2mqtt_dahua_failed_messages gauge

Posting metrics of prometheus doesn’t provide any value for debugging, it is just metrics, only logs

Hello,

Thank you for the hard work on this. I am also trying to make this work and came across this post. I updated my container this morning, but in my logs I still see the unicode-utf8 issue described earlier.

Here the logs:

2024-05-08 04:46:52,447 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:46:51', 'Success': False, 'UTC': 1715143611.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:46:52,447 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:46:51', 'Success': False, 'UTC': 1715143611.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:47:33,455 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:47:33,455 DEBUG clients.DahuaAPI Sending message, Data: {'id': 91, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:47:33,474 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/[\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":91,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:47:33,475 DEBUG clients.DahuaAPI Processing message #91, Endpoint: global.keepAlive, Message: {'id': 91, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:47:33,475 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:47:33,475 DEBUG clients.DahuaAPI Message #91 handled
2024-05-08 04:47:50,455 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:47:49","Success":false,"UTC":1715143669.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:47:50,456 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:47:50,456 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:47:49', 'Success': False, 'UTC': 1715143669.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:47:50,456 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:47:49', 'Success': False, 'UTC': 1715143669.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:48:28,475 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:48:28,475 DEBUG clients.DahuaAPI Sending message, Data: {'id': 92, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:48:28,495 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/\\\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":92,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:48:28,495 DEBUG clients.DahuaAPI Processing message #92, Endpoint: global.keepAlive, Message: {'id': 92, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:48:28,495 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:48:28,496 DEBUG clients.DahuaAPI Message #92 handled
2024-05-08 04:48:48,459 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:48:47","Success":false,"UTC":1715143727.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:48:48,459 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:48:48,459 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:48:47', 'Success': False, 'UTC': 1715143727.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:48:48,459 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:48:47', 'Success': False, 'UTC': 1715143727.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:49:23,496 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:49:23,496 DEBUG clients.DahuaAPI Sending message, Data: {'id': 93, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:49:23,505 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/]\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":93,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:49:23,505 DEBUG clients.DahuaAPI Processing message #93, Endpoint: global.keepAlive, Message: {'id': 93, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:49:23,505 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:49:23,505 DEBUG clients.DahuaAPI Message #93 handled
2024-05-08 04:49:33,630 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\x1c\x01\x00\x00\x00\x00\x00\x00\x1c\x01\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"NTPAdjustTime","Data":{"Address":"10.23.42.1","Before":"08-05-2024 05:49:32","LocaleTime":"2024-05-08 05:49:32","UTC":1715143772.0,"result":true},"Index":0}]},"session":790894292}\n'
2024-05-08 04:49:33,630 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:49:33,631 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'NTPAdjustTime/Event', 'payload': {'Action': 'Pulse', 'Code': 'NTPAdjustTime', 'Data': {'Address': '10.23.42.1', 'Before': '08-05-2024 05:49:32', 'LocaleTime': '2024-05-08 05:49:32', 'UTC': 1715143772.0, 'result': True}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:49:33,631 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/NTPAdjustTime/Event: {'Action': 'Pulse', 'Code': 'NTPAdjustTime', 'Data': {'Address': '10.23.42.1', 'Before': '08-05-2024 05:49:32', 'LocaleTime': '2024-05-08 05:49:32', 'UTC': 1715143772.0, 'result': True}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:49:46,467 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:49:45","Success":false,"UTC":1715143785.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:49:46,467 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:49:46,467 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:49:45', 'Success': False, 'UTC': 1715143785.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:49:46,467 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:49:45', 'Success': False, 'UTC': 1715143785.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:50:18,505 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:50:18,506 DEBUG clients.DahuaAPI Sending message, Data: {'id': 94, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:50:18,515 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/^\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":94,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:50:18,515 DEBUG clients.DahuaAPI Processing message #94, Endpoint: global.keepAlive, Message: {'id': 94, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:50:18,515 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:50:18,516 DEBUG clients.DahuaAPI Message #94 handled
2024-05-08 04:50:44,456 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:50:43","Success":false,"UTC":1715143843.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:50:44,456 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:50:44,457 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:50:43', 'Success': False, 'UTC': 1715143843.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:50:44,457 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:50:43', 'Success': False, 'UTC': 1715143843.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:51:13,516 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:51:13,516 DEBUG clients.DahuaAPI Sending message, Data: {'id': 95, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:51:13,536 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/_\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":95,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:51:13,536 DEBUG clients.DahuaAPI Processing message #95, Endpoint: global.keepAlive, Message: {'id': 95, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:51:13,536 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:51:13,536 DEBUG clients.DahuaAPI Message #95 handled
2024-05-08 04:51:42,446 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:51:41","Success":false,"UTC":1715143901.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:51:42,446 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:51:42,446 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:51:41', 'Success': False, 'UTC': 1715143901.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:51:42,447 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:51:41', 'Success': False, 'UTC': 1715143901.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:52:08,536 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:52:08,537 DEBUG clients.DahuaAPI Sending message, Data: {'id': 96, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:52:08,556 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/`\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":96,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:52:08,556 DEBUG clients.DahuaAPI Processing message #96, Endpoint: global.keepAlive, Message: {'id': 96, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:52:08,557 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:52:08,557 DEBUG clients.DahuaAPI Message #96 handled
2024-05-08 04:52:40,459 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:52:39","Success":false,"UTC":1715143959.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:52:40,459 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:52:40,460 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:52:39', 'Success': False, 'UTC': 1715143959.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:52:40,460 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:52:39', 'Success': False, 'UTC': 1715143959.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:53:03,557 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:53:03,558 DEBUG clients.DahuaAPI Sending message, Data: {'id': 97, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:53:03,566 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/a\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":97,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:53:03,566 DEBUG clients.DahuaAPI Processing message #97, Endpoint: global.keepAlive, Message: {'id': 97, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:53:03,566 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:53:03,567 DEBUG clients.DahuaAPI Message #97 handled
2024-05-08 04:53:38,457 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:53:37","Success":false,"UTC":1715144017.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:53:38,457 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:53:38,457 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:53:37', 'Success': False, 'UTC': 1715144017.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:53:38,457 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:53:37', 'Success': False, 'UTC': 1715144017.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:53:58,567 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:53:58,567 DEBUG clients.DahuaAPI Sending message, Data: {'id': 98, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:53:58,576 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/b\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":98,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:53:58,576 DEBUG clients.DahuaAPI Processing message #98, Endpoint: global.keepAlive, Message: {'id': 98, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:53:58,576 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:53:58,577 DEBUG clients.DahuaAPI Message #98 handled
2024-05-08 04:54:33,627 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\x1c\x01\x00\x00\x00\x00\x00\x00\x1c\x01\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"NTPAdjustTime","Data":{"Address":"10.23.42.1","Before":"08-05-2024 05:54:32","LocaleTime":"2024-05-08 05:54:32","UTC":1715144072.0,"result":true},"Index":0}]},"session":790894292}\n'
2024-05-08 04:54:33,627 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:54:33,627 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'NTPAdjustTime/Event', 'payload': {'Action': 'Pulse', 'Code': 'NTPAdjustTime', 'Data': {'Address': '10.23.42.1', 'Before': '08-05-2024 05:54:32', 'LocaleTime': '2024-05-08 05:54:32', 'UTC': 1715144072.0, 'result': True}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:54:33,627 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/NTPAdjustTime/Event: {'Action': 'Pulse', 'Code': 'NTPAdjustTime', 'Data': {'Address': '10.23.42.1', 'Before': '08-05-2024 05:54:32', 'LocaleTime': '2024-05-08 05:54:32', 'UTC': 1715144072.0, 'result': True}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:54:36,457 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:54:35","Success":false,"UTC":1715144075.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:54:36,457 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:54:36,458 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:54:35', 'Success': False, 'UTC': 1715144075.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:54:36,458 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:54:35', 'Success': False, 'UTC': 1715144075.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}
2024-05-08 04:54:53,577 DEBUG clients.DahuaAPI Keep alive
2024-05-08 04:54:53,577 DEBUG clients.DahuaAPI Sending message, Data: {'id': 99, 'session': 790894292, 'magic': '0x1234', 'method': 'global.keepAlive', 'params': {'timeout': 55, 'action': True}}
2024-05-08 04:54:53,586 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/c\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00{"id":99,"params":{"timeout":55},"result":true,"session":790894292}\n'
2024-05-08 04:54:53,586 DEBUG clients.DahuaAPI Processing message #99, Endpoint: global.keepAlive, Message: {'id': 99, 'params': {'timeout': 55}, 'result': True, 'session': 790894292}
2024-05-08 04:54:53,587 DEBUG clients.DahuaAPI Set timer for 55 seconds to trigger keep alive message
2024-05-08 04:54:53,587 DEBUG clients.DahuaAPI Message #99 handled
2024-05-08 04:55:34,447 DEBUG clients.DahuaAPI Received data, Raw Data: b' \x00\x00\x00DHIP\xd4\x16$/=\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00\xec\x00\x00\x00\x00\x00\x00\x00{"id":61,"method":"client.notifyEventStream","params":{"SID":513,"eventList":[{"Action":"Pulse","Code":"SIPRegisterResult","Data":{"LocaleTime":"2024-05-08 05:55:33","Success":false,"UTC":1715144133.0},"Index":0}]},"session":790894292}\n'
2024-05-08 04:55:34,448 DEBUG clients.DahuaAPI Message #61 handled
2024-05-08 04:55:34,450 DEBUG clients.BaseClient MQTTClient Event received, Data: {'event': 'SIPRegisterResult/Event', 'payload': {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:55:33', 'Success': False, 'UTC': 1715144133.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}}
2024-05-08 04:55:34,450 DEBUG clients.MQTTClient Publishing MQTT message DahuaVTO/SIPRegisterResult/Event: {'Action': 'Pulse', 'Code': 'SIPRegisterResult', 'Data': {'LocaleTime': '2024-05-08 05:55:33', 'Success': False, 'UTC': 1715144133.0}, 'Index': 0, 'deviceType': 'DHI-VTO2111D-P-S2', 'serialNumber': 'redacted'}

My ENV from the container:

            "DAHUA_VTO_HOST=10.23.42.23",
            "DAHUA_VTO_USERNAME=placeholder",
            "DAHUA_VTO_PASSWORD=placeholder",
            "MQTT_BROKER_HOST=mqtt5",
            "MQTT_BROKER_PORT=1883",
            "MQTT_BROKER_USERNAME=placeholder",
            "MQTT_BROKER_PASSWORD=placeholder",
            "MQTT_BROKER_TOPIC_PREFIX=DahuaVTO",
            "MQTT_BROKER_CLIENT_ID=DahuaVTO2MQTT",
            "EXPORTER_PORT=9563",
            "DEBUG=TRUE",
            "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "LANG=C.UTF-8",
            "GPG_KEY=7169506F62C751356D054A26A821E680E5FA6305",
            "PYTHON_VERSION=3.12.3",
            "PYTHON_PIP_VERSION=24.0",
            "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py",
            "PYTHON_GET_PIP_SHA256=dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9"
        ],

Hello,

I tried to find a solution to this issue but so far no success. Are there any more information I can provide to you to help?

sorry,
my log:

2024-05-08 18:55:36,773 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-08 18:55:41,774 INFO clients.DahuaClient Connecting
2024-05-08 18:55:41,849 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-08 18:55:41,868 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-08 18:55:41,868 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-08 18:55:41,868 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-08 18:55:41,868 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-08 18:55:41,891 INFO models.DahuaDevice Hold time: 5
2024-05-10 10:31:28,804 ERROR clients.DahuaAPI Failed to handle message, Data: b’ \x00\x00\x00DHIP\xfc!#E\\n\x00\x00G\x00\x00\x00\x00\x00\x00\x00G\x00\x00\x00\x00\x00\x00\x00{“id”:2652,“params”:{“timeout”:55},“result”:true,“session”:1159930364}\n’, Error: ‘unicodeescape’ codec can’t decode byte 0x5c in position 12: \ at end of string, Line: 135
2024-05-10 10:34:27,283 INFO clients.DahuaAPI Server sent EOF message
2024-05-10 10:34:27,283 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-10 10:34:32,283 INFO clients.DahuaClient Connecting
2024-05-10 10:34:33,781 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-10 10:34:33,789 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-10 10:34:33,809 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-10 10:34:33,809 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-10 10:34:33,810 INFO models.DahuaDevice Hold time: 5
2024-05-10 10:34:33,810 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-10 14:45:12,855 INFO main Loading DahuaVTO2MQTT configuration, Version: 2024.04.28.59597
2024-05-10 14:45:12,856 INFO clients.BaseClient Initialize MQTTClient
2024-05-10 14:45:12,857 INFO clients.BaseClient Starting to connect MQTTClient, Should connect: True
2024-05-10 14:45:12,857 INFO clients.BaseClient Initialize DahuaClient
2024-05-10 14:45:12,857 INFO clients.BaseClient Starting to connect DahuaClient, Should connect: True
2024-05-10 14:45:13,857 INFO clients.MQTTClient MQTT Broker is trying to connect…
2024-05-10 14:45:13,858 INFO clients.DahuaClient Connecting
2024-05-10 14:45:13,926 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-10 14:45:13,941 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-10 14:45:13,941 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-10 14:45:13,941 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-10 14:45:13,968 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-10 14:45:13,969 INFO models.DahuaDevice Hold time: 5
2024-05-10 14:45:16,957 ERROR clients.MQTTClient Failed to connect to broker, retry in 60 seconds, error: [Errno 113] Host is unreachable, Line: 54
2024-05-10 14:46:16,958 INFO clients.MQTTClient MQTT Broker is trying to connect…
2024-05-10 14:46:20,061 ERROR clients.MQTTClient Failed to connect to broker, retry in 60 seconds, error: [Errno 113] Host is unreachable, Line: 54
2024-05-10 14:47:20,062 INFO clients.MQTTClient MQTT Broker is trying to connect…
2024-05-10 14:47:20,063 INFO clients.MQTTClient MQTT Broker connected with result code 0
2024-05-12 06:21:05,788 ERROR clients.DahuaAPI Failed to handle message, Data: b’ \x00\x00\x00DHIP\x1f\x0e\xab1\\n\x00\x00F\x00\x00\x00\x00\x00\x00\x00F\x00\x00\x00\x00\x00\x00\x00{“id”:2652,“params”:{“timeout”:55},“result”:true,“session”:833293855}\n’, Error: ‘unicodeescape’ codec can’t decode byte 0x5c in position 12: \ at end of string, Line: 135
2024-05-12 06:24:00,247 INFO clients.DahuaAPI Server sent EOF message
2024-05-12 06:24:00,248 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-12 06:24:05,248 INFO clients.DahuaClient Connecting
2024-05-12 06:24:05,311 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-12 06:24:05,323 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-12 06:24:05,323 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-12 06:24:05,323 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-12 06:24:05,342 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-12 06:24:05,381 INFO models.DahuaDevice Hold time: 5
2024-05-13 21:59:54,346 ERROR clients.DahuaAPI Failed to handle message, Data: b’ \x00\x00\x00DHIP\xc9\x95\x94U\\n\x00\x00G\x00\x00\x00\x00\x00\x00\x00G\x00\x00\x00\x00\x00\x00\x00{“id”:2652,“params”:{“timeout”:55},“result”:true,“session”:1435801033}\n’, Error: ‘unicodeescape’ codec can’t decode byte 0x5c in position 12: \ at end of string, Line: 135
2024-05-13 22:02:50,995 INFO clients.DahuaAPI Server sent EOF message
2024-05-13 22:02:50,995 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-13 22:02:55,996 INFO clients.DahuaClient Connecting
2024-05-13 22:02:56,059 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-13 22:02:56,059 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-13 22:02:56,077 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-13 22:02:56,077 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-13 22:02:56,078 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-13 22:02:56,094 INFO models.DahuaDevice Hold time: 5
2024-05-15 13:38:46,841 ERROR clients.DahuaAPI Failed to handle message, Data: b’ \x00\x00\x00DHIP\x0c\xba\xd9\r\\n\x00\x00F\x00\x00\x00\x00\x00\x00\x00F\x00\x00\x00\x00\x00\x00\x00{“id”:2652,“params”:{“timeout”:55},“result”:true,“session”:232372748}\n’, Error: ‘unicodeescape’ codec can’t decode byte 0x5c in position 0: \ at end of string, Line: 135
2024-05-15 13:41:41,860 INFO clients.DahuaAPI Server sent EOF message
2024-05-15 13:41:41,861 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-15 13:41:46,861 INFO clients.DahuaClient Connecting
2024-05-15 13:41:46,921 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-15 13:41:46,933 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-15 13:41:46,933 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-15 13:41:46,934 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-15 13:41:46,934 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-15 13:41:46,943 INFO models.DahuaDevice Hold time: 5
2024-05-17 05:17:35,136 ERROR clients.DahuaAPI Failed to handle message, Data: b’ \x00\x00\x00DHIP\xe1&a\x1f\\n\x00\x00F\x00\x00\x00\x00\x00\x00\x00F\x00\x00\x00\x00\x00\x00\x00{“id”:2652,“params”:{“timeout”:55},“result”:true,“session”:526460641}\n’, Error: ‘unicodeescape’ codec can’t decode byte 0x5c in position 12: \ at end of string, Line: 135
2024-05-17 05:20:33,106 INFO clients.DahuaAPI Server sent EOF message
2024-05-17 05:20:33,106 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-17 05:20:38,106 INFO clients.DahuaClient Connecting
2024-05-17 05:20:38,182 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-17 05:20:38,190 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-17 05:20:38,190 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-17 05:20:38,216 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-17 05:20:38,216 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-17 05:20:38,217 INFO models.DahuaDevice Hold time: 5
2024-05-18 20:56:25,132 ERROR clients.DahuaAPI Failed to handle message, Data: b’ \x00\x00\x00DHIPI\n|n\\n\x00\x00G\x00\x00\x00\x00\x00\x00\x00G\x00\x00\x00\x00\x00\x00\x00{“id”:2652,“params”:{“timeout”:55},“result”:true,“session”:1853622857}\n’, Error: ‘unicodeescape’ codec can’t decode byte 0x5c in position 2: \ at end of string, Line: 135
2024-05-18 20:59:24,591 INFO clients.DahuaAPI Server sent EOF message
2024-05-18 20:59:24,591 INFO clients.DahuaClient Disconnected, will try to connect in 5 seconds
2024-05-18 20:59:29,591 INFO clients.DahuaClient Connecting
2024-05-18 20:59:29,655 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-18 20:59:29,671 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-18 20:59:29,671 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-18 20:59:29,671 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-18 20:59:29,672 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-18 20:59:29,734 INFO models.DahuaDevice Hold time: 5
2024-05-19 13:04:44,102 INFO main Loading DahuaVTO2MQTT configuration, Version: 2024.04.28.59597
2024-05-19 13:04:44,104 INFO clients.BaseClient Initialize MQTTClient
2024-05-19 13:04:44,104 INFO clients.BaseClient Starting to connect MQTTClient, Should connect: True
2024-05-19 13:04:44,105 INFO clients.BaseClient Initialize DahuaClient
2024-05-19 13:04:44,105 INFO clients.BaseClient Starting to connect DahuaClient, Should connect: True
2024-05-19 13:04:45,105 INFO clients.MQTTClient MQTT Broker is trying to connect…
2024-05-19 13:04:45,106 INFO clients.DahuaClient Connecting
2024-05-19 13:04:45,106 INFO clients.MQTTClient MQTT Broker connected with result code 0
2024-05-19 13:04:45,154 INFO models.DahuaDevice Serial Number: 9B013E8PAJ3955A
2024-05-19 13:04:45,164 INFO models.DahuaDevice Type: DHI-VTO2211G-WP
2024-05-19 13:04:45,164 INFO models.DahuaDevice Version: 4.511.0000000.0.R
2024-05-19 13:04:45,165 INFO models.DahuaDevice Build Date: 2022-05-23
2024-05-19 13:04:45,191 INFO models.DahuaDevice Access Control Instance ID: 57453128
2024-05-19 13:04:45,226 INFO models.DahuaDevice Hold time: 5

@bar this might be of interest to you (and your users) - I did some work to extract the VTO username and password from a preconfigured VTH:
https://alastair.d-silva.org/dahua-vth-escapades

Out of the blue about a week or so ago I noticed that the version @baudneo has that was working stopped. It was throwing errors about processing messages and looked exactly like the old errors I had with @bar’s version before it was fixed to parse unicode/utf-8.

Not exactly sure what triggered it to happen, and the firmware of the doorbell was reporting a version from 2022 so I don’t think it updated, but in any case, I switched to the current release @bar has and it seems to be working (again) :slight_smile:

What errors? I’m still running the same code with a lorex 2k doorbell without issues.