Create a schedule with the following characteristics:
[tt]Name Type Time Days Random On Delay Off After Type Off Time Off Days Random Off Delay
s2 Weekly t 1,2,3,4,5,6,7 None Weekly 22:30:00 1,2,3,4,5,6,7 None[/tt]
Then create a condition with the following characteristics:
[tt]Name Expression
cDoSomething s2[/tt]
Finally add actions for condition cDoSomething (presumably turn on Piano Room Light).
Note: Refer to the attached screenshot for setting up the above described schedule.
This is illegal because Absolute times are allowed in sequence expressions but their format is HH:MM:SS
But the response from @BrianLBeaton is probably what you want. The expression you indicated, once corrected, would evaluate once per minute … And mostly be false.
Hi,
I have read several of the threads on how to use PLEG and decided to try it. I am trying to make my bedroom light turn on when the living room light is turned off between the hours of 10PM and 3AM. So far I have been unsuccessful. This morning I upgraded PLEG and PLC to V5.5 and decided I would give it another try but after trying for the last 2+ hours I decided that I would need to ask for some help.
I currently have the times set between 9AM and 10AM for testing. So far nothing happens. Please see the screen shots of the Report and Status reports.
At one point I did have my condition as: LightisOff AND MBRtimes but this didn’t work either.
Your settings look OK but the schedule has not fired yet. Either change the schedule to times in the near future and wait or use the DoItNow button to start the schedule manually.
It may be sensible to add PLEG ARMED/DISARMED status to the header or footer of your Report and Status functionality so that when people post their Status or Report to this forum, one can quickly exclude the unknown yet understandable question “Is your PLEG ARMED?”
Rex,
Thanks for the info. I did change the time for 13:00 to 14:00 and at 1pm, I just happened to be in the bedroom, and the light came one. The Living Room dimmer was off. I thought with the AND condition that both statements have to be true so I think I might be missing something.
I did do another test and turned the bedroom light off, went into the living room, turned the light on, then off and the bedroom light turned on. So it is partially working.
Richard,
Thanks. I did ARM the PLEG plugin. Funny you said it as the first day I was playing with it, I didn’t ARM it and read a post where it was suggested to someone else.
Your current logic says: If the Living Room light is off, and MBRtimes is true (the time is between start and stop times) then turn on the Bedroom light.
This condition will be evaluated when any of its terms change - the Living Room light is turned on or off or the schedule becomes true or false. If the condition evaluates as true and was previously false, the action will be executed.
In what sense do you think it is only partially working?
How do I kill a scenario once automatically triggered? I have a motion detector t1 which turns on a tuner in a given schedule. So the operative condition is “t1 and s1.” The only problem is if I decide to change the stereo input from tuner to Apple TV but then trigger the motion detector while still within the scheduled time, it changes the receiver input back to the tuner. I tried t1 and s1 and (s1; Now < 1:00) and that won’t work.
Rex,
I felt that it was partially working since it allowed the bedroom light to be turned on when the living room light was turned off between the acceptable time.
So, it seems that my logic needs to be : IF time is between the 10PM and 3AM AND the Living Room Light is changed from On to Off, then turn on the Bedroom light.
I am not sure how to detect when the status of the light turns from On to Off.
If the condition is called: StartAppleTV
You want:
StartAppleTV StartAppleTV; s1; t1
This will only fire once per Schedule.[/quote]
The condition c1 powers on the receiver and switches the main input to the tuner. I launch the condition with the anding of the schedule and the motion sensor tripped s1 and t1. I want to make it so once the conditions c1 yields true, the scenario no longer runs. This way, if I change the stereo to Apple TV to listen to a podcast after it comes on, it won’t go back to the tuner if I again trigger the motion within the scheduled timeframe.
[quote=“aboyer, post:572, topic:173496”]Rex,
I felt that it was partially working since it allowed the bedroom light to be turned on when the living room light was turned off between the acceptable time.
So, it seems that my logic needs to be : IF time is between the 10PM and 3AM AND the Living Room Light is changed from On to Off, then turn on the Bedroom light.
I am not sure how to detect when the status of the light turns from On to Off.
Thanks,
Antonio[/quote]
The condition:
TurnOnMBRlight MBRtimes and LightisOff and (MBRtimes; LightisOff)
will be true only if the living room light is off, the time is during MBRtimes and the living room light was turned off after the start of MBRtimes.
In my setup I have Philips Hue lights, and a doorlock. I want to achieve the following :
When turning off the lights and it’s dark outside, I want the door-lock to lock the door.
I did the following, which partially works (see attached image).
Only problem is that if the light is off and I unlock the door, the scripts will fire and lock the door again. This should only be true if the light is turned off (from on) - and not unlocking the door while light is off.
(MBRtimes; LightisOff) is a sequence expression. The parentheses are optional in this case. Sequence expressions are evaluated on the basis of the time when the terms last became true. It is irrelevant whether the terms are currently true or false.
In a sequence expression where the terms are separated by a semi-colon, the expression will be true if the terms are in the order of their last-became-true timestamps. So (MBRtimes; LightisOff) will be true if LightisOff became true after MBRtimes became true - otherwise it will be false.
PLEG’s sequence expression is a really useful feature. Not only can it help to differentiate events by the order in which they occurred, it can also include relative time limits.
I recommend reading Program Logic Core for more information on sequence expressions and other aspects of condition statements.