Filter issue - Less than X time doesn't seem to work

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
kylegp
Posts: 6
Joined: Tue Jan 21, 2020 3:31 am

Filter issue - Less than X time doesn't seem to work

Post by kylegp »

I'm going crazy trying to figure out why my filter doesn't work.

I want to be emailed if an alarm event occurs within a certain time.

Eg. If an event occurred less than or equal to 60 minutes ago.

Here's my filter settings:
filter.PNG
filter.PNG (73.36 KiB) Viewed 3636 times
I have alarms I've triggered on purpose several minutes ago when testing this but nothing shows up as a match in the filter list.

What am I missing here?
User avatar
iconnor
Posts: 2862
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Filter issue - Less than X time doesn't seem to work

Post by iconnor »

End Date/Time has a value like 2019-01-20 12:34:56

So less than 60min doesn't make sense.
However you can do less than -60min which ZM translates to NOW() - 60mins.

So add a -.
kylegp
Posts: 6
Joined: Tue Jan 21, 2020 3:31 am

Re: Filter issue - Less than X time doesn't seem to work

Post by kylegp »

iconnor wrote: Tue Jan 21, 2020 12:48 pm End Date/Time has a value like 2019-01-20 12:34:56

So less than 60min doesn't make sense.
However you can do less than -60min which ZM translates to NOW() - 60mins.

So add a -.
What I'm trying to accomplish is a filter that says "If the event happened less than 60 minutes ago, be a match".

Or put another way, I want ZM to email me only when a new event occurs, not for every event in the past that still matches the criteria of having enough alarm frames. I received dozens apon dozens of emails, so I was thinking I needed to make a filter that says only to send an email if the event happened within the last hour for example.

I tried playing around with - values and it didn't seem to do what I was after. Eg. less than -60min didn't show any matches for events that happened just ten minutes ago.
mikb
Posts: 585
Joined: Mon Mar 25, 2013 12:34 pm

Re: Filter issue - Less than X time doesn't seem to work

Post by mikb »

It could be that "Less than" doesn't mean what you think it means. You're not the first to get caught.

-60mins is "60 minutes ago". (Didn't ZM also support the literal "60 mins ago" ?)

But "Less than" means a time value SMALLER THAN that, meaning over 60 minutes ago.

Try "More than" (yes, that's counter intuitive, language and maths at odds here ...)
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Filter issue - Less than X time doesn't seem to work

Post by snake »

I use something like this:
https://wiki.zoneminder.com/SMS_Notific ... ple_Filter

Code: Select all

date/time greater than or equal to -1 minute AND
alarm frames greather than or equal to 1 AND
Weekday equal to Saturday OR
Weekday equal to Sunday AND
alarm frames greater than or equal to 1 AND
date/time greater than or equal to -1 minute
Note that once an email is sent, it will not send again. There is a flag in the DB for each event which gets set upon transmission.
kylegp
Posts: 6
Joined: Tue Jan 21, 2020 3:31 am

Re: Filter issue - Less than X time doesn't seem to work

Post by kylegp »

snake wrote: Tue Jan 21, 2020 6:50 pm I use something like this:
https://wiki.zoneminder.com/SMS_Notific ... ple_Filter

Code: Select all

date/time greater than or equal to -1 minute AND
alarm frames greather than or equal to 1 AND
Weekday equal to Saturday OR
Weekday equal to Sunday AND
alarm frames greater than or equal to 1 AND
date/time greater than or equal to -1 minute
Note that once an email is sent, it will not send again. There is a flag in the DB for each event which gets set upon transmission.
Thanks, I gave this a go and it works fine in Modect, after a minute or two I receive an email and that works fine. I get a link to the event and when I view the event I'm seeing exactly what was in motion and when it stops.

However, I want to use Mocord and I receive an email considerably later than with Modect and also the recorded event seems to have a lot of footage before and after the recorded motion. Something is going on there.

My guess is that because Mocord is constantly recording and only highlighting the motion capture, the same section length (600) rule applies to Mocord as it does with Record so until 600 seconds has past, Mocord hasn't saved the event therefore the rule doesn't match it yet? Would that be why?

If so, any way around this so that despite constantly recording I can still get the email when motion is detected?
Post Reply