HikVision Doorbell RTSP-ONVIF-JPG

pete_c

Guru
Just a quickie summary post relating to the Hikvision DB stuff.  I have disconnected the cloud app as I have no use for it.
 
 
1 - Hikvision Video to OmniTouch screens using JPG.  Very slow on the OmniTouch 5.7e screens.  Really fast on the Omnitouch Pro touchscreens.
 
In PCA configure DB as follows:
 
IP Camera Name:  Doorbell
Type: User Defined JPEG
Address / URL:  hxxp://192.168.244.152/onvif/snapshot.jpg
 
2 - Zoneminder
 
Auto configures via ONVIF
 
3 - Blue Iris (gifted to me to test AI / facial recognition)
 
Auto configures via ONVIF
 
4 - Homeseer Touch using JPG captures:
 
Address / URL:  hxxp://192.168.244.152/onvif/snapshot.jpg
 
5 - Amazon Alexa Show devices
 
Use Monocle
 
"Alexa show me the front door"
 
6 - DB PIR use:
A - Onvif to MQTT  and Home Assistant ONVIF add on.
B - connectivity to OmniPro2 panel zone is via an ESP Tasmota relay and python script ==> Homeseer Omni Plugin and Home Assistant OmniLinkBridge.
C - Homeseer connectivity is via mcsMQTT and using Microsoft SAPI voice announcement
D - Home Assistant Alexa TTS is using the Alexa Media Plugin for HA.
 
 
BTW to display the Hikvision Doorbell on Alexa via HA / Alexa media player you just have to create a script that tells Alexa to show the front door.
 
Monocle is a tad slow displaying the video.  Reading on the forum this is due to the Hikvision OS and Alexa OS caching.  Read with Dahua cams the display comes up in 1-2 seconds.
 
I run the script in an automation that does a doorbell ring on the Alexa Show and displays the front door here.
 
BTW #2 - testing Blue Iris with AI recognition these days.  Still running Zoneminder.
 
I looked briefly at the Onvif to MQTT  docker. It works fine, but it is rather talkative, hundreds of kilobytes during a short period of time(as seen by wireshark).  It looks like it keeps polling the camera for motion events rather than the camera pushing events when they occur.
 
My idea was to use the doorbell camera only for motion event notification because I did not want to overload my 2.4GHz WiFi with the video stream, but it looks like even watching for motion creates too  much traffic.  Not sure if ONVIF even has a push event protocol -- did not look at it for a while.  I may spend some time and write something in python if push is supported.
 
I shut off the OnVIF2MQTT plugin last week  and went to using the HA ONVIF plugin which is connected to the Hikvision DB.
 
I was seeing errors and sometimes the Hikvision DB would reset itself.
 
It set up a device called: MyMotionDetectorRule Cell Motion Detection
 
and a motion sensor called binary_sensor.mymotiondetectorrule_cell_motion_detection.
 
Currently publishing a message to a Tasmota ESP01 relay which is connected to one zone on the alarm panel.
 
I was doing triggering using PAHO MQTT on OpenWRT.  Simple script.
 

import paho.mqtt.client as mqttMQTTv31 = 3
MQTTv311 = 4
MQTTv5 = 5
message = 'ON'
def on_connect(client,userdata, flags, rc):
    client.subscribe("onvif2mqtt/Doorbell/motion")
    print("rc: " + str(rc))


def on_message(client, userdata, msg):
    global message
    print(msg.topic + " " + str(msg.qos) + " " + str(msg.payload))
    message = msg.payload
    client.publish("Omni/HikVision_PIR/cmnd/POWER",msg.payload);


def on_publish(client, userdata, mid):
    print("mid: " + str(mid))


def on_subscribe(client, userdata, mid, granted_qos):
    print("Subscribed: " + str(mid) + " " + str(granted_qos))


def on_log(client, userdata, level, buf):
    print(buf)


mqttc = mqtt.Client("petetest",protocol=MQTTv311)
# Assign event callbacks
mqttc.on_message = on_message
mqttc.on_connect = on_connect
mqttc.on_publish = on_publish
mqttc.on_subscribe = on_subscribe
# Connect
mqttc.connect("192.168.244.150", 1883)
#mqttc.connect("192.168.1.41", 1883)


# Continue the network loop
mqttc.loop_forever()

Really the above was a learning thing with PAHO MQTT.  You can do the same in Home Assistant.
 

service: mqtt.publish
data:
  topic: onvif2mqtt/Doorbell/motion
  payload: 'ON'
 
Just tried the HA integration.  It is much better in the sense of traffic -- if there's no motion, it sleeps form10 seconds, so much less voluble.
 
The HA ONVIF VideoSource_1 Motion Alarm also works. 
 
Thinking one is using video and the other uses the PIR.  Using Batch Configuration you can adjust the video motion piece.
 
I do not think you can adjust the PIR via software batch configuration or any of the apps.
 
For the doorbell button press I was using a combo Elk 930/960 circuit board set up.  The Elk 930 quit working with this doorbell so I went to using a current detector which works well.  The Elk 960 is just a debounce board.
 
So both the doorbell button press and PIR are connected to alarm panel zones plus both do MQTT messages.
 
There are also Python ONVIF script examples over here ==> onvif-pyPI
 
Thinking that is where the HA onvif stuff came from.
 
[sharedmedia=gallery:images:1460]
 
 
Back
Top