Dahua VTO custom integration

@cemara If you mean this door status sensor example:

template:
  - trigger:
      - platform: event
        event_type: dahua_vto
        event_data:
          Code: DoorStatus
    binary_sensor:
      - name: VTO Door Status
        state: "{{ trigger.event.data.Data.Status | string == 'Open' }}"
        device_class: door

And you get status reversed, this mean that VTO report status of the contact and not the door.
You can change this template to something like:

state: "{{ trigger.event.data.Data.Status | string == 'Closed' }}"

or

state: "{{ trigger.event.data.Data.Status | string != 'Open' }}"
1 Like
  • id: ‘1652691985507’
    alias: Gate_Open_Alarm
    description: ‘’
    trigger:
    • platform: state
      entity_id:
      • binary_sensor.gate
        for:
        hours: 0
        minutes: 1
        seconds: 0
        to: Open
        condition:
        action:
    • service: media_player.play_media
      target:
      entity_id: media_player.family_room
      data:
      media_content_id: media-source://media_source/local/Gate_open.mp3
      media_content_type: audio/mpeg
      metadata:
      title: Gate_open.mp3
      thumbnail:
      media_class: music
      children_media_class:
      navigateIds:
      • {}
      • media_content_type: app
        media_content_id: media-source://media_source
        mode: restart

Hmm what am i missing here? I’m just trying to sound alarm whenever the gate is left open for more than x minutes, 2 minutes passed by in open condition and it doesn’t trigger

This is off topic for this conversation, but Home Assistant binary_sensor doesn’t have any other states than on, off and unavailable, so trigger should look like:

      - platform: state
        entity_id:
          - binary_sensor.gate
        to: 'on'
        for: '00:01:00'
1 Like

Hi,

I use this automation script but it behaves strange : why does it ring (and flash the lights) 2 times ?
It rings (and flashes) 1 time when the button is pressed (perfect !) … but also 1 more time 30 secs after that (huh ?) … naughty naughty doorbell !

Am I doing something wrong ?

alias: Dahua VTO Ring
trigger:
  - platform: event
    event_type: dahua_vto
    event_data:
      Code: BackKeyLight
action:
  - choose:
      - conditions:
          - condition: template
            value_template: |
              {{ trigger.event.data.Data.State | int in [0, 1, 2, 5, 6] }}
        sequence:
          - service: media_player.play_media
            data:
              media_content_id: media-source://media_source/local/MUSIC-CHIMES-DOORBELL.mp3
              media_content_type: music
            target:
              entity_id: media_player.up2stream_pro_v3
          - service: light.toggle
            data:
              brightness_pct: 99
              flash: short
            target:
              entity_id:
                - light.buro_meeting
                - light.keuken_eiland
                - light.slaapkamer_kleerkast_pascal
mode: queued
max: 10

In condition you check for states [0, 1, 2, 5, 6] but only the 1 and 2 it’s a Call/Ring, probably you should check only for them [1, 2]. More information about state codes you can find here

awesome, it works !

thanks a million for the help !

Is it posible to answer a call from a HA intalled on a tablet, that is used as a home dashboard? Basicly be able to talk and hear.

I’m also interested in what @Videx1 asked. I also have a VTH indoor monitor installed to answer the VTO doorbell but really, it’s a one usecase thing and ideally I’d just be able to stop the doorbell, receive audio and 2-way audio communicate with the guest via HA (and thus via any mobile/tablet I choose). The VTO has 2 way audio communication capabilities, question is how to tap into it via HA

@Videx1 @yoloitup This problem was already discussed in this thread, please check my original reply here and one of solution here (thanks @Azelphur).
If you will success with FreePBX or Asterisk integration with VTO you can try to find SIP card for Home Assistant dashboard (this was also discussed here but as I understand without success).
Hope this helps.

Edit: You can check SIP client card, as intercom

Hello everyone,

I am with the version :
Home Assistant 2022.7.3
Supervisor 2022.07.0
Operating System 8.2
HACS 1.26.0

