Avoiding multiple notifications

Hi
I have a sensor at my front door which sends notifications including images when triggered but i want to avoid multiple notifications if its activated a number of times by someone at the door.

So i was thinking of using PLEG in such away that the condition is only true when the sensor is triggered and hasn’t been triggered in the last minute.
I’m not sure the best way to do this in PLEG.

Been a while so my pleg is rusty. If you have a trigger t_DoorSensor, the code below should only send an alert once every 5 minutes.

( t_DoorSensor ; Now >5:00) and t_DoorSensor

If you only want to trigger the notification once, easiest way would be a sequence expression.

Like FrontDoorOpened and (FrontDoorOpened;!FrontDoorOpenCloseTimer)

In this case I only want a notification if the door has been left opened for 10 minutes. When the Front Door is opened I start a 10 minute timer. I only allow the condition triggering a notification (above) to fire after that 10 minute timer has expired. (In this case it will only notify once, even if the door is left open for hours. There is another more complicated way if I want periodic reminders it is still open.)

In your case, take the existing condition, and add an action to start a self-re-triggering timer. Manually start and end that timer (toggle). Then modify the existing condition to only fire if the timer has stopped before the current senor trip timestamp.

(@kigmatzomat 's Now example above is a LOT easier to implement, but timers AKA schedules take less overhead and give you more control.)

@ kigmatzomat
Thanks for this but i found that the NOW statement was adding a delay for my notification as it is only refreshed every minute.

@wilme2 Thanks the timer seems to have for me but i did need to add a delay of 1 sec to the action of the timer as when my sensor is tripped, timer is started and is “true”

My rules are as follows:
cPosFrontBeam = t_Front_Beam AND t_Front_Door
Action to start timer (s1_timer) after 1 sec delay

cBeamNotification = cPosFrontBeam AND !s1_timer

Having the notification set to cPosFrontBeam AND (cPosFrontBeam;!s1_timer) didn’t seem to work correctly

I forgot about the limit on NOW. I generally was fine with it because it cut down system load (which at times over the firmware versions was important) and for my uses, it didn’t matter if things happened after 5m 1s or 5m 59s.

@asalbeag post a PDF of the status report if you haven’t got it working…

Thank you all seems to be working fine with the above rules.