Alarm Mode - Use Static JPG and ZMTrigger as alarm only

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
User avatar
snake
Posts: 174
Joined: Sat May 21, 2016 2:20 am

Alarm Mode - Use Static JPG and ZMTrigger as alarm only

Post by snake » Sat Sep 29, 2018 4:02 pm

Here's a question: "How do you connect a motion sensor to Zoneminder without using a camera?". Let's say you have a door or a window you want to monitor. The answer is simple - use a camera with a static JPEG in file mode, and then set the mode to nodect. When you wire up the alarm, you use ZMTrigger or the API to alarm that monitor, and of course you probably want an email or sms notification set on it.

In a sense, you are using ZM as a home security system at this point - not as a cctv system. That's fine, it will work just as well. In fact, more credence could be given to ZM as a home security system, but let's not do that, to avoid bloat. I considered that maybe a new mode could be made that instead of remote, or ffmpeg, or file is just "Alarm", but this is too fringe of a usage at this point.

Anyways, You have an alarm somewhere, e.g. a ZM motion sensor arduino sketch and you set it to a file. Then if the alarm is set off, you get an email. I will be using this in addition to other cameras, but it will be at a point where I don't necessarily want to wire a camera.

Ideally there would be a FOSS alarm company that you could connect into their API, but this will do until then.

There is some other discussion on similar themes (search home security), e.g.
viewtopic.php?f=12&t=21853
But it looks as if no one has suggested this particular application. Some unfavorable mention of X10 has been made. I will be personally wiring up the Modect sensors with passive PoE.

alabamatoy
Posts: 151
Joined: Sun Jun 05, 2016 2:53 pm

Re: Alarm Mode - Use Static JPG and ZMTrigger as alarm only

Post by alabamatoy » Mon Oct 01, 2018 4:16 pm

I have been pursuing this as well. Here's my plan:

1 - Motion detection will be done with one of these.

2 - A Raspberry Pi will be configured to connect to the "relay" shunt of the Guardline receiver. Here is RPi guidance on how to do that.

3 - I will have to write a bit of script on the Pi to check the GPIO over and over, and if it goes into alarm, use the zmtrigger.pl interface to throw an alarm on Zoneminder. I strongly suspect someone else has already written this for some other purpose, and I can just plagiarize.

I have pretty much given up on the ZM motion detection. Its just too doggone noisy and way too many false positives, and quite a few false negatives as well.

Feedback would be appreciated.

alabamatoy
Posts: 151
Joined: Sun Jun 05, 2016 2:53 pm

Re: Alarm Mode - Use Static JPG and ZMTrigger as alarm only

Post by alabamatoy » Fri Jan 04, 2019 6:01 pm

Well...its been a while. I have this working, if anyone is interested. Basic design:

1 - Guardline PIR motion sensors. These things seem to work very well. I havent had a false positive yet. It will detect dogs and deer and people, but no squirrels yet. Cars are very easy, they are HOT.

2 - I used a Numato GPIO board with a USB connection. This is a bit klunky, because you have to poll the board for its condition, and I would have preferred to just read a memory location instead. Its serial IO, so you have to send it a command to read a particular pin status, and it responds with the result. I have a bash script working which polls the board and returns the GPIO status. The numato board is wired to the Normally Open shunt/dry contact on the Guardline monitor device. The linked reference document has a simple wiring diagram near the end.

4 - I wrote another script which uses the ZM API to set various monitors into alarm based on the GPIO reading of the Guardline shunt. The Guardline sensor has multiple zones on each receiver, but only one NO/NC contact, so if you want more zone granularity, you must have more Guardline receivers. :-(

5 - The GPIO status is polled very 10 seconds. If the Guardline has sensed motion, the ZM zones go into alarm for 30 seconds. I am still tinkering with the timing, may pull this back to every 5 seconds. Its minimal load on the computer compared to ZM motion detection!

Feedback/criticism is welcomed....

I wrote a note to Guardline asking why they dont have something which I can just read state via network, and they responded very quickly that they are actually developing such a product.

HTH

User avatar
snake
Posts: 174
Joined: Sat May 21, 2016 2:20 am

Re: Alarm Mode - Use Static JPG and ZMTrigger as alarm only

Post by snake » Tue Jan 08, 2019 12:23 am

Guardline sounds good, though outside of my budget. I am currently using microwave motion sensors (HFS-DC06H), but they are so effective, they pick up mice on the ceiling tiles...

The Numato board is interesting, though I don't see the benefit of those over something like an Arduino. The screw terminals are nice. Them becoming obsolete is a danger. Are they OSHW?

With my motion sensors I have them send a tcp packet to ZMTrigger, and the alarm is immediate. As for timing of how long to alarm, that's entirely up to you. I have ZMTrigger alarm ON for a few seconds, and then there is a timer in the micro that will only send a packet every say 10 seconds. So if the motion disappears within that 10 seconds, there is only one packet sent, and the alarm doesn't extend. However, if the motion remains, the alarm is extended and there is no gap in the recording. It's a seamless alarm.

Are you using the pi for anything else? Why don't you poll the GPIO more frequently, or setup an interrupt? five to ten second delay is not acceptable for activating cameras in my setup. You can use the poll system function if GPIO reading via sysfs is too resource intensive.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests