Page 1 of 1

Is there a way to only create an event if x number of consecutive alarm frames?

Posted: Sun Feb 14, 2016 3:43 am
by Tantamount
I'm looking to do what this person asked 6 years ago:
viewtopic.php?f=21&t=15176

I live in an area where at night, the fog gets thick enough to cause mist to form. This looks like little flurries to the cameras and cause all kinds of spurious false alarms to trigger.

I've tried the various presets on the zones -- medium vs high sensitivity, and this mostly works, however, I've found that when doing this, ZM is dropping real events.

From what I've seen, the events I'm ever concerned about are those that have multiple alarm frames, one after the other. I'd much rather turn the detection back up to high, but then only keep events where there are x number (5?) of consecutive alarm frames.

I've looked at the filter option too, but that only has an option for total number of alarm frames, not consecutive.

Is this possible with ZoneMinder?

Re: Is there a way to only create an event if x number of consecutive alarm frames?

Posted: Sun Feb 14, 2016 11:43 am
by asker
The "Alarm Frame Count" variable inside the monitor definition windows does this

From:
http://zoneminder.readthedocs.org/en/st ... nitor.html (with added emphasis on the relevant portion)
This option allows you to specify how many consecutive alarm frames must occur before an alarm event is generated. The usual, and default, value is 1 which implies that any alarm frame will cause or participate in an event. You can enter any value up to 16 here to eliminate bogus events caused perhaps by screen flickers or other transients. Values over 3 or 4 are unlikely to be useful however. Please note that if you have statistics recording enabled then currently statistics are not recorded for the first ‘Alarm Frame Count’-1 frames of an event. So if you set this value to 5 then the first 4 frames will be missing statistics whereas the more usual value of 1 will ensure that all alarm frames have statistics recorded.

Re: Is there a way to only create an event if x number of consecutive alarm frames?

Posted: Mon Feb 15, 2016 8:10 am
by Tantamount
Ah, thanks for that clarification.

Is that variable one that gets saved with the "state"? I.E. something I can use during "sunset" mode only?

It would be great if that setting was per zone instead of per monitor.

Re: Is there a way to only create an event if x number of consecutive alarm frames?

Posted: Mon Feb 15, 2016 2:00 pm
by asker
As far as I remember, no, this is linked to a monitor, not a state. However, you could do this:

1. Create two copies of the same monitor, one with AlarmFrames = 1 and the other with AlarmFrames = X (whatever that X is)
2. In sunrise state, keep the one with 1 enabled and the one with X disabled
3. In sunset state, do the opposite

Re: Is there a way to only create an event if x number of consecutive alarm frames?

Posted: Mon Feb 15, 2016 8:18 pm
by Tantamount
Thanks again asker.

I went ahead and added this to the cron script that swaps between sunrise and sunset:

curl -XPUT -k https://127.0.0.1/zm/api/monitors/1.json -d "Monitor[AlarmFrameCount]=2"

This API stuff opens doors... really like it.