Hikvision Camera Event (Motion) Sensors

I have put together a few scripts I found around the internet to turn my Hikvision cameras into motion sensors.

Some background on my setup:

  • I have my HA instance running under a Docker container.
  • I have 4x Hikvision 2032 and 1 x 2332 cameras
  • My host system for Docker is unRAID

I found the guide below on how to use the event stream from the Hikvision cameras as motion sensors for openhab (a project I used to use and still follow).
http://www.ragingcomputer.com/2016/06/hikvision-motion-detection-in-openhab-using-node-js
The script and modules are all in nodejs and send the sensor updates to openhab via the REST API. This didn’t take much modifying to get it to send updates to HA.
I did spent about a day or so trying to make my own custom component equivalent and had some success but decided to leave that to a later date. I will post on the development forum about that later.

I installed the official nodejs docker and have my script running in that. I have linked the script below for those who want to ttry this out.

The code is far from tidy and not how I would structure it. Each new camera requires a heap of copied code. But it works and will make a nice HA component one day.
I made some changes to the code before uploading it to GitHub so hopefully it still works as advertised.

The development discussion.

If you have come across this tread and are looking to use hikvision events on HA then check out the development thread that has a working component in testing.
I am no longer using the nodejs scripts posted above.

There is a Hikvision component to be included in the 0.35 release.

Do you know if i can work for with this dahua camera?

1 Like

I use a hikvision NVR with all cameras through a single Host which makes things easier but recently i upgraded the NVR to a 24 port and it came with a later version of Firmware. Now the Hikvision events arent passed to HA as quickly, im getting roughly a 30 second delay or sometimes none at all.

I use the line cross and motion events to set off lights etc…

Anyone else come across this with Hikvision’s NVR firmware 4.x?

You can always move the cameras to the network, events much quicker.

Also, have you tried connecting to the camera via the virtual host IP/Port?