MQTT for ONVIF Hikvision Video Doorbell

pete_c

Guru
An addon has been created to read the PIR sensor via ONVIF on the HikVision OEM doorbell.

Note that the plugin doesn't read a doorbell press at this time.

Been testing it to work great with HA and Homeseer running it in Docker on the micro Intel combo box.

Will add the documentation here in pieces / baby steps.

BTW it is on sale on Amazon as an EZViz Doorbell Camera for $89.99. I purchased my OEM Hikvision Doorbell for around $130 USD a few months ago.

The Video doorbell doesn't depend on the cloud, does RTSP, ONVIF and JPG captures. It is working fine with HS4 Video camera stuff.

Note the assumption is that you are familiar with Docker and have it installed.

Have a read here

Docker Hub
GitHub onvif2mqtt

1 - docker pull dfarkov/onvif2mqtt:latest

2 - cd /opt

3 - git clone hxxps://github.com/dmitrif/onvif2mqtt

4 - cd /opt/onvif2mqtt

5 - nano config.dev.yml

6 - cp config.dev.yml /opt/onvif2mqtt/config.yml

7 -
docker run -d --name="onvif2mqtt" -v /opt/onvif2mqtt:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart always dfarkov/onvif2mqtt

8 - docker ps will show when you started it and it running.

9 - MQTT Explorer shows it running. Here you can install use mcsMQTT in Homeseer or in Home Assistant MQTT Notes


By default this package publishes events to an topic onvif2mqtt/$ONVIF_DEVICE/$EVENT_TYPE/ with a value of on | off for each captured event type. Templating / Custom Topics


However, by using the api.templates option in configuration, one can define a custom subtopic and specify a custom template. The following tokens will be interpolated in both the subtopic and the template values:
  • ${onvifDeviceId} - name of the ONVIF device (e.g. doorbell)
  • ${eventType} - type of event captured (e.g. motion)
  • ${eventState} - boolean state of the event (if applicable)

The messages will be sent to a topic of the following format: onvif2mqtt/$ONVIF_DEVICE/$SUBTOPIC.

Edit the config.yml file
# MQTT Broker configuration, # required due to nature of project. mqtt: host: 192.168.0.57 port: 1883 username: user password: password # All of your ONVIF devices onvif: # Name for the device (used in MQTT topic) - name: doorbell hostname: localhost port: 80 username: admin password: admin Define custom binary_sensor in HomeAssistant's configuration.yaml:

binary_sensor doorbell_motion: - platform: mqtt name: doorbell_motion state_topic: "onvif2mqtt/doorbell/motion" Next to document is to integrate a doorbell auto pop up on the Amazon Show using Monocle and Amazon addon (used for TTS or HA sending commands to Alexa).


 
 
pete_c said:
An addon has been created to read the PIR sensor via ONVIF on the HikVision OEM doorbell.

Note that the plugin doesn't read a doorbell press at this time.
 
 
OK, I'll bite... how do you know someone is at the door? 
 
Or are you saying you still use the cloud app for that? 
 
Here still utilize the combo Elk 930 / 960 doorbell circuit and Wired PIR to the front door connected to my OmniPro 2 panel and wired Optex combo camera.
 
Testing though....no cloud connectivity (no phone apps) triggered events that can send you a text with a video or stills of the doorbell ringer.
 
I disconnected the cloud connectivity of the doorbell first week of use. 

RTSP, JPG and ONVIF is working well now.
 
The Wireless Video doorbell the doorbell PIR getting MQTT events when the PIR motion is triggered. 
 
Next is configuration when doorbell presses generate ONVIF MQTT events.
 
Over the years here have stayed away from wireless security, CCTV or automation or any dependencies on the cloud for security, automation or CCTV.  That is me.
 
[sharedmedia=gallery:images:1324]
 
1 - MQTT Garage door 1 is a combo modified SonOff basic with a temperature sensor, push button for the garage door, autonomously connected reed sensors for up and down position.  (note also have wired connectivity here to the OmniPro 2 panel). 
 
2 - The ONVIF-MQTT at this time is connected to the PIR sensor on the doorbell.  Next will be the doorbell sensor.
 
 
Back
Top