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

Forum for questions and support relating to the 1.29.x releases only.
Locked
Tantamount
Posts: 76
Joined: Wed Feb 03, 2016 7:51 am

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

Post 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?
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

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

Post 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.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Tantamount
Posts: 76
Joined: Wed Feb 03, 2016 7:51 am

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

Post 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.
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

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

Post 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
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Tantamount
Posts: 76
Joined: Wed Feb 03, 2016 7:51 am

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

Post 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.
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
Locked