Do you have a vto2000a. I could not get th e componrnt to work. A lot of rtsp conect disconnect and just first ring event published.
no, I have a VTO3211D-P and I use it under the following environment:
- linked to native Dahua iDMSS app (barely getting ring notificatons, but for 2 way talking I didnāt find alternative option)
- itās linked also to a BlueIris server (win, running 24/7)
- BlueIris linked to a Deepstack instance running in Docker on the same Win machine, for object (hopefully later for face) recognition, and based on positive recognition sending back alerts to BlueIris for recording 4K res, and sending MQTT āmotionā sensor triggers to Home Assistant
- on the same Docker on Win machine runs the Dahua VTO MQTT, sending all events towards Home Assistant
- and Home Assistant running on a separate Ubuntu server
With this setup, I can achieve the following with near real time speed (~2-3 sec delay over 4G):
- I get rich critical (I get sound even when phone is muted) notification on iPhone withsnapshot from VTO camera when someone approaching the door from a distance, based on Deepstackās object recognition and BlueIris āmotionā triggering
- when someone presses the doorbell button on my Dahua VTO, I get rich critical notification on iPhone with snapshot from VTO camera. Dorr unlocking, and 2 way talk is only possible for me at the moment via iDMSS
What Iād like to add in the near future (and seeking for help in it ):
- add family member photos to Deepstack to recognize faces, and automatically unlock door via Dahua VTO device, without human interference (pressing button on VTO, or me pressing door unlock button in iDMSS app)
- add door unlock service into HA and my rich actionable notification on iPhone, so I donāt have to first unlock phone, look for iDMSS, open door channel, then press unlock door button in app, just unlock the door from the notification itself
dvbit, I recommend you to try the docker version of this VTO MQTT broker, runs pretty smooth and solid. Since I myself is not a comman terminal guru, another comment in this thread above somewhere helped me how to get it running properly in windows docker: I copied Elad Barās docker compose commands in to a yaml file (obviously entering the proper info first, like IP address of device, and user/passw, eg.: vto.yaml), and then used this command in powershell to start the docker container: ādocker-compose -f vto.yaml upā
It connected straight at the first try for me, never stopped and never failed since
how did you create this entity in HA?
Hello Maurizio, very simple, in configuration.yaml you have to define first an MQTT binary sensor to receive doorbell ring event, and then a switch device with a command line platform to open the gate.
I assume the following:
- you have MQTT broker installed and configured in HA, ready to receive MQTT messages coming from various devices
- you have setup Elad Barās Dahua VTO MQTT converter, wheather in HA itself as an integration, or even better running it in a docker container somewhere, configured it correctly, and itās communicating properly with the VTO.
Then, you do it in configuration.yaml, first adding a binary sensor to listen to MQTT messages coming from Eladās converter (so from your VTO device). This is only to catch one specific event, which is the doorbell button press: ā¦ /BackKeyLight/Event
As far as I understand there are many other events that could be caught, like someone opened the gate with a MIFAR card, and you can receive the userās name, but thatās still ahead of me. Later, you need to define more binary sensors for each separate topic I think, hope someone reassures me on this. So, go on, and add the binary sensor along your other sensor which Iām sure you already have some. Make sure to use the topic name that you have configured in Eladās VTO MQTT translator!!!
binary_sensor:
- platform: mqtt
name: "Dahua VTO doorbell buttton press event"
state_topic: 'WHATEVER_TOPICNAME_YOU_GAVE_AT_DAHUA_MQTT_BROKER/BackKeyLight/Event'
value_template: '{{ value_json.Data.State }}'
payload_on: "1"
payload_off: "0"
off_delay: 10
after a HA restart youāll be able to receive these events, and then build automations on it. I use it to receive rich notifications on my iPhone that someone pressed the doorbell, and now I managed to have action button right under the notification, to open the gate
I achieved it with this command line switch defition in configuration.yaml, this I can turn on with a service call switch.turn_on. Make sure to replace in the code your username, password what you use to login to the Dahua VTO web interface, plus exchange the Xs with your actual IP address of the VTO device.
switch:
- platform: command_line
switches:
dahua_gate_open:
command_on: "/usr/bin/curl -s --globoff --digest --user YOUR_WEB_ADMIN_USERNAME:YOURPASSWORD 'http://XXX.XXX.X.XXX/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote'"
friendly_name: 'Open yard door'
Sorry if all that above sound too teacherish, but in the beginning I was struggling heavily as well understanding how does this whole HA thing work, where to put in what format and why
Now Iām trying to help others who are joining this great world of home automatization similar to me with no experience at all in programming.
Hope this helps.
I have 5 main components that together provides what you need:
-
BlueIris Server (with BlueIris integration)
* 17 cameras are connected to BlueIris Server -
Dahua VTO unit (with DahuaVTO2MQTT intergation)
-
DeepStack Container (using GPU)
-
IP2MQTT service (I wrote in .net core)
-
NodeRED
DahuaVTO2MQTT integration
-
DahuaVTO2MQTT transforms events from the Dahua VTO unit into MQTT message
-
Messages from MQTT with the relevant topic are being handled by NodeRED
-
Flow entry point is by
DahuaVTO/Invite/Event
topic of MQTT -
Action #1 - ring through Xiaomi Hub
-
Action #2 - Announcement by Google Home that someone is waiting at the gate
-
Action #3 - Send a telegram message to my wife and my phone
-
Telegram message is being sent image from the camera (via BlueIris server) and a button (inline keyboard) to open the gate
The following step requires a feature that is not yet available in official HA,
I modified the telegram_bot functionality for that and done a pull request, someone from the community promoted it and hopefully next version you can have it as well - when sending a notification, it will return the ID of the message
- After 1 minute the message sent by telegram, the button will disappear (to avoid having multiple messages with multiple buttons)
IP2MQTT integration
IP2MQTT is a .net core service I wrote to connect to multiple camera for image processing, based on result identify the person* and publish MQTT message for automation purposes.
this solution is running at my home for over 1.5 year (since DS was released),
these days Iām working on documentation for it, but you can play with it from DockerHub in the upcoming link:
https://hub.docker.com/r/eladbar/ip2mqtt
I need more time to clean up the repo of IP2MQTT before I will change it to public, hopefully next week.
It runs facial recognition using DeepStack / MachineBox every second on each camera,
and since DeepStack / MachineBox can store each trained image by a single unique name - IP2MQTT transforms image name to a person using configuration.
there are 2 kind of MQTT messages that are being published
-
Status every 30 seconds - number of images downloaded and processed, average time for downloading and processing and available camera
-
Per camera every second - processed details message - it contains the persons identified (hiding the name of the image and presents the person), per person the confidence level, token for accessing the image (will elaborate on that later in NodeRED section) and IP2MQTT Status.
IP2MQTT Status:
-
Identified - Face was recognized and match to a person
-
Unidentified - Face was not recognized
-
Unregistered - Face was recognized and didnāt match to a person
-
NotFound - No face found in the image
-
Failed - Error in the process / downloading
With the latest version of DeepStack using GPU I can process an image within less than 60 MSec + 90 MSec to download it from the BI server and pass it throgh DS (~150 MSec),
I usually have 2 cameras (Gate and main door) using the that process, yesterday I added 2 more camera, performance remain the same, GPU usage raised from 1% to 2%.
In previous version of DI - it took ~100 MSec for an image and GPU usage for 2 camera was 4%-5%.
NodeRED flow for image processing
The 2nd most complex flow I have I wrote, for that I need to customize a bit the person component in HA, for the persons I wanted to perform an action based on their faces, I added a custom attribute of face_recognition: true
,
the flow begins with collecting all the persons from HA with that attribute, and based on MQTT listener on the topic of the IP2MQTT it will initate the flow.
Flow will eventually log every MQTT message to InfluxDB for monitoring and alerting (using Grafana),
But as step #1 it will run all over the persons just in case the status is Identified
,
It will run through all the persons and look for confidence level that Iām allowing to perform the action,
Based on the decision the following will take place:
-
Identified below the confidence level threshold - will send a telegram message with message - face identified with confidence level X%, no action performed - will use that image later to train the DS engine
-
Identified above the confidence level threshold - will send a telegram message with message - face identified with confidence level X%, performed action Y
Actions can happen as result of that are pretty much the same as in DahuaVTO2MQTT, with one main difference, announcement will be with the name of the person.
the token being sent by IP2MQTT allows to call it to download the specific image used for image processing, so the message that being sent using telegram, is using the image from IP2MQTT cache and not from the BI server.
Just a heads up. I published DahuaVTO2MQTT to the Unraid community applications. You can search for and install DahuaVTO2MQTT now in Unraid.
Hi there. I get the same error with 1.0.6, but one question, how did you install the 1.0.8 update?
Edit: found https://github.com/elad-bar/Hassio-addons/issues/6 and used the repository https://github.com/dmitrychepel/Hassio-addons (or https://github.com/jbleuzen/Hassio-addons ) until this will be fixed.
Edit: the 1.0.9 version of the original repository showed up! Now working again! Nice!
Still got an error message though:
Add-on: DahuaVTO2MQTT
Listens to events from Dahua VTO unit and publishes them via MQTT Message
Add-on version: 1.0.9
You are running the latest version of this add-on.
parse error: Expected string key before ā:ā at line 1, column 4
[18:19:47] ERROR: Unknown HTTP error occured
System: (armv7 / raspberrypi3)
Home Assistant Core: 0.117.5
Home Assistant Supervisor: 2020.11.0
Just installed the plugin, zero problem here!!! Very simple and effective from user side.
Iām on latest stable and iāve a dahua vto2111d with sip firmware. My flow is this now:
- someone push the doorbell button
- a sip call is initiated from my asterisk to our phone trough linphone free sip account (and linphone free app on the smartphones)
- a notification is send to the hass app
- home assistant trough this plugin ring a bell (zwave) and play a TTS on my google home (someone is at the gate).
the doorbell act also as a simple ipcam monitored from blueiris software (+ blueiris plugin on hass.io)
next: i want to cath the image and add that to the notification to the phones.
Could you please provide a little more information or a link as to how you set up your VTO to make SIP calls. This would be great as it means you no longer need to use the Dahua app.
Sure,
first you need to flash the SIP firmware on your VTO if it isnāt already on.
Setting as client is simple:
in local setting -> basic
DEVICE TYPE: VILLA STATION
VILLA CALL NO.: 9901
VTO NO.: 8001
in network setting -> SIP server
SIP SERVER: not enabled (NOT flagged, we use asterisk as server so dahua is a client)
SERVER TYPE: ASTERISK
IP ADDR: [asterisk server]
PORT: 5060 (or your asterisk sip port)
USERNAME: 8001 (itās indeed the param VTO No. before)
PASSWORD: set your favourite, it must be the same in the user of asterisk
SIP DOMAIN: boh, i set asterisk
SIP SERVER USERNAME: clean
SIP SERVER PASSWORD: clean (we donāt use the sip server function).
After that you have to create a asterisk/freepbx user, with internal number 8001 (the dahua), password as set before.
Then, i created 2 free users on linphone and setup as this on freepbx:
add new custom extension
Dial:
SIP/[email protected]
and the same for [email protected]. The extension name must be numeric, for me are 8002 and 8003 as 8001 is the dahua.
All the user must exist on the freepbx server. Here the very simple extension_custom.conf which initiate the call from dahua to all the linphone users:
[from_doorbell]
exten => 9901,1,Ringing()
exten => 9901,n,Answer()
exten => 9901,n,Set(__DYNAMIC_FEATURES=door-open1)
exten => 9901,n,Dial(SIP/[email protected]&SIP/[email protected],30)
exten => 9901,n,Hangup()
I totally remove the dahua_app, just have the linphone free app on the smartphone. And Blueiris for monitoring
Thank you so much for the step by step. Look forward to trying this out. Cheers
Hello to all
I have tested with the docker installation that is now the way, but after all the steps followed as mentioned I cant verify the new entity created in the HA
Iām using this into the yaml config file
binary_sensor:
- platform: mqtt
name: "Doorbell Button State"
state_topic: 'DahuaVTO/BackKeyLight/Event'
value_template: '{{ value_json.Data.State }}'
payload_on: "1"
payload_off: "0"
Is this correct, or do I have to use other way in order to get the push button entity available in the HA ?
Thank you in advance for your support and best regards
Can anyone help me build a DauhuaMqtt image for Rasberrry docker?
The version I find on the docker site has another architecture
Ciao the condor
I guess you are Italian as myself.
I am struggling to configure an asterisk server. Could you help me?
I understand that after setup the vto becomes an extension in the PBX among the otherscin he PBX.
A button pushed on the vto triggers a call to the extensions defined in the routing plan.
That would be the handset in home but also the fixed vth in-home?
You can call from vth to other handsets on the PBX correct?
Finally I have VoIP credentials for my ISP . With that configured I guess one could also route he sip call out of home. Correct?
Final question : standard dahua apps keep working? ('or rather work when they want)
If you want you can pm me . Do not want to hijack the conversation
Ps: thereās a custom component for asterisk in alpha that the creator has shared with me that can be tested
I must apologize with the docker author.
It works fine.
Was not working previously for me due to outdated software on vto and vth
I just installed 1.0.9 and I canāt make this addon work, and this shows in the logs
[01:57:45] INFO: @@@@@@@@@@@@@@@@
/usr/bin/curl
[01:57:45] INFO: @@@@@@@@@@@@@@@@
[01:57:45] INFO: FFS
[01:57:45] INFO: Staring Dahua to MQTT
PHP Notice: Undefined offset: 1 in /app/DahuaVTO.php on line 49
PHP Fatal error: Uncaught Error: Class 'Mosquitto\Client' not found in /app/DahuaVTO.php:126
Stack trace:
#0 /app/DahuaVTO.php(4): DahuaVTOEventListener->DahuaVTOEventListener()
#1 {main}
thrown in /app/DahuaVTO.php on line 126
[cmd] /bin/ash exited 255
For what I can see in the logs of the repo, Mosquitto\Client
was added very recently, the 11th of December. Just in case anyone considers updating, watch out.
If anyone has any clue on how to fix this, please share.
I will fix it in the weekend
Ok great thank you !!
Hi, i have the same error:
<sup>[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.
[22:20:37] INFO: @@@@@@@@@@@@@@@@
/usr/bin/curl
[22:20:37] INFO: @@@@@@@@@@@@@@@@
[22:20:37] INFO: FFS
[22:20:37] INFO: Staring Dahua to MQTT
2020-12-18 21:20:37 DEBUG DahuaVTOAPI::SetDeviceDetails Device Type: VTO2000A
2020-12-18 21:20:37 DEBUG DahuaVTOAPI::SetDeviceDetails Serial Number: xxxxxxxxxxx
PHP Notice: Undefined offset: 1 in /app/DahuaVTO.php on line 49
PHP Fatal error: Uncaught Error: Class 'Mosquitto\Client' not found in /app/DahuaVTO.php:126
Stack trace:
#0 /app/DahuaVTO.php(4): DahuaVTOEventListener->DahuaVTOEventListener()
#1 {main}
thrown in /app/DahuaVTO.php on line 126
[cmd] /bin/ash exited 255
[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.</sup>
Greetings
Didnāt manage to fix it but will keep trying in the upcoming days,
Will update once Iāll fix it