Dahua VTO to MQTT Broker

Can you republish the previous version (1.0.8?) as 1.0.10 while it gets fixed?

There may be better ways, but while we wait for a new build, this is how I got things working:

  1. Fetch https://github.com/elad-bar/DahuaVTO2MQTT/archive/97daf1df80c01d6c305ea82e0cc84d6ed33e1895.zip
  2. Extract this to somewhere on your system
  3. Setup a docker-compose as per the original instructions, but instead of image use ā€˜build: /path/to/where/you/extracted/the/zipā€™ (ie, the path to the directory containing the Dockerfile)
  4. docker-compose up dahuavto2mqtt

In case you are using the docker and not the addon it will work for you,
The issue related only to the addon

I just tried porting the code of this addon from PHP to Node.js and annotating it during the process (maybe itā€™s my irrational dislike for PHPā€™s syntax, but I find anything written in PHP hard to understand).
I think the result is much more readable and most people willing to contribute will find it easier to deal with javascript than with PHP.

This is the repo with the code: https://github.com/cibernox/DahuaDoorbell2MQTT
And this is the repo that can be added to home assistant to install it: https://github.com/cibernox/home-assistant-addons

Iā€™ve noticed that home assistant an error message during installation but it does install correctly anyway. I need to investigate why that is.

Credit goes to @bar entirely, I just ported it to node.js.

I am however experimenting with adding more utilities to load the last calls. I need to figure out the API of the doorbell, but perhaps it could evolve enough to create a UI card on top of it so you can answer directly in the home assistant UI.

@TheCondor I copied your configuration without luck.

I added my sip user but my mobile didnā€™t ring.

here the log:
[2020-12-30 11:50:45] NOTICE[1203][C-00000004] chan_sip.c: Call from ā€˜8001ā€™ (192.168.0.19:5060) to extension ā€˜9901ā€™ rejected because extension not found in context ā€˜from-internalā€™.

Release new version, ported the code to Python,
Docker is now based on python:3.9-alpine.

Will update the addon later today.

Updated the add-on, please let me know if you have any issue,
Addon version: 1.0.10

Small issue :-). wont start

[19:21:48] INFO: Staring Dahua to MQTT
/app/run.sh: line 19: python: command not found
[cmd] /bin/ash exited 127
[cont-finish.d] executing container finish scriptsā€¦
[cont-finish.d] 99-message.sh: executingā€¦

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Hi,
I tried to update your add-on. First I update the docker image

Second step I update add-on. Now I get the following errors:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: DahuaVTO2MQTT
 Listens to events from Dahua VTO unit and publishes them via MQTT Message
-----------------------------------------------------------
 Add-on version: 1.0.10
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[19:16:54] ERROR: Unknown HTTP error occured
 System:   (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2020.12.2
 Home Assistant Supervisor: 2020.12.7
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:16:57] INFO: @@@@@@@@@@@@@@@@
/usr/bin/curl
[19:16:57] INFO: @@@@@@@@@@@@@@@@
[19:16:57] INFO: FFS
[19:16:57] INFO: Staring Dahua to MQTT
/app/run.sh: line 19: python: command not found
[cmd] /bin/ash exited 127
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Am I doing a mistake?

Greetings Kay

Please try again, there was an issue that I fixed in v1.0.11 an hour ago

In addition, if you are using addon use the addon, the image of the addon is not the same as the image of the simple version

Hi Bar, with this new version of the Add-on is it possible to add two VTO units?

2 vtoā€™s would be nice idd
i have an VTH to the screen and thats possible there to

I thin I donā€™t understand how to use the different methods of installing.
I can install the dahua vto in 3 different ways.
I can use a hacs addon or your integration package at GitHub or the docker version. Which components I have to use?
Can you explain wich is the best way to install the addon and what I have to do?
Iā€™ve read the whole thread, but I donā€™t understand everything with my school English.

Nice. It works now. Thank you!

Yes there are 3 options,

  1. Originally, i developed the integration as component within HA, but since there are no action components related to it (just an event) and the fact I used polling data from the deviceā€™s log, I stopped maintaining it and switch to different approaches, I strongly recommend not to use the component
  2. DahuaVTO2MQTT id the successor, it listens to events and transform the into MQTT messages, itā€™s not platform related, meaning, not just HA users can enjoy it, actually, itā€™s not coupled to any home automation platform, I use it with NodeRED, you can set up multiple instances to support multi devices, Iā€™m working with that approach
  3. DahuaVTO2MQTT as an addon, same as #2 but coupled for HA, itā€™s eadier to install, I just prefer the flexibility to control what is running on my servers, HA core provides it so Iā€™m not using that approach

No, the addon supports 1 device, docker version can be run multiple times for each device

Hi @bar,
I tried to work with the docker version (portainer.io on rp4).
The image is running for some seconds. I look at the locks and I get this error:

standard_init_linux.go:219: exec user process caused: exec format error

i had installed the portainer completed new and build the image with the stack from post #1.

Greetings,
Kay

Do you know if it works with DAHUA VTO2211G-WP??
If I have an integration with HA, VTO will ring in mobile app in parallel to notification in HA? Or only one configuration is possible?

Donā€™t know if it works, but there is just one way to find out :slight_smile:,
It shouldnā€™t interrupt the mobile app