Dahua VTO to MQTT Broker

Interesting, and possibly backs up my thought that it didn’t update its firmware. I didn’t think to save the errors at the time and switched repos and it was working so I’ve just stuck with it currently. If I have time I may switch back and if I get the errors again I’ll raise a github issue (didn’t want to post one just saying “not working” and no error logs).

At the same time, I’m dealing with a flaky USB nic on my server and it could have been related to that.

In any case however, it does seem like @bar’s current version is working with the Lorex 2k doorbell cam, so I wonder if the original auth issue that sparked the fork has been fixed?

Release of April was about support different encoding, Dahua branded using different encoding compared to non-Branded solution, it is possible to identify it using the first chars in the message,
@baudneo is there additional functionality missing that requires your fork?

Hi, I’ve recently installed my dahuavto and have dahua vto to mqtt broker running in my HA. But I’m getting this error when pushing the call button:

MQTT message published, Topic: DahuaVTO/CallNoAnswered/Event, Payload: {“Action”:“Start”,“Data”:{“CallID”:“5”,“IsEncryptedStream”:false,“LocaleTime”:“2024-07-19 17:58:35”,“LockNum”:2,“SupportPaas”:false,“TCPPort”:37777,“UTC”:1721411915,“UserID”:“9901”}}
PHP Notice: Undefined variable: eventList in /app/DahuaVTO.php on line 438

I don’t see any error in the MQTTBROKER.

any help?

thanks!

Which source are you using for installation?
Code is python and the error is for php

Thanks

Yes, I found it strange to be a php extension too…

This is the repository:

Troy Kelly’s Add Ons
Troy Kelly [email protected]

It is not the source code related to this thread, pls check the OP

Ups, sorry. I’m new in the community. I’ll try this integration too.

Thanks!

np, after updating to the latest version,
Pls let me know if it works for you or you need assistance

A bit more info if you’re confused - that collection of addons is pulling some other PHP repo that the owner of that collection has. Plus, the files they have in that collection reference an archived github repo for a now discontinued version of this project.

In this thread somewhere @bar mentions their current repo which is hosted on gitlab and you should try that instead of what’s in that outdated collection.

Yes, I saw this one: Elad Bar / DahuaVTO2MQTT · GitLab, but it is not an add-on but a docker image. I’m running HA OS and don’t know how to deploy it, I’ve read an add-on should be created first.

Please can someone advise how a non-coder can learn to install this. I am technically competent, but not a coder. I have HACS, have set up MQTT, but am not able to understand the process of install using the “docker compose”. Many thanks, Dan

This is not an integration of HA, it translates the events from Dahua based devices to MQTT and allows also to open the door with another MQTT message,
In HA you can create automation based on the payloads.

You don’t need to be developer just the ability to run docker container according to the readme,
If the configuration will point the same MQTT broker HA is using, it will work

