Hi, i think i can help you.
I worked a bit on my setup to obtain:
- Notification for call or unlock
- When someone call, save a snapshot from VTO camera, save it and send it as notification
- The notification for call events contains a button to a custom dashboard which has buttons for locks and live feed with 2 way audio.
- Activate outdoor lights when a call or unlock event happens
- Ring Amazon Echo Dots with a soft ring when someone is calling
I started with this basic setup https://github.com/myhomeiot/DahuaVTO?tab=readme-ov-file#lock-example-with-call-to-open-door-service
Some advice:
- Create 2 Timers and 2 Locks ( second lock has “channel: 2” )
- Set "duration: “XX:YY:ZZ” ( hh mm ss ) on those timers. This can prevent multiple activation of same lock, especially for a big gate which takes > 1 minute to fully cycle.
Now create 2 buttons and you have full control of locks.
Now let’s talk about notifications.
Dahua_VTO listen events from VTO. You can find some useful data here
I use Node RED to handle events i need, but you can do this on automations to ( i had those in the past ).
For example when i receive an event with this data, it means someone is calling my unit 7700:
{"Action":"Pulse","Code":"Invite","Data":{"UserID":"7000"}}
This data appears when an NFC tag is scanned. After this i filter for “CardNo” so i know who exactly has used its NFC tag.
{"Action":"Pulse","Code":"AccessControl","Data":{"Status":1,"Name":"OpenDoor","Method":1}}
Since you have now entities for 2 locks you already know when those locks are triggered, so you can notify yourself based on homeassistant entities status.
Now a quick and very easy solution for Two Way Audio from/to VTO in HomeAssistant.
Luckily Dahua implemented correctly everything to get two way audio via ONVIF.
- Make sure you reach your HomeAssistant via HTTPS.
- Install go2rtc
- Install WebRTC Camera
- Add your VTO in go2rtc with this config (Cancellino is a name you can replace as your prefeer. Cancellino in italian means pedestrian gate ).
streams:
Cancellino:
- rtsp://admin:YOUR_PASWORD_HERE@YOUR_VTO_IP_HERE:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
webrtc:
candidates:
- stun:8555
- Create a dashboard with a WebRTC Camera widget with this code:
type: custom:webrtc-camera
streams:
- url: Cancellino
name: ❌ Mic OFF
- url: Cancellino
mode: webrtc
media: video,audio,microphone
name: 🎙️Mic ON
mode: webrtc
muted: false
background: false
ui: true
style: >-
video {object-fit: fill;} .stream { font-size: 15px; width: 150px;
font-weight: bold; padding-left: 2px;} .controls {
background-color:#dddddddd; padding:5px 10px; border-radius: 10px;}
This creates a stream with Microphone disabled. If you press “Mic OFF” it switches to the other configuration which has Microphone enabled.
You can talk to people outside and they’ll hear clearly.
This is totally configurable and i’m sure it can be customized even better.
This is a very easy and reliable (as for now) way to get a fully functional intercom inside HomeAssistant.
I’m using this setup since some months and never had an issue.
@myhomeiot maybe you can add this as suggestion to your repository ?