OK… here’s another project I decided to take on in order to try and understand PLEG…
Devices:
- Ligth Switch = LivingLight
- Door/Window Sendor = FrontDoor
- Motion Sensor = Motion
- Night
What I want:
If it is Night and the door is opened OR motion is sensed turn the light ON 50% for 15 minutes; unless the light is already on (in case the light is already on at a different dim level)
Light should remain ON if Motion is triggered so the 15 minutes timeout should be initiated each time Movement is tripped or door is Opened/Closed
So far I’ve managed to get the light to turn on with the door opening and turns off when the timeout expires… but if the light is off and there’s movement the light keeps turning on/off/on/off until I set the PLEG to standby (infinite loop somewhere).
Here’s what I currently have:
Triggers
Name Description
DoorOpen Sensor Puerta Sala is tripped
Night Day or Night indicates Night time.
Move Movimiento is tripped
LuzOn Luz Sala is turned on
NoMove Movimiento is not tripped
DoorClosed1 Sensor Puerta Sala is not tripped
Schedules
Name Type Time Days
Conditions
Name Expression
LightIsOff NOT LuzOn
AutoLightOn Night AND LightIsOff AND (Move Or (LightIsOff; DoorOpen))
AutoLightOff LuzOn AND (DoorClosed1; NOW > 1:00) AND (NoMove; NOW > 1:00)
Actions
Actions for Condition: AutoLightOn
Device Action Arguments
Luz Sala SetLoadLevelTarget newLoadlevelTarget=50
Actions for Condition: AutoLightOff
Device Action Arguments
Luz Sala SetLoadLevelTarget newLoadlevelTarget=0