I don’t think so, I basically just allowed for some specific handshake callbacks to error and continue along because I noticed that sometimes the lorex unit’s wouldn’t reply with expected data (FW version,
model #, etc.).

I did also break up debug logging into mqtt and API side so when debugging the API, mqtt debug logs don’t flood the logs and vice versa.

I’ve recently upgraded from the 2k lorex doorbell to the 4k lorex doorbell and this no longer seems to work, is the 4k that much different? Any help would be appreciated…

Search for DahuaVTO in HACS and give that a shot… it’s entirely Python based and if all you really need is the doorbell event, hopefully it works.

If not, I wonder if the API language the 4k’s using has changed - turn on debugging and see what you get as output.

Hello. I have been using dahuavto2mqtt for a long time, and recently my Lorex 2k Doorbell asked to do a firmware update. Unfortunately i accepted and since then my dahuavto2mqtt is unable to connect. no settings have been changed on my setup and i checked the logs that indicate it stopped working once i upgraded the device firmware. here are the logs (lots of duplicates removed)

.................
2025-01-21T01:24:31.090460535Z 2025-01-20 19:24:31,090 INFO __main__ Publishing MQTT message FrontDoor/TimeChange/Event: {'Action': 'Pulse', 'Code': 'TimeChange', 'Data': {'BeforeModifyTime': '2025-01-20 19:24:31', 'LocaleTime': '2025-01-20 19:24:31', 'ModifiedTime': '2025-01-20 19:24:31', 'UTC': 1737422671.0}, 'Index': 0}
2025-01-21T01:24:31.092928718Z 2025-01-20 19:24:31,092 INFO __main__ Publishing MQTT message FrontDoor/NTPAdjustTime/Event: {'Action': 'Pulse', 'Code': 'NTPAdjustTime', 'Data': {'Address': 'pool.ntp.org', 'Before': '2025-01-20 19:24:30', 'LocaleTime': '2025-01-20 19:24:31', 'UTC': 1737422671.0, 'result': True}, 'Index': 0}
2025-01-21T01:24:38.712349921Z 2025-01-20 19:24:38,711 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': '', 'LocaleTime': '2025-01-20 19:24:38', 'Progress': 0, 'State': 'Upgrading', 'UTC': 1737422678.0}, 'Index': 0}
2025-01-21T01:24:42.981595984Z 2025-01-20 19:24:42,981 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'dhdtb.bin.img', 'LocaleTime': '2025-01-20 19:24:42', 'Progress': 0, 'State': 'Upgrading', 'UTC': 1737422682.0}, 'Index': 0}
2025-01-21T01:24:43.615807959Z 2025-01-20 19:24:43,615 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'kernel.img', 'LocaleTime': '2025-01-20 19:24:43', 'Progress': 0, 'State': 'Upgrading', 'UTC': 1737422683.0}, 'Index': 0}
.............
2025-01-21T01:24:45.811365746Z 2025-01-20 19:24:45,811 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'kernel.img', 'LocaleTime': '2025-01-20 19:24:45', 'Progress': 15, 'State': 'Upgrading', 'UTC': 1737422685.0}, 'Index': 0}
2025-01-21T01:24:46.489688304Z 2025-01-20 19:24:46,489 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'romfs-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:46', 'Progress': 15, 'State': 'Upgrading', 'UTC': 1737422686.0}, 'Index': 0}
2025-01-21T01:24:47.046308908Z 2025-01-20 19:24:47,045 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'romfs-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:47', 'Progress': 16, 'State': 'Upgrading', 'UTC': 1737422687.0}, 'Index': 0}
..................
2025-01-21T01:24:55.201223433Z 2025-01-20 19:24:55,200 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'romfs-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:55', 'Progress': 80, 'State': 'Upgrading', 'UTC': 1737422695.0}, 'Index': 0}
2025-01-21T01:24:55.208374339Z 2025-01-20 19:24:55,207 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'pd-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:55', 'Progress': 80, 'State': 'Upgrading', 'UTC': 1737422695.0}, 'Index': 0}
2025-01-21T01:24:55.304994359Z 2025-01-20 19:24:55,304 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'web-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:55', 'Progress': 80, 'State': 'Upgrading', 'UTC': 1737422695.0}, 'Index': 0}
2025-01-21T01:24:55.503018878Z 2025-01-20 19:24:55,502 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'web-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:55', 'Progress': 81, 'State': 'Upgrading', 'UTC': 1737422695.0}, 'Index': 0}
2025-01-21T01:24:55.636822728Z 2025-01-20 19:24:55,636 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'web-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:55', 'Progress': 82, 'State': 'Upgrading', 'UTC': 1737422695.0}, 'Index': 0}
2025-01-21T01:24:55.728835032Z 2025-01-20 19:24:55,728 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'web-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:55', 'Progress': 83, 'State': 'Upgrading', 'UTC': 1737422695.0}, 'Index': 0}
2025-01-21T01:24:56.128612979Z 2025-01-20 19:24:56,128 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'firmware-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:56', 'Progress': 83, 'State': 'Upgrading', 'UTC': 1737422696.0}, 'Index': 0}
...............
2025-01-21T01:24:58.411209003Z 2025-01-20 19:24:58,410 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': 'firmware-x.squashfs.img', 'LocaleTime': '2025-01-20 19:24:58', 'Progress': 100, 'State': 'Upgrading', 'UTC': 1737422698.0}, 'Index': 0}
2025-01-21T01:24:58.685735742Z 2025-01-20 19:24:58,685 INFO __main__ Publishing MQTT message FrontDoor/Upgrade/Event: {'Action': 'Pulse', 'Code': 'Upgrade', 'Data': {'CurCustomVer': 0, 'File': '', 'LocaleTime': '2025-01-20 19:24:58', 'Progress': 100, 'State': 'Succeeded', 'UTC': 1737422698.0}, 'Index': 0}
2025-01-21T01:25:08.972320387Z 2025-01-20 19:25:08,972 INFO __main__ Publishing MQTT message FrontDoor/StorageChange/Event: {'Action': 'Pulse', 'Code': 'StorageChange', 'Data': {'Group': 'ReadWrite', 'LocaleTime': '2025-01-20 19:25:08', 'Path': '\\/mnt\\/sd', 'UTC': 1737422708.0}, 'Index': 0}
2025-01-21T01:25:09.392717943Z 2025-01-20 19:25:09,392 INFO __main__ Publishing MQTT message FrontDoor/Reboot/Event: {'Action': 'Start', 'Code': 'Reboot', 'Data': {'LocaleTime': '2025-01-20 19:25:09', 'UTC': 1737422709.0}, 'Index': 0}
2025-01-21T01:26:26.442634298Z 2025-01-20 19:26:26,442 ERROR __main__ server closed the connection
2025-01-21T01:26:26.442701777Z 2025-01-20 19:26:26,442 WARNING __main__ Disconnected, will try to connect in 5 seconds
2025-01-21T01:26:31.447543906Z 2025-01-20 19:26:31,447 INFO __main__ Connecting
2025-01-21T01:26:31.486266654Z 2025-01-20 19:26:31,485 ERROR __main__ Connection failed will try to connect in 30 seconds, error: [Errno 111] Connect call failed ('172.16.10.65', 5000), Line: 357
2025-01-21T01:27:01.508470798Z 2025-01-20 19:27:01,508 INFO __main__ Connecting
2025-01-21T01:27:01.517828160Z 2025-01-20 19:27:01,517 ERROR __main__ Connection failed will try to connect in 30 seconds, error: [Errno 111] Connect call failed ('172.16.10.65', 5000), Line: 357
2025-01-21T01:27:31.524429671Z 2025-01-20 19:27:31,524 INFO __main__ Connecting
2025-01-21T01:27:31.528864616Z 2025-01-20 19:27:31,528 ERROR __main__ Connection failed will try to connect in 30 seconds, error: [Errno 111] Connect call failed ('172.16.10.65', 5000), Line: 357
...............

Any ideas where to start? It shows it’s on firmware 2.820.0100000000.28.R.20240520 now. Camera model B451AJ.

No fix, but thank you for reporting this. I just checked my Lorex 2k doorbell and as soon as I went to settings, it told me to upgrade the firmware too (couldn’t do anything but close the app). I’ll sit on it a bit until someone may have figured out what’s going on.

Is it simply unable to connect now?

Try port scanning the doorbell, maybe they changed ports in the firmware upgrade.

Tried and just getting:

Dahua VTO: [Errno 111] Connect call failed (‘192.168.x.x’, 5000), retry in 10 seconds

I found someone else talking about upgrading their Lorex 2k doorbell to the latest firmware and supposedly port 5000 is now closed and they have only RTSP and port 35000 open (source: Lorex 2K doorbell | Page 3 | IP Cam Talk).

For anyone here who’s upgraded, try changing from port 5000 to 35000 to see if it can connect.

1 Like