Dahua VTO custom integration

Check out these projects.

I am using the SIP Card with an external freePBX and can receive calls using a VTO. I also setup the freePBX so that the ringback sound is customized based on the time of year, so that Christmas songs play during Christmas, Halloween sounds around Halloween, etc.

1 Like

Hello everyone,

I am looking for a POE Doorbell like Dahua.i see Dahua - VTO2211G-WP.

I would like to have one android tablet for manage all home assistant and Dahua intercom.

1- do you know if i can use an android tablet to manage both? Dahua sell their own tablet connected to POE. My goal is to see who is ringing and talk them without my phone when i m house. I would like unlock the door.

2- Dahua tablet can use a web browser? To manage home assistant

3- do you know if i can read in home assistant a specific rc card for unlock my doorbell. It would be perfect if i can read my son’s card to unlock alarm.

Thank you very much.
Marc

Yes. Dahua tablet make it easy to setup 2 way call but HA can fo with voip. You can easily telk doorbell ringnin HA

No

I believe yea but never use this function

Hi is there any recent changes in HA / Dahua VTO2202f-p that might cause this?
My simple automation that plays audio when doorbell
is pressed has stopped working and throw this error

Executed: December 4, 2022 at 10:10:00
Result:

result: false
entities:
value_template: ‘{{ trigger.event.data.Data.State | int in [1, 2] }}’

the yaml:

alias: Dahua-VTO
description: “”
trigger:

  • platform: event
    event_type: dahua_vto
    event_data:
    Code: BackKeyLight
    condition:
  • condition: template
    value_template: “{{ trigger.event.data.Data.State | int in [1, 2] }}”
    action:
  • service: media_player.play_media
    target:
    entity_id: media_player.vlc_telnet
    data:
    media_content_id: media-source://media_source/media/Doorbell.mp3
    media_content_type: audio/mpeg
    metadata:
    title: Doorbell.mp3
    thumbnail: null
    media_class: music
    children_media_class: null
    navigateIds:
    - {}
    - media_content_type: app
    media_content_id: media-source://media_source
    - media_content_type: “”
    media_content_id: media-source://media_source/media/.
    mode: restart

Audio working fine when i test it separately

Nothing changes, should work as before. You can try to change media_player.play_media service to persistent_notification.create and check if you get right trigger.event.data.Data.State state:

  - alias: Dahua Test
    trigger:
      - platform: event
        event_type: dahua_vto
        event_data:
          Code: BackKeyLight
    condition:
      - condition: template
        value_template: "{{ trigger.event.data.Data.State | int in [1, 2] }}"
    action:
      - service: persistent_notification.create
        data:
          title: "Dahua Test, state {{ trigger.event.data.Data.State | int }}"
          message: "{{ trigger.event.data }}"

Sorry just got back to test it,
Looks like i’m still getting same error, strange :

Hello, result: false it’s not an error, VTO report different states and you are looking only for doorbell (1, 2). You can try to remove conditions and you will see all states you are get from VTO.

  - alias: Dahua Test
    trigger:
      - platform: event
        event_type: dahua_vto
        event_data:
          Code: BackKeyLight
#    condition:
#      - condition: template
#        value_template: "{{ trigger.event.data.Data.State | int in [1, 2] }}"
    action:
      - service: persistent_notification.create
        data:
          title: "Dahua Test, state {{ trigger.event.data.Data.State | int }}"
          message: "{{ trigger.event.data }}"

Hmm so apparently my service persistent notification : create doesn’t seem to work,
I’ve filled it with example from UI and it doesn’t show anything.
Is there any other way to get value from VTO?

Very strange, you can try to use logbook.log instead:

- service: logbook.log
  data:
    name: "Dahua Test, state {{ trigger.event.data.Data.State | int }}"
    message: "{{ trigger.event.data }}"

I never noticed but event trigger for my doorbell seems to have stopped working. I will check cause later

Thanks it works :slight_smile:

Triggered by the event ‘dahua_vto’ at December 7, 2022 at 10:09:44

Logbook: Log

Stopped because an error was encountered at December 7, 2022 at 10:09:44 (runtime: 0.04 seconds)

template value should be a string for dictionary value @ data[‘message’]

The result is shown on “trace” right?

No, in logbook, But “template value should be a string for dictionary value @ data[‘message’]” indicated that you have problem with a syntax, try to check how this works in Services (with dummy values, without template) and when insert in into yaml.

Logbook as in system > logs correct?
Hmm the logs are now broken down into many sections and i cant find anything mentioned about this…
,

try to check how this works in Services (with dummy values, without template) and when insert in into yaml.

Sorry can you elaborate about this?

Update : I reinstalled my whole system, this time is I run HA as proxmox VM and it’s working again.
Previously it was supervised
Will monitor it again but probably has something to do with supervised changing ip.
Guess VM is the more stable approach after all.

