Really simple PLEG schedule...

I have a pretty simple issue I would like to correct… I have 4 outside lights that I want to go off if they are turned on during the day time… My kids like to hit every button for some reason on the switch… So I created this in PLEG as follows

Imputs
Trigger
t1 is on
t2 is on

Schedule
s1
Start Day of week all, start at sunrise
Stop Day of week all, stop at 30 mins before sunset

Condition

t1 or t2

Action

turn t1 and t2 off

This works, however the schedule seems to get ignored… I initially had this in the condition t1 or t2 and s1, but that did not change…

Any ideas?

Thank you for any assistance

Did you try the following as the condition?

(t1 or t2) AND s1

[quote=“cafri, post:2, topic:185801”]Did you try the following as the condition?

(t1 or t2) AND s1[/quote]

^^^^ this is correct
or
s1 and (t1 or t2)

If this still doesn’t work then you need to check your status report in PLEG to see when your schedule is true and see if thats working.

Thank you both for replying…

This is what is says…

s1 Weekly r 1,2,3,4,5,6,7 None Weekly -00:30:00r 1,2,3,4,5,6,7 None false 2015-02-09 12:36:00.102 2015-02-09 13:50:00.101

So the schedule is showing false, even though it should be true… Maybe I will just re-install the plug in… Who knows that may give it a kick… I will report what happens… Thanks

[quote=“Jwadle, post:4, topic:185801”]Thank you both for replying…

This is what is says…

s1 Weekly r 1,2,3,4,5,6,7 None Weekly -00:30:00r 1,2,3,4,5,6,7 None false 2015-02-09 12:36:00.102 2015-02-09 13:50:00.101

So the schedule is showing false, even though it should be true… Maybe I will just re-install the plug in… Who knows that may give it a kick… I will report what happens… Thanks[/quote]

I would suggest you recheck how to setup the schedule before reinstalling.

If you setup a new schedule (or change an existing schedule) and the definition of the schedule indicates it should be true … You might be confused by the fact that the schedule state does NOT change … But you shouldn’t be!

You have programmed when the NEXT change will happen. If you want to force the schedule to change NOW then click the DO IT NOW in the schedules tab.

Ha… Well I agree, I should not be confused but I am… I guess I will always be a hardware guy… lol… So I did click the do it now button, and it does show true now, but will that stay that way from now on… I only want it to be true between 30 mins before Sunrise, and 30 mins before sunset…

Ahh,… I just thought about it again… OK “do it now” since its a new or modified schedule… so that is why it shows true… today at 30 mins before sunset, it will change to false, then tomorrow 30 mins before sunrise it will change back to true… I think I got it now…

Thanks again for your help…

[quote=“Jwadle, post:8, topic:185801”]Ahh,… I just thought about it again… OK “do it now” since its a new or modified schedule… so that is why it shows true… today at 30 mins before sunset, it will change to false, then tomorrow 30 mins before sunrise it will change back to true… I think I got it now…

Thanks again for your help…[/quote]

This is true as long as your schedule is correct. Do it now just give it a jump start vs. waiting for the next trigger point to happen.

[quote=“RichardTSchaefer, post:6, topic:185801”]If you setup a new schedule (or change an existing schedule) and the definition of the schedule indicates it should be true … You might be confused by the fact that the schedule state does NOT change … But you shouldn’t be!

You have programmed when the NEXT change will happen. If you want to force the schedule to change NOW then click the DO IT NOW in the schedules tab.[/quote]

This post helped me a lot as I couldn’t figure out the PLEG was still running even though I modified the schedule to where it shouldn’t be running.

If I have a schedule defined as “s1”. Just to confirm, in order to enforce the schedule, I need to reference s1 in the conditions. Correct?
Basically the PLEG will not automatically enforce a schedule by me adding a new one, correct?

A Schedule is an INPUT.

INPUTS do not ENFORCE anything!

INPUTS are used in conditions.

CONDITIONS define your automation logic.
CONDITIONS are evaluated when INPUTS change.

ACTIONS are fire when CONDITIONS are evaluated to TRUE.

Thanks for the Clarification Richard. It’s all clicking into place now. The “Do It Now” button was the big thing that helped. That along with the earlier posts that says to click on the status in PLEG to see a report of the current value of each condition and variable. Before seeing that post I tried tests with the schedule variable included in my conditional logic but it was failing because I didn’t hit “Do It Now” and had the incorrect value.

Wonderfully put together plugin! Thanks for the help.

Richard, I have the below scene basic taken from the PLEG Basics document.

I have it set to turn off my hallway motion light after 5 minutes.
My question is will the timer restart each time that motion is detected? For example, if after 3 minutes, the motion sensor is tripped again, is the 5 minute interval restarted?

Hallway Motion Sensor PLEG:

Name Description Actions
HallwayLightOn New Hallway Light is turned on
HallwayMotion New Hallway Motion Sensor is tripped

Name Type Random On Delay Off After Type Random Off Delay Actions
HallwayTimer Self Trigger None Interval:05:00 None

Conditions:
HallwayLightOn and !HallwayTimer and (HallwayLightOn; !HallwayTimer) and (!HallwayLightOn; HallwayLightOn > 5)

If the timer is SelfTrigger … it is timed from the First Event.
If the timer is SelfReTrigger … it is timed from the most recent event (i.e. it is restated)

[quote=“RichardTSchaefer, post:14, topic:185801”]If the timer is SelfTrigger … it is timed from the First Event.
If the timer is SelfReTrigger … it is timed from the most recent event (i.e. it is restated)[/quote]

Awesome, thanks Richard! I was wondering what that setting was for. Turning it to SelfReTrigger now!