Using alarm signals from cameras for motion detectors

Joined
Sep 7, 2017
Messages
10
Reaction score
0
Location
Warwick, UK
A long time ago Nayr wrote how to make API calls to capture alarm signals generated by IVS & then the Dahua firmware changed.

I have 8 Dahua cameras of various types all running the v2.80 firmware (IPC-HX5X3X-Rhea_MultiLang_PN_Stream3_V2.800.0000013.0.R.191202 to be precise).

I have two big floodlights which are triggered by a pair of traditional PIR sensors and they come on randomly when it’s windy, due to I guess foliage moving about. What I’d really like to do is somehow monitor the alarm signals from the cameras and use these to turn on the lights instead, ideally only turning on the lights when two cameras get triggered by a person or vehicle.

I run a home control system on raspberry pi‘s, complete with MQTT and am happy interfacing relay control boards to this - e.g. my garage door opens automatically as I approach the house, triggered by my phone entering a GPS geofence AND the phone is connected to the car’s bluetooth.

The only bit of the equation I’m missing is how to get the camera IVS alarm signals either from the cameras (or my Dahua NVR, running V4 firmware) into the Raspberry Pi.

Options seem to be:
API calls - ideal, but doesn’t seem to be published anywhere how to do this?
Physical alarm signals from the cameras - some of my cameras seem to have an alarm out connector?
SNMP - do alarms from cameras get sent here and could I do some manipulation of data arriving at an SNMP server to spot alarms?
RTSP - I think that this is only for video, so probably not helpful
eMail - I guess I could set up a local email server and monitor incoming emails, but can’t help thinking that this is going to be a high latency solution, i.e. by the time something has received and processed the email, whoever needed the lights to come on will be long gone!

any advice, guidance or experiences here would be most welcome

thanks, Mark...
 
Joined
Sep 7, 2017
Messages
10
Reaction score
0
Location
Warwick, UK
Hi Looney2ns. I did read the original “has anyone got the latest Dahua API documentation” thread and arrived at the same place, that the only version that there is documentation for is many versions ago. I also seem to remember reading that you’d tried something similar shortly after Nayr stopped posting here. Did you ever manage to successfully interact with the API on the cameras? (I seem to be failing at the authentication stage!)
 

Buttan Butt

Getting the hang of it
Joined
Jun 4, 2017
Messages
86
Reaction score
56
Location
Sweden yeah!
...
any advice, guidance or experiences here would be most welcome

thanks, Mark...
FWI, I know that Blue Iris can extract IVS alarm events right out of the ONVIF stream. I tried it and it works well. However since many of my cameras haven't got IVS, I've instead started using AITOOLS together with deepstack AI which gives me much better precision. AITOOLS talks MQTT as well so you'll be able to get notified about any specific objects that gets detected, humans, cars or whatever you need to filter out. So whar you are aiming to do is abslolutely not impossible but my solution involves setting up a Blue Iris server (which might not be such a bad idea if you are interested in home automation as well)
 

The North Face

Getting the hang of it
Joined
Jul 28, 2019
Messages
108
Reaction score
56
Location
North of the wall
I run a home control system on raspberry pi‘s, complete with MQTT and am happy interfacing relay control boards to this - e.g. my garage door opens automatically as I approach the house, triggered by my phone entering a GPS geofence AND the phone is connected to the car’s bluetooth.

The only bit of the equation I’m missing is how to get the camera IVS alarm signals either from the cameras (or my Dahua NVR, running V4 firmware) into the Raspberry Pi.
Check out the script that @johnnyletrois wrote: johnnyletrois/dahua-watch

I do exactly what you’re after but using Synology Surveillance Station as the trigger, since it natively supports some IVS events these days, that then uses Domoticz to turn the floodlight on.

My old version that watched the event stream and then triggered Surveillance Station (to start recording, before SS supported IVS) is here: AblazeWoland/dahua-ivs-watcher
 
Joined
Sep 7, 2017
Messages
10
Reaction score
0
Location
Warwick, UK
Check out the script that @johnnyletrois wrote: johnnyletrois/dahua-watch

I do exactly what you’re after but using Synology Surveillance Station as the trigger, since it natively supports some IVS events these days, that then uses Domoticz to turn the floodlight on.

My old version that watched the event stream and then triggered Surveillance Station (to start recording, before SS supported IVS) is here: AblazeWoland/dahua-ivs-watcher
WoW! Brilliant, thank you. Hadn’t spotted any of that approach previously. Certainly given me some things to experiment with
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
You have existing MQTT running. Blue Iris does publish MQTT topics upon alerts. Are you using Blue Iris?
Since into relay boards, you could easily incorporate ESP wifi boards to your flood lights to turn on upon a MQTT published topic from Blue Iris. This is what I plan on eventually doing to my dumb floodlights (to make them somewhat smart). The existing PIR's on those floodlights .... struggle.
Dahua has a floodlight/camera model, but Andy says super buggy and I think is for the "Lynx" system (which I believe is not ONVIF / Blue Iris capatible).
 
