help with PLEG scene creation

Hello-

I am new to the forum. I just purchased a PLEG license and am having a hard time figuring it out. I tried to simulate one of the examples on the PLEG help guide and then customize those examples for my scenario. The PLEG scene works flawlessly however upon customization i’m running into issues. Here’s what i’m trying to accomplish:

Scenario 1:
-When i enter into my house (night time only) when the door sensor is opened i wish to have the hall light and the kitchen lights turn on
*as soon as the door is opened there should be a timer for the kitchen lights (1 hour) and the hall lights (5 minutes)

  • when the timers hit 0 the respective lights should turn off (5 minute timer for hall light and 1 hour timer for kitchen light)
  • if the front door is open at any time before the timer(s) hit 0, the timers should start over again (no lights turned off until the new timer hits 0)

Here’s how my configurations are set so far-
Triggers:
door1: Front door is armed and open
lighton: kitchen and hall light turned on

logic actions:
autoon --lights turn on
autooff --lights turn off

conditions:
this is where i’m having trouble (i think)

Scenario 2-
when motion is detected from a motion sensor night time only, it should turn on a light.
this light should turn off within 5 minutes
if for any reason motion is still detected the light should stay on regardless of the 5 minute counter
as soon as motion is not detected any more the light should turn off after 5 minutes

(explanation: i am currently running this scene using the regular scene editor in Vera however my issue is that if i’m in the hallway for a prolonged period of time the lights turn off on me. I think the motion sensor is not resetting and therefore turning off the light. I tried running the scene saying “turn off light when motion stops detecting motion” however the issue is i might still be in the hallway and motion is still not detected and lights turn off on me

Hi Ziggy,

Scenario 1:

Triggers:
door1: Front door is armed and open

Scheduled:
Night: On 20:00 Off 07:00

Conditions:
Dooropen: door1 AND Night
KitchenOff : (door1 ; Now > 60:00 ) AND Night
HallOff: (door1 ; Now > 5:00 ) AND Night

logic actions:
Dooropen : Kitchen turn on, Hall turn on
KitchenOff : Kitchen turn off
HallOff : Hall turn off

Scenario 2:

Triggers:
Motion: Detects motion

Scheduled:
Night: On 20:00 Off 07:00

Conditions:
detects_motion : Motion AND Night
Light_Off : !detects_motion AND (!detects_motion; Now > 5:00 ) AND Night

logic actions:
detects_motion : Light on
Light_Off : Light Off

Hope this helps, if its not exactly what you are looking for you can build from it.

Chris

[quote=“pricey1985, post:2, topic:199179”]Scheduled:
Night: On 20:00 Off 07:00[/quote]

I think you need to make this on 07:00 off 20:00 so you do not span midnight and then use:
Conditions:
Dooropen: door1 AND !Night
KitchenOff : (door1 ; Now > 60:00 ) AND !Night
HallOff: (door1 ; Now > 5:00 ) AND !Night

Of course, it makes more sense to name the schedule Day and use !Day.

I had troubles with a similar schedule when I first started using PLEG.

Curious about the implications over midnight. Although all my schedules are "on 20:00, off interval 12 00 seem to work ok.

Chris

On at 20:00 and off after and interval should work. My concern would be a LUUP restart happening and the interval not resuming where it left off.

Should not be a problem.

The ONLY problem with timers with PLEG and Vera restarts is if you use an absolute timer (i.e. 20:00) and Vera is restarting during that time.
When it finally does run It will think it means the next 20:00, and not 20:00 a few seconds ago.

I proposed a Vera API change to help me fix this … they said they would do it … but it still has not happened.

So having an absolute timer, 20:00 and 07:00, gives you two intervals where if Vera restarts, your logic would not work as defined.
So changing the OFF to be an interval, from the start, reduces the chances of problems by a factor of 2.