I’ve set up a new ST integration with my Hikvision NVR. I have some IP cameras that have a feature that detects an object crossing a virtual line. I’ve created a driveway entry line and configured the NVR to close one of its dry contact closures when something crosses this line. This gives me a virtual driveway entrance event. I connected an ecolink contact sensor (which has dry contact inputs) to the NVR closure output, and linked the sensor to ST. I’m now using notify me when to send a push notification when someone enters the driveway, and Smart Lighting to turn on some floodlights when someone enters the driveway at night after I’ve gone to sleep.
Hope this gets the wheels turning for anyone else with these NVRs!
So, I think the actual line crossing detection is performed in the camera, not the NVR. It only works for my IP cameras, not the TVI cameras attached to the NVR. That said, it’s been very reliable over the past few days for the above pictured camera. However I have it set up on another camera and was getting a lot of false alarms due to trees making shadows on the ground while blowing in the wind. I’ve switched to intrusion detection for that camera and will see if that helps.
I’d suggest using NVMS7000 to watch the live view from the camera. It will show the objects that the line detection algorithm is recognizing, which could help you fine tune the placement. The algorithm draws a box around objects that it sees, so the recognized area might be much bigger than expected if you have an object positioned diagonally with respect to the camera view.
It’s an LTS (rebranded Hikvision in USA) LTD8508T-ST, which is a hybrid DVR with 8 channels of 3MP TVI and 2 IP channels. I went with that since I was upgrading from an analog system and had a fair amount of coax run through walls, etc. already.
Done. I’ve integrated mine last night via node.js running on a raspberry PI 3, using the email configuration in the NVR. The node.js app exposes a very limited SMTP server that accepts all the alert emails from the NVR, parses them, then forwards them to the intended destination, basically a middle-man. It then sends notifications to a web service smart app that automatically generates a motion device for each camera and intrusion event (i.e. Front Door Intrusion Sensor, Front Door Line Crossing Sensor, Front Door Face Detection Sensor etc.) - you just need to trigger each event once to get the device to show up in ST. I’ll publish the code if anyone wants it, it’s pretty simple.
I tried following your instructions to setup the hikvision-nvr smartapp but could not find the accesstoken or appid in the IDE under the “HIKvision Motion Sensors” application state. Is there another way to find this information if it isn’t listed there?
When I go to Locations > smartapps > Hikvision Motion Sensors I don’t see anything that looks like an access token (see screenshot below). All I see is a string of characters at the bottom of the image that looks like it could be the app ID (blacked out in screenshot). Am I missing something? Where should I see the access token?
After enabling oauth and removing/re-adding the smart app I was able to find the app token and finish configuring the NodeJS server. I have also verified that the mail server running on my raspberry pi 3 is successfully receiving the NVR event emails since they also get forwarded to a different email address. However, I’m not seeing any new motion devices for the events that I have triggered after setting up this server (i.e. event type “Motion Detection”). I assume that the new motion devices will show up when I go to “Add a thing” in smartthings (rather than magically showing up in my list of things). Any ideas what I’m doing wrong?
You need to make sure you installed the DTH and no, the devices will happen as you get alerts from your cameras. Go in front of each camera and devices should be created for you automatically. Just make sure you installed and published the DTH
Apparently my HIKVISION camera formats the email events differently so I had to modify the app.js script to identify my camera name and number correctly since they were not being parsed in your script. My camera email events include the following text:
EVENT TYPE: Motion Detection
EVENT TIME: 2018-01-29,17:42:27
IPC NAME: IP CAMERA
CHANNEL NAME: Camera 01
CHANNEL NUMBER: 1
IPC S/N: DS-2CD2342WD-I2017xxxxxxxxxxxxxxxxxx
I just added the following lines to the switch statement:
case 'IPC NAME': cameraName = data; break;
case 'CHANNEL NAME': channelName = data; break;
With these changes I also noticed that the script was making multiple web requests and I was ending up with duplicate smartthings devices, so I moved the web request part of the script outside the for loop and now I only see one web request per event and don’t have any duplicate devices.
But when I go to run the test command after, nothing happens. When I list the contents in /node there is nothing. I’m sure I am missing something simple - help?
Error: Cannot find module '/var/node/nvr/app.js’
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:190:16)
(Trying to Oauth and ST IDE is just sitting there…might be down)
After searching for a solution to integrating my Hikvision NVR with Smartthings I decided to put together my own integration. Thanks to ady624 and his code, it inspired me to write my own python script to connect events and alarms that are triggered by the NVR to my ST hub.
ady624’s code sets up a mail server to receive and redirect emails. I didn’t want to go this way, and since I am already running python code to integrate ST with my DSC alarm system, I decided to expand on this.