Hi, I am wondering if there is a more elegant way to design this condition: 10 minutes after my alarm is armed, if a garage door is open then trigger an action. I only want it to check once right at the 10 minute mark. I don’t care if a door was opened before or after the alarm became armed, nor do I care if one opens sometime after 10 minutes.
This seems to work, but I have a feeling it isn’t the best way. I’m trying to improve my PLEG skills.
AlarmArmed AND (Garage1Open OR Garage2Open) AND (AlarmArmed;NOW>10:00) AND (AlarmArmed;NOW<11:00)
You would not need the:
AND (AlarmArmed;NOW<11:00)
if you turn the Repeat OFF for the condition.
But the following is another solution:
You can create an Input Time called DoorTimer … It would have a Self ReTrigger ON time and a 10:00 Interval Off time
Then add an action for when AlarmArmed is true that would start the timer.
Then replace:
(AlarmArmed;NOW>10:00) AND (AlarmArmed;NOW<11:00)
With:
(DoorTimer; !DoorTimer)
You still probably want to make sure that the Repeat is off for this condition.
In the first suggestion (turn repeat off and drop the “AND (AlarmArmed;NOW<11:00)”), wouldn’t the condition become true the first time a garage door opened after the alarm had been armed for at least 10 minutes? Here is how the condition would read:
AlarmArmed AND (Garage1Open OR Garage2Open) AND (AlarmArmed;NOW>10:00)
It seems like the 1st and 3rd terms would be TRUE after 10 minutes, and it would just be waiting for (Garage1Open OR Garage2Open) to go true (which could happen hours later).
I have to look into the solution using a timer…have not experimented with one of those. Thanks.
More fun with PLEG …
You might do the following:
GarageDoorOpenAndAlarm (Garage1Open or Garage2Open) and AlarmArmed
Leave the Repeat OFF
TenMinuteNotify GarageDoorOpenAndAlarm; NOW > 10:00
Leave the Repeat OFF