And I would like to install this add-on but after downloading it is not available. On Github, the add-on is marked as “default” for HACS.

Does anyone have this problem or a possible solution for my problem.

Thanks for your help!

@G0nitte If you see folder dahua_vto under custom_components than everything is fine. This integration doesn’t have GUI Home Assistant config flow, you should configure it manually in .yaml file, please check documentation here

1 Like

Thx @myhomeiot. Sorry because I’m a beginner.

But now I want to be noticed by my app see my VTO stream and choose if I want to open (unlock the door) or close (do nothing).

So I create an automation, but it doesn’t work badly …

In my .yaml, I put this :

timer:
  door_lock:
    name: Door Lock
    icon: mdi:timer

lock:
  - platform: template
    name: Door Lock
    value_template: "{{ not is_state('timer.door_lock', 'active') }}"
    optimistic: false
    lock:
    unlock:
      - service: dahua_vto.open_door
        data_template:
          entity_id: sensor.dahua_vto
          channel: 1
          short_number: HA

And in my automation, I put this :

service: notify.mobile_app_iphone_hb
data:
  message: 'Quelqu''un sonne à la porte :'
  data:
    entity_id: camera.videophone
    actions:
      - service: dahua.vto_open_door
        title: Ouvrir
        icon: sfsymbols:lock.open.fill
        data: {}
        target:
          device_id: c2806629847d4f1be***************
      - action: Close
        title: Close
        icon: sfsymbols:lock.fill
        destructive: true

Can you help me please to finish my automation ?

Maybe a bit silly, but how to check the correct port?
On default i’ve got ‘unavailable’, when trying: 80/5000/5060/5061.
Only 37777 i see status ‘OK’ but no other attributes :thinking:

Which device you trying to access? 37777/tcp usually it’s DVRIP or 3DES protocol, this integration support only DHIP protocol (usually 5000/tcp). VTO usually have 80/tcp and/or 443/tcp port for web access.

You can try Dahua-JSON-Debug-Console or/and you can turn on debug logging and check whats going wrong.

Have 2 doorbell and nvr (VTO2111, VTO2211, DHI-NVR2108-I), in default port can’t connect, with logger i have problem “User or password not valid!”, other integration like rroller is connect to video.

Edit: stupid: forget add ‘!secret’ before password in config. Now its found the devices.

BTW. how to send comand to one of VTO’s?

Edit2: Found the way by Node-red

in configuration.yaml i have:

  - platform: dahua_vto #domofon
    name: Domofon
    host: 192.168.1.109
    username: !secret dahua_username
    password: !secret dahua_password
    scan_interval: 5
  - platform: dahua_vto #dzwonek
    name: Dzwonek
    host: 192.168.1.110
    username: !secret dahua_username
    password: !secret dahua_password
    scan_interval: 5

now in Node-red put service node like this and choose entity excactly like my specific name in config:

I’m glad that you found the problem and make it’s works!

Thanks for ur help and all work done.

Hola,
He instalado esta integracion en HA y me funciona correctamente segun lo indicado. Muchas gracias.

Pero en realidad no hace exactamente lo que necesito.

He añadido una notificacion al telefono y me envia el mensaje cuando finaliza la llamada o en el momento de responder.

Lo que quiero es que me mande un aviso al telefono en el momento de pulsar el tiembre y no al final.

No consigo configurarlo de forma adecuada, agradeceria si me pueden ayudar.

Muchas gracias por su buen trabajo.

Hola, look into your yaml and check that it’s send message when BackKeyLight 1 or 2 (Call/Ring), now it’s looks like it’s sends message when BackKeyLight 5 (Call answered from VTH) or 6 (Call not answered).

All BackKeyLight you can see here

Hola, gracias por su rapida respuesta.
No ha funcionado con el cambio a Backkeylight 1.
Lo he solucionado haciendo un nueva automatización con el sensor binario de esta atomatizacion.
Ahora el problema es que si borro la automatizacion anterior deja de funcionar la nueva.
un saludo