Another (FAILED) attempt..

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

Try the following:

AutoLightOff LuzOn AND (DoorClosed1; NOW > 1:00) AND (Move;NoMove; NOW > 1:00)

I added the Move to the sequence expression.
Without it … the time of the NoMove is from the previous no motion which could have been 10 Hours ago. So NoMove;NOW > 1:00 would be true.
This requires a timeout after Motion is first detected … then No Motion.

Seems to be working but not quite… here’s what I get now…

If I open the door the light turns on as expected, I then close the door and in about a minute (time i’m using for testing) the light does turn off, also as expected… but if I open the door again the light turns on then instantly turns off…

I have to close the door a couple of seconds and reopen it again for the light to turn on normally…

Im guessing it has something to do with meeting the (LightISOff; DoorOpen) condition. I tried removing the LightIsOff; part but then it does again the on/off loop

Then try:
AutoLightOff LuzOn AND DoorClosed1 AND (DoorClosed1; NOW > 1:00) AND (Move;NoMove; NOW > 1:00)

[quote=“RichardTSchaefer, post:4, topic:176567”]Then try:
AutoLightOff LuzOn AND DoorClosed1 AND (DoorClosed1; NOW > 1:00) AND (Move;NoMove; NOW > 1:00)[/quote]

ahhhh that did it…

now I’m getting the same problem that I’ve seen on some threads where if I want to manually turn off the light it’ll turn on again… no biggie with that one but if I turn the light ON manually it’ll turn off inmediately…

Thanks for all you help