@Rhinesel,
Understand your note but… if we wanted a few zones to cycle on/off at different random times I would assume that we do something like this using your code?;
Properties:
pVacationSwitch- Status
Schedues:
sSunsetTo2300RandomOff1- Day of week, interval, start time Sunset, end time 2300 random of 30 minutes
sSunsetTo2300RandomOff2- Day of week, interval, start time Sunset, end time 2300 random of 30 minutes
Conditions:
cVacationLights1On- pVacationSwitch==1 AND sSunsetTo2300RandomOff1
cVacationLights1Off- pVacationSwitch==1 AND !sSunsetTo2300RandomOff1
cVacationLights2On- pVacationSwitch==1 AND sSunsetTo2300RandomOff2
cVacationLights2Off- pVacationSwitch==1 AND !sSunsetTo2300RandomOff2
Actions:
cVacationLights1On- Select the on command for the lights you want on
cVacationLights1Off- Select the off command for the lights you want off
cVacationLights2On- Select the on command for the lights you want on
cVacationLights2Off- Select the off command for the lights you want off
Thanks for the addition. I figured that out for additional lights. In fact I would use your example and control 2 lights each for a total of 4 lights.
Right now I am testing 1 light.
If all goes well I well then I will use my DayorNight plugin as the trigger instead of a virtual switch.
Thought about this last night - I think the way to set this up would be to have two schedules - one for the time of day you want it to run (sunset to 23:00 for example), and then a second timer as interval with a random delay on the on and off. I didn’t test this, but it should work nice- you might need to alter the interval time…
Properties:
pVacationSwitch- Status
Schedues:
sSunsetTo2300- Start type Day of week, start time Sunset, End Type Day of Week, end time 2300
sRandomOnOff- Start Type Interval, every 30 minutes, random on delay 10 minutes, End Type Interval, random off delay 10 minutes
Conditions:
cVacationLights1On- LightsOff and pVacationSwitch==1 AND sSunsetTo2300 and sRandomOnOff
cVacationLights1Off- LightsOn and pVacationSwitch==1 AND (!sSunsetTo2300 or !sRandomOnOff)
Looking over your new setup, I think you have it nailed. I am going to set it up and see how it goes. This is more what I was after- to have the lights on AND off during a sched duration. The other examples do a one time cycle of the light (on to off).
Add a little more to the variety:
sSunsetTo2300- Start type Day of week, start time- 15 Minutes before sunset with 54 Minute random On time
End Type Day of Week, end time 22:30 with 1 hour Random Off time.
You can eliminate one of the conditions:
Conditions:
cVacationLights1- pVacationSwitch==1 AND sSunsetTo2300 and sRandomOnOff
Actions:
cVacationLights1- Using the Advanced tab …
Select Light Device
Action: SetTarget
newTargetValue: {(cVacationLights1 ? 1 : 0)}
[quote=“RichardTSchaefer, post:18, topic:188288”]You can eliminate one of the conditions:
Conditions:
cVacationLights1- pVacationSwitch==1 AND sSunsetTo2300 and sRandomOnOff
Actions:
cVacationLights1- Using the Advanced tab …
Select Light Device
Action: SetTarget
newTargetValue: {(cVacationLights1 ? 1 : 0)}[/quote]
I thought an action for a condition can only fire when the condition is true? I like the simplification (likely overkill unless you have a lot of automated lights as I do) as it will speed up processing, but I don’t see how the off works…
would it not be better to use use them? and if so how would one use them with this PLEG example, I assume it would no longer be a device property but rather a My Modes > Vacation with a unique name? Mike
I have it working fine. Been testing all day and it is doing fine. So disregard my previous post.
Thank you all for helping me out with this. I think you should include the as an example in your PLEG docs. A lot of people would benefit from this function.
If you want to use MCV modes … you PLEG allows you.
I do not plan on using Vera Modes …
For me I can have
Vacataion, and Vaction + Night, Away, and Away + Night, Home, Home + Night
Alright Richard,
I’m being a little thick… ::), Instead of using the Vera Mode your using virtual switches or are these PLEG inputs for each of you modes?
Richard,
Thanxs for clarification, I’m assuming that when your on Vacation that you select both; Vacation and Vacation + Night? I would have thought that Vacation + Night could have been solved within a condition statement using Day/Night as an Input, obviously I’m missing something?
The reason I’m asking fundamental questions is that for the novices of us not all things are totally clear (I’m not always seeing the blonde amongst the one’s & Zero’s - Matrix) any help from you is greatly appreciate and helps us make a better HA solution. That’s why I will ask others to post their latest PLEG solutions as they are great working examples/resources to used and modified. Mike
I downloaded DeusExMachina from the official VERA app store, but I’m pretty sure it screwed up my PLEGs. They all came up empty with the error message “ says Error Reading Data”. I restored a backup taken shortly before I installed Deus and the PLEGs came back to normal.
Please accept my apologies for maligning Dues incorrectly, it was just one of life’s unfortunate co-incidences that it happened immediately after I installed your plugin (or maybe the downloading of any app triggered the update of another app?)