Does anyone has a card that shows all buttons that we have in app DMSS??

Hi, is possibile to control VTK DND function with Home Assistant?
I have a perfectly integrated kit in HA (VTO2111D-WP + VTH5221DW)

I don’t think so, because VTH doesn’t have DND on/off button and all periods should be configured in the VTH settings. You can try to emulate DND mode by calling Cancel VTO Call service immediately after you get event of door bell.

Does anyone know what the DOOR1_PUSH port is used for on the VTO2211? I have a sliding gate motor that I want to trigger to open/close/stop. Ideally I wouldn’t have to use any door sensor to do this as I don’t care whether its open or closed, I just want to activate it. I got it to open once by linking to the NO/COM ports, but it wouldn’t close when I sent the command again.

This is to know if the door is opened or closed.

image

Edit this card, mushroom cards and put some buttons there. Would like to know how put the answering button to work with the service to answer the ring call.

type: custom:stack-in-card
mode: vertical
cards:
  - type: custom:webrtc-camera
    url: >-
      rtsp://username:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
    view:
      default: live
      update_force: true
  - type: custom:vertical-stack-in-card
    horizontal: true
    cards:
      - type: custom:mushroom-chips-card
        alignment: center
        chips:
          - type: template
            icon_color: |2-
                        {% set state=states('switch.sonoff_portao_social') %}
                        {% if state=='on' %}
                        white
                        {% elif state=='off' %}
                        red
                       {% endif %}
            entity: switch.sonoff_portao_social
            icon: >
              {% set state=states('binary_sensor.sensor_portao_social_contact')
              %}

              {% if state=='on' %}

              mdi:shield-key

              {% else %}

              mdi:shield-key-outline

              {% endif %}
            tap_action:
              action: toggle
      - type: custom:mushroom-chips-card
        alignment: center
        chips:
          - type: template
            icon_color: |2-
                        {% set state=states('switch.sonoff_portao_social') %}
                        {% if state=='on' %}
                        red
                        {% elif state=='off' %}
                        white
                       {% endif %}
            entity: switch.sonoff_portao_social
            icon: >
              {% set state=states('binary_sensor.sensor_portao_social_contact')
              %}

              {% if state=='on' %}

              mdi:phone-in-talk

              {% else %}

              mdi:phone-in-talk

              {% endif %}
            tap_action:
              action: toggle
      - type: custom:mushroom-chips-card
        alignment: center
        chips:
          - type: template
            icon_color: |2-
                        {% set state=states('binary_sensor.voordeur_vehicle_detected') %}
                        {% if state=='on' %}
                        orange
                        {% elif state=='off' %}
                        #6f6f6f
                       {% endif %}
            entity: binary_sensor.voordeur_vehicle_detected
            icon: |
              {% set state=states('binary_sensor.voordeur_vehicle_detected') %}
              {% if state=='on' %}
              mdi:car
              {% else %}
              mdi:car-off
              {% endif %}
            tap_action:
              action: more-info
      - type: custom:mushroom-chips-card
        alignment: center
        chips:
          - type: template
            icon_color: |2-
                        {% set state=states('binary_sensor.sensor_movimento_garagem_occupancy') %}
                        {% if state=='on' %}
                        orange
                        {% elif state=='off' %}
                        #6f6f6f
                       {% endif %}
            entity: binary_sensor.sensor_movimento_garagem_occupancy
            icon: >
              {% set
              state=states('binary_sensor.sensor_movimento_garagem_occupancy')
              %}

              {% if state=='on' %}

              mdi:motion-sensor

              {% else %}

              mdi:motion-sensor-off

              {% endif %}
            tap_action:
              action: more-info
      - type: custom:mushroom-chips-card
        alignment: center
        chips:
          - type: template
            icon_color: |2-
                        {% set state=states('light.luz_garagem') %}
                        {% if state=='on' %}
                        yellow
                        {% elif state=='off' %}
                        #6f6f6f
                       {% endif %}
            entity: light.luz_garagem
            icon: |
              {% set state=states('light.luz_garagem') %}
              {% if state=='on' %}
              mdi:coach-lamp
              {% else %}
              mdi:coach-lamp
              {% endif %}
            tap_action:
              action: toggle
      - type: custom:mushroom-chips-card
        alignment: center
        chips:
          - type: template
            icon_color: |2-
                        {% set state=states('switch.voordeur_ir_lights') %}
                        {% if state=='on' %}
                        red
                        {% elif state=='off' %}
                        #6f6f6f
                       {% endif %}
            entity: switch.voordeur_ir_lights
            icon: |
              {% set state=states('switch.voordeur_ir_lights') %}
              {% if state=='on' %}
              mdi:flashlight
              {% else %}
              mdi:flashlight-off
              {% endif %}
            tap_action:
              action: toggle