Dahua VTO custom integration

So basically, I’m just ditching the VTH entirely (that’s about SG$150 down the drain), the VTO is still good.

I’ve decided to setup the SIP Server on Freepbx on Rpi3 and I’m connecting the VTO and 2 Android Tablets as receivers instead. I’m using PortSIP UC as SIP Clients on the tablet to receive and make calls to the VTO.

I’ve designed and 3D printed Tablet mounts with integrated Qi Wireless Charger. The tablet will be mounted on the mount using magnets and Iron Plates (stuck onto the Tablet).

Will be making a dedicated post to the tablet mount (with STL/Photos) when the project is complete.

1 Like

Please do share how to have audio withing HA for the intercom. If you are successful, please do share details on how to configure SIP integration for HA.

Still on fence here

Wondering why you feel freepbx with 2 tablet is better than just using 2 VTH? Is there some benefit?

I considered this but recently I receive and setup VTH. I realize I can add security cam (Amcrest) and use for security cam only, doorbell answer, gate/garage open. I like this way since it is good backup in case HA issue. I actually just have HA trigger Zwave relay for garage when turn ON VTO relay instead of wire VTO due to laziness but maybe I wire in future for redundancy. Also live view was real-time vs HA with delay.

But i still considering HA tablet route

Is it possible to subscribe to the VTO events?
So for instance, I want that when someone enters the right VTO code (or if I open it via the DMSS app), HA will turn on the lights.
I know I can achieve this via a door sensor but it seems more trivial to just listen to some kind of “door unlocked” command

Yes

HA UI >> developer tools >> events >> listen to “*” events >> enter code on vto and watch event stream for results

If he curious to know if incorrect code entry shows
You should capture that as well if possible

Thanks! Oddly the vto doesn’t fire an event when opening the lock via the app.
I see an event been fire when it detects motion though

VTO fires event when you open lock from application, here the code which handle it, check condition trigger.event.data.Data.State | int == 8

When you use developer tools to listen for events, listen for dahua_vto events or add Dahua VTO All Events automation from example.

I’m not dealing with 2 way audio on HA so I can assist much on that fronts but there are a number of projects (Lovelace Cards) that are trying to deal with that if you’re up for a challenge.

The main reason why I decided to ditch the VTH altogether is due to how rubbish the VTH5321 is. It’s supposed to be Android-based but can’t run any Android apps (HA for example).

It’s also finicky when it comes to SIP configurations. Nothing I do can solve the noise issue (crackling sound) on the VTH during calls when connected to the Freepbx SIP Server.

To make things easier, I just installed an SIP client on the tablets to handle call from the VTO and use HA to monitor the video feed for my cameras through ONVIF.

Hi, care to share which wire go to which port on the vto?
I’m using VTO2202F-P + similar magnetic sensor as yours, IIRC it was grey white and brown but i couldn’t get it to trigger open and close even after swapping it… I’ve also set this :

  • Door contact enabled = ON
  • Door contact Type = NC (because by default its a closed gate)

Door contact type NO/NC is for magnetic lock.
I don’t remember colors, but one wire is connected to FB and the other to GND
I have FB1 and FB2 for 2 door contacts, but I’m able to get status only from FB1.

I don’t know for your model, but many VTO’s have built-in only 1 door set, for door2 you must add additional module (and connect it via RS485).

I have DAHUA VTO2211G-P and I’m not sure if there is support for second door.
I connected a second sensor to a cable labeled FB2. The app also shows me 2 locks, but I haven’t tested the other one.

Good afternoon!
I can’t set up Linphone/linhome and FreePBX in any way. I added internal numbers via chan_sip, but I just can’t get through to VTO not from the Internet, not from the local network. Tried different options but it doesn’t work. Could you please post step by step instructions on how you organized everything.

Many thanks!

1 Like

Damn, that is a very hard question to answer because different people have different setups so it really depends on what you want to achieve in your system.

My system basically runs FreePBX as the SIP Server. I connect the VTO to FreePBX (SIP Server), then I connect the Android Tablets running PortSIP UC (SIP Client App) to FreePBX.

I setup FreePBX to call the ring group (I have 2 Tablets connected) when the VTO Bell button is pressed. The connection terminates when any of the Tablets answer the call. And you can use PortSIP UC to establish a call to the VTO by dialling the corresponding Extension Number.

So what I did was:

  1. Install FreePBX on Raspberry Pi 3 (http://www.raspberry-asterisk.org/)
  2. Setup FreePBX and update the modules following the steps in the link above.
  3. Go to Applications > Extensions

4.Setup up a chan_sip extension for every device you wish to connect.
Screenshot 2022-05-01 at 8.06.27 PM

Make sure to set the Port Number to 5060 in Advanced Tab. Leave everything else as default.
(Refer to image below)

As you can see, I set up my #1 Tablet (Home Tablet) as 1001, and #2 Tablet (Door Tablet) as 1002. I kept the default extension number for the VTO at 8001.

  1. Setup Ring Groups if you have more than 1 Client to Call When the Bell Button is Pressed.

Now you are done with setting up FreePBX,

  1. Connect VTO to FreePBX

  2. Connect SIP Client (PortSIP UC) to FreePBX

At this stage your setup should work as described above. I did not include setting up an external SIP Trunk to connect from outside your household. This is a purely local setup. For further details, you will have to do more research as I am by no means and expert in SIP Servers; it gets pretty complicated.

I hope this helps. All the best.

4 Likes

Friend! Thank you so much! Good health and all the best to you! My previous steps (before your post) were about the same. Unfortunately, this didn’t help. No matter how I try, VTO does not pick up the phone and does not answer my SIP call. When I make a call to the VTO, the VTO logs say that the account is supposedly blocked, although I correctly record both the SIP login and the password from the VTO in FreePBX (in reports - channels, the status of the VTO is online). Actually, I don’t know what else to do here. Thank you for responding and trying to help!

hi,

is it possible when push the button at VTO ------> for example in HA trigger a light to turn on??
i have already installed the custom component VTO VTH and added the lines in config.yaml

Hello, sure it’s possible, VTO doesn’t have regular button, it’s a doorbell, so you can put service call for turn on the lights when you get doorbell event.

In automation example you can call homeassistant.turn_on instead persistent_notification.create:

  action:
    - choose:
        - conditions: >
            {{ trigger.event.data.Data.State | int in [1, 2] }}
          sequence:
            - service: homeassistant.turn_on
              entity_id: light.entrance_light

If you are not familiar with HA yaml programming you can use rroller integration with GUI configuration and regular HA automation editor.

@mate
I managed to get the door sensor detected by the VTO, turns out white cable goes to Door_FB and brown to GND.
But the problem is with this setup the door sensor and my gate machine cancels each other.
With this setup the door sensor works, but the dahua app and HA wont accept open/close command anymore
I also tried swapping :

  • the brown door sensor cable to the bottom GND VTO
  • Door NO to Door NC
    But none works so far, my gate machine only has 2 types of operation as shown below.
    Close only and Open & CLose… any thoughts?

VTO_Gate (1)

Edit : Nevermind it finally works! i need to set the Door contact type to “NO” in vto webpage (despite my gate is normally closed)
Just one minor thing, the status name is reversed between “closed” and “open”
@myhomeiot any idea how to reverse or rename this through config yaml?