Hi,
I have a door detector that is supposed to turn off some lights when you leave in the morning.
Before I had a scene triggered by the state ‘device not triggered’ of the sensor. It worked pretty well.
Now I’m migrating everything to PLEG and I have some problems.
I have a trigger closeDoor for the door detector, set to ‘is not tripped’ and the condition is:
closeDoor AND (07:45:00;NOW;08:20:00)
The problem here is that closeDoor is always true as long as the door is closed.
What I need is for this condition to be true ONLY when you close the door after it has been open, but only is this timeframe.
Can this be done with PLEG?
Thanks in advance
Try this:
ConditionName closeDoor AND (07:45:00; closeDoor; 08:20:00)
And having a hard time understanding this statements.
What’s the difference with the one I had?
My logic was: check if door is closed AND if that happened between 7:45 and 8:20
Your sequence expression b[/b] becomes true at 07:45:00. If closeDoor is true at that point that point, the Condition will fire.
The expression (07:45:00; closeDoor; 08:20:00) becomes true when closeDoor last became true (door was closed) between 07:45:00 and 08:20:00. When combined with and closeDoor, it means: The door is closed and it was last closed between 07:45 and 08:20.
Ok, thank you.
Everyday I’m a bit wiser as far as PLEG is concerned.