Dahua VTO custom integration

Hello, how can we esaily test the “trigger.event.data.Date.State value”, or the BackKey_light states ?

I am doing the automation below which is supposed to launch a couple of actions when someone rings the bell, but nothing happens.
I think there is an issue with my condition check / the test of the states 0, 1, 2, …

alias: Dahua VTO
trigger:
  - platform: event
    event_type: dahua_vto
    event_data:
      Code: BackKeyLight
condition:
  - condition: template
    value_template: "{{ trigger.event.data.Data.State | int in [0] }}"
action:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.Data.State | int in [1, 2] }}"
        sequence:
          - service: persistent_notification.create
            data:
              title: >-
                {{ 'Doorbell Ring' if trigger.event.data.Data.State | int in [1,
                2] else 'Doorbell No Ring' }}
              message: "{{ trigger.event.data }}"
          - service: number.set_value
            data:
              value: "500"
            target:
              entity_id: number.lenovo_tab_m10_plus_3rd_gen_screen_off_timer
          - type: turn_on
            device_id: 5ddf9cc8e6e73f9ee6a61282d8c96a62
            entity_id: 0b25a53f111b9dbc4efdf84501269ecf
            domain: switch

Many Thanks !

If you go to an automation you will get a visual indication (message) when automation trigger occurs. This does not mean condition has occur, only that trigger has occurred

In the automation edit ui you can select [three vertical dot] at upper right corner to get menu options, select “traces”

You may use information here to see why condition fail and the message or data received for trigger

You can also watch messages using HA UI >> developer tools >> events

Thank you very much

@cedricdelecole , Are u French ?

Hi! Is there support for initiating call reception via command transmission?

While direct implementation isn’t necessary, using a third-party WebRTC solution could enable two-way communication. However, for this to function effectively, the VTO system would require awareness of call reception status.

So, I would require a solution similar to a SIP client.

Hi,

At fisrt , i 'd precise that i’m a newbie and my english is bad .

So,

i 'd installed Dahua VTO with HACS

in which file.yml , i 've put that ? in configuration.yml or in /custom_components/dahua_vto/services.yaml ?

- platform: dahua_vto
    name: Dahua VTO
    host: 192.168.1.108
    username : admin
    password : XXXXX
    scan_interval: 5

after restart HA,

in the first or in the seconf file , i have nothing in listenning event for dahua_vto

Someone could publish his config please or help me please

(* With Freepbx , calls are ok with sip client => OK)

Thx

Hello, if you are new to Home Assistant YAML configuration, please check this message.

Hello im using Dahua VTO integration by 1 year, and now i cant access, the logs say me user or incorrect password but its not i hace the same user/password in frigate and its working

Anyone can help me?

API: (WORKS)
http://admin:[email protected]/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote

Config (NOT WORKS)

sensor:
  - platform: dahua_vto
    name: Dahua VTO
    host: 192.168.1.111
    username: admin
    password: fake_password123

logger:
  default: warning
  logs:
    custom_components.dahua_vto: debug

Frigate (WORKS)

cameras:
  portero:
    enabled: True
    ffmpeg:
      inputs:
        - path: rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - record
            - rtmp
    objects:
      track:
        - person
    record:
      enabled: True
      retain:
        days: 7
        mode: motion
      events:
        retain:
          default: 14
          mode: active_objects
    snapshots:
      enabled: True
      retain:
        default: 10
        objects:
          person: 15

Hello, very strange, maybe this start happening after you do something like HA update, installing Frigate?

PS: Maybe something wrong with Dahua VTO, try to restart it manually.

I have it configured but I don’t know how to continue… I’ll settle for the door notifying me and being able to open it… but I’m lost where to put said code. Thk

alias: Dahua VTO Llaman a la puerta
description: “”
trigger:

  • platform: event
    event_type: dahua_vto
    event_data:
    Code: BackKeyLight
    condition:
  • condition: template
    value_template: “{{ trigger.event.data.Data.State | int in [0] }}”
    action:
  • choose:
    • conditions:
      • condition: template
        value_template: “{{ trigger.event.data.Data.State | int in [1, 2] }}”
        sequence:
      • service: notify.mobile_app_sm_g781b_j2g2
        data:
        message: Llaman a la puerta

