Filter to trigger with excluding a zone fails to exclude

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
GadgetChris
Posts: 10
Joined: Wed Mar 13, 2024 3:31 am
Location: GTA, ON, Canada

Filter to trigger with excluding a zone fails to exclude

Post by GadgetChris »

I'm trying to create an action for a trigger of one alarm zone and not another alarm zone:
zm-error-filter1.png
zm-error-filter1.png (21.38 KiB) Viewed 227 times
This is the debug:

Code: Select all

SQL SELECT E.,M.Name AS MonitorName,M.DefaultScale
FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId)
WHERE
E.TotScore > '30' and / AlarmedZoneId / EXISTS (SELECT * FROM Stats WHERE EventId=E.Id AND ZoneId=3 AND Score > 0) 
and / AlarmedZoneId */ EXISTS (SELECT * FROM Stats WHERE EventId=E.Id AND ZoneId=2 AND Score > 0) ORDER BY StartDateTime ASC
It looks like it's not register the negation. I've also tried does not match or does not contain, and none seem to create the correct SQL.
Should this not be Score = 0 ?

Thank you, Chris
zm-v1.36.33 in docker @ Ubuntu 22.04.4.LTS
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Filter to trigger with excluding a zone fails to exclude

Post by iconnor »

I never implemented the rest of the operators for this. I'll try to get to it soon.
GadgetChris
Posts: 10
Joined: Wed Mar 13, 2024 3:31 am
Location: GTA, ON, Canada

Re: Filter to trigger with excluding a zone fails to exclude

Post by GadgetChris »

That would be great!
If you can give me a hint, I can try to do a pull request and have a go at it.
I've never looked at the code, but could give it a try...
zm-v1.36.33 in docker @ Ubuntu 22.04.4.LTS
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Filter to trigger with excluding a zone fails to exclude

Post by iconnor »

In Filter.pm, around line 164 we force the op to EXISTS. Need to instead restrict it to valid values like NOT EXISTS etc.
Post Reply