Last edited:
Joined
Sep 7, 2017
Messages
10
Reaction score
0
Location
Warwick, UK
I have a Dahua NVR5216-4KS2 running V4 firmware. I did consider using Blue Iris, but it feels like an overkill and would certainly use more electricity. If I can avoid buying another always on computer, I’d like to avoid it.

I have an always on low power Intel i3 Ubuntu server for media, computer backups and the like and then all my house is running on 5 raspberry pi‘s ( 1 x Pi4, 2 x Pi3 & 2 x Pi0).

Current thinking is to run a Python3 script on the Pi4 (which is running MQTT, Node-Red & OpenHAB) to catch the IVS alerts as per @NorthFace’s suggestion above. Simple then to get the Pi3 in the garage to switch the floodlights
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
I have a Dahua NVR5216-4KS2 running V4 firmware. I did consider using Blue Iris, but it feels like an overkill and would certainly use more electricity. If I can avoid buying another always on computer, I’d like to avoid it.

I have an always on low power Intel i3 Ubuntu server for media, computer backups and the like and then all my house is running on 5 raspberry pi‘s ( 1 x Pi4, 2 x Pi3 & 2 x Pi0).

Current thinking is to run a Python3 script on the Pi4 (which is running MQTT, Node-Red & OpenHAB) to catch the IVS alerts as per @NorthFace’s suggestion above. Simple then to get the Pi3 in the garage to switch the floodlights
always wondered if NVR's publish MQTT or not. Would be cool if they did eventually.
 
Joined
Sep 7, 2017
Messages
10
Reaction score
0
Location
Warwick, UK
Seems that the potential is there to interrogate the API, but it's just not publically documented. They do squirt something out to SNMP servers, but I've not yet gone down the route of working out what that looks like
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,960
Reaction score
48,677
Location
USA
I have a Dahua NVR5216-4KS2 running V4 firmware. I did consider using Blue Iris, but it feels like an overkill and would certainly use more electricity. If I can avoid buying another always on computer, I’d like to avoid it.
An NVR is basically a watered down computer that all it can do is that and usually not very well. I have had NVRs in the past and am now a BI user and will never go back. Playback was horrible trying to find something even if only set to record on motion. Every morning in Blue Iris in under 1 minute and I can quickly see if anything happened I need to investigate. It took forever to try to find an event on the NVR. I didn't see my electric bill go up when I made the switch and my kill-o-watt meter showed the computer was actually using less than the NVR.

For the true test, I actually still have an old NVR going just for kicks and backup until it dies. We had a power outage recently and the BI computer lasted the entire outage on backup power and the NVR did not - two separate backup units but the exact same model purchased at same time. You run the computer without the monitor on and BI runs as a service and you don't run anything else on it and the power isn't really as much as you think.

You seem to be into tinkering and you will find Blue Iris much more fun to tinker with than an NVR LOL.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,960
Reaction score
48,677
Location
USA
I can see that is one of the compelling reasons! I do actually have an i7 Gen 5 motherboard with 16GB RAM that's not doing anything right now ...
Sounds like the 14-day free trial is in your future LOL. You can bring the cameras right into from the NVR.

I tinker with my Blue Iris way more than I want to admit LOL and trying different things and stuff that just was never possible in the NVR. I got to the point with the NVR I never looked at it unless I knew something happened or a neighbor asked if I captured anything.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
Like wittaj says, tinkering with Blue Iris is really fun since it has billions and billions of options, from the cameras to the program itself. I kinda had to put tinkering on hold due to a security issue I am dealing with. In a rush, I had to learn rather quickly how to setup Blue Iris scheduling (work, sleep, at home) to do different things at different parts of the day/night. Then had to learn MQTT between Blue Iris and Home Assistant. Then had to learn how NOT to leave cameras at default value but tinker with them to get that oh so nice (well....better) 3am night time video & images.
If I had a NVR to start out with, I would of been screwed with my security issues I had.
 

johnnyletrois

Young grasshopper
Joined
Feb 13, 2017
Messages
48
Reaction score
9
Check out the script that @johnnyletrois wrote: johnnyletrois/dahua-watch

I do exactly what you’re after but using Synology Surveillance Station as the trigger, since it natively supports some IVS events these days, that then uses Domoticz to turn the floodlight on.

My old version that watched the event stream and then triggered Surveillance Station (to start recording, before SS supported IVS) is here: AblazeWoland/dahua-ivs-watcher
@cor35vet wrote the original python code. I just modified it.
 
Top