yes, I also speak French

I’ll tell you what I have achieved… you are missing the port… port: 80 if you have updated the vto… from there you see the logs and you will see that it already connects and you will have a service called dahua_vto… but one once connected I don’t know where to put the code to, for example, open the door

Is it possible to turn on only the backlight of the call button? ( VTO2211G-WP)

No, Spanish

Hi,

it s good , i have events now :

event_type: dahua_vto
data:
  Action: Pulse
  Code: BackKeyLight
  Data:
    LocaleTime: "2024-02-26 10:44:25"
    State: 1
    UTC: 1708940665
  Index: -1
  entity_id: sensor.dahua_vto
origin: LOCAL
time_fired: "2024-02-26T09:44:51.886364+00:00"
context:
  id: 01HQJCV2DEWN08F2EPS1EPMRYV
  parent_id: null
  user_id: null

and i can send a remote service to Open :

now , i 'd like do an automation when doorbell is pressed but i doesn’t work with that :

- alias: Dahua VTO
  mode: queued
  trigger:
    - platform: event
      event_type: dahua_vto
      event_data:
        Code: BackKeyLight
  action:
    - choose:
        - conditions: >
            {{ trigger.event.data.Data.State | int in [0, 1, 2, 5, 6] }}
          sequence:
            - service: persistent_notification.create
              data:
                title: "{{ 'Doorbell Ring' if trigger.event.data.Data.State | int in [1, 2] else 'Doorbell No Ring' }}"
                message: "{{ trigger.event.data }}"
        - conditions: >
            {{ trigger.event.data.Data.State | int == 8 }}
          sequence:
            - service: timer.start
              data:
                entity_id: timer.door_lock
                duration: 00:00:02 # VTO Unlock Period
            - service: persistent_notification.create
              data:
                title: Unlock
                message: "{{ trigger.event.data }}"
        - conditions: >
            {{ trigger.event.data.Data.State | int == 9 }}
          sequence:
            - service: persistent_notification.create
              data:
                title: Unlock failed
                message: "{{ trigger.event.data }}"
        - conditions: >
            {{ trigger.event.data.Data.State | int == 11 }}
          sequence:
            - service: persistent_notification.create
              data:
                title: Device rebooted
                message: "{{ trigger.event.data }}"
      default:
        - service: persistent_notification.create
          data:
            title: "Unknown state {{ trigger.event.data.Data.State | int }}"
            message: "{{ trigger.event.data }}"

thx for you help

Minos

it works in a test automation with this code :

platform: event
event_type: dahua_vto
event_data:
  Action: Pulse
  Code: BackKeyLight

anybody had an automation with doorbell ring and lanch app for cam and button to open the door ?

Thx

Doorbell events should have State code 1 or 2, see here.
In your log here you can see this event Data.State == 1.

Don’t know what you mean under launch app but if you want to run android application you can check previous messages in this thread.

show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: dahua_vto.open_door
service_data:
timeout: 5
short_number: HA
entity_id: sensor.dahua_vto
channel: 1
name: Abrir Puerta
icon: mdi:door

I already have the automation to knock on the door and be able to open it, I am missing the most complicated part of being able to talk to the person who knocks… but I think that yes is required and that’s where I get a little lost. Thk

Dear Group,
I would like to know what I am doing wrong, I just want to receive an alert in HA every time they press the bell button.

The configuration I have added to the configuration.yaml is as follows:

- platform: dahua_vto
  name: portero-exterior
  host: 192.168.1.53
  timeout: 10
  port: 5000
  username: admin
  password: MyPassword
  scan_interval: 60

Once integrated in HA it shows me the following entities:

But when I press the video intercom buzzer button, no entity responds.

I think it is because it does not show me a sensor called “sensor.dahua_vto” or in my case “sensor.portero-exterior”.

Any ideas?
Thanks