I want to switch my front lights on when motion is detected by my front door camera.
To this end I have the camera calling a URL linked to a rule when motion is detected. The rule works and the lights switch off after 5 minutes. My problem is that the lights switching off triggers a new motion event so the rule is triggered again, and again, and again.
What I'd like to do is create a condition that says that "at least 5 minutes and 10 seconds have passed since the last time the rule was active". I can set the time that the rule was last fired into a variable, is there a way to add difference between current time and the variable time to the condition?
I'd suggest this approach: Add a SET PRIVATE BOOLEAN (for this rule) to FALSE as your first Action. Then, for the last Action, introduce SET PRIVATE BOOLEAN (also for this rule of course) to TRUE, with a delay of 00:05:10.
Then, by including in REQURED EXPRESSION another entry, namely "PRIVATE BOOLEAN == TRUE", you assure that the rule will only fire at the cadence defined by the delay above. Does that make sense?