PLEG light timer help please

On UI5 Vera 3 I have this light set up and working. The sched is set now for test, but it will actually be set for sunrise/sunset time.

I want to end up with this light turning off/on randomly during the sched time to simulate a lived in look while I am away.

So what do I need to add (conditions,scheds) to repeat this light to turn on and off multiple times during the sched time? I would need random times of on/off.

At this point I am stuck duplicating this light’s actions throughout the night. I will actually use 4 lights total doing this same thing once I can get the 1 light working.

Thanks much…

Move this to the PLEG forum (sub-forum under Programming, then Plug-ins, then Program Logic Plugins) and you will get help there…

The Vacation Ghost plugin offers this functionality. I don’t know if it is still supported or if it works with UI7.

I believe Vacation Ghost has been taken down by the author.

Deus ex Machina plugin does this but may have a bug regarding turning lights off before midnight. That plugin seems to be abandoned but may still suit your needs if you set an initial turn off time of 00:01.

I have tried both defunct plugins DeusX, VG. Neither worked very well so I want to use PLEG. I only have 4 lights I need to control.

A PLEG “interval” schedule has the Random On Delay and Random Off Delay features. So in theory you could build a two hour interval timer, and add something like a 30 minute on + off delay… ?

@Wilme2,
I too am interested in a VG replacement, I’ve asked in another thread as @bucko to have a PLEG that would perform much the same as VG did for X lights with no response. For the PLEG newbie’s ::slight_smile: could provide a PLEG example as to how we could create this for X lights? thanxs in advance, Mike

All in all it seems odd to me that vera users in here do not consider a vacation function to be an important part of an automated home. In fact, this function should have been built into Vera itself from the onset. I have studied threads back to 2010, and no one has actually solved this function.
Vacation Ghost never was the best attempt, but it never worked with any stability. I spent months playing with this plugin only to find it unreliable at best. Only a limited few actually claimed it was working. DeusEx never came close to working, and was full of bugs, including messing up other Vera functions and plugins.

Along comes PLEG which seems like the perfect answer to accomplish this, but once again, no one has actually made (or claimed) to have set this up to work. I am so surprised this issue was not put to bed a long time ago. It should actually be part of Richard’s examples in his PLEG manual!

My attempt at it is really worthless and took too many conditions, actions just for a single light. I think my idea is sound in the sense of creating a PLEG instance to use just for this “vacation” mode. My PLEG for normal lighting control is set to disarm whenever my alarm is armed in “away or vacation” mode, and also arm my PLEG vacation plug in.

I am sure a good PLEG wiz would be able to provide an example of a sched, condition(s), action that could accomplish this. It’s just curious to me that ant of these people do not have any interest in this feature.

I’m currently doing this now. Simply a virtual switch labeled “vacation”. When I have it on it activated a PLEG controlling the lights. On at sunset and off at 2300 with a 30 min random off time.
Not complex, but good enough for my needs. Sometimes I think we overcomplicste things… Simply because we can.

[quote=“RHINESEL, post:9, topic:188288”]I’m currently doing this now. Simply a virtual switch labeled “vacation”. When I have it on it activated a PLEG controlling the lights. On at sunset and off at 2300 with a 30 min random off time.
Not complex, but good enough for my needs. Sometimes I think we overcomplicste things… Simply because we can.[/quote]

I agree 100%.

I have no trouble with the activation of the PLEG. In fact not even using a virtual switch. Instead I would have it activate via the state of my alarm panel. Either way, could you share the PLEG report how you set up your sched and conditions to have the light cycle on/off at random. This is the part I cannot get to work. My lights only cycle one time during the sched on/off time.

I assume you are using a sched to set the duration of the event and then a timer for the random bit. This is where I am lost.

I’m mobile for a bit so I’ll just type it but I didn’t use timers at all.

Properties:
pVacationSwitch- Status

Schedues:
sSunsetTo2300RandomOff- Day of week, interval, start time Sunset, end time 2300 random of 30 minutes

Conditions:
cVacationLightsOn- pVacationSwitch==1 AND sSunsetTo2300RandomOff
cVacationLightsOff- pVacationSwitch==1 AND !sSunsetTo2300RandomOff

Actions:
cVacationLightsOn- Select the on command for the lights you want on
cVacationLightsOff- Select the off command for the lights you want off

Note: This is an all-or-nothing. I’m not setting up individual lights to cycle on and off like a “ghost”.

Many of us use the term “timer” interchangeably with “schedule”. I believe an earlier version of PLEG labeled what are now schedules as timers… - And if you start a schedule as part of a PLEG action, you use the advanced actions StartTimer or ToggleTimer…

@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

@RHINSEL

Thank you for the example. I will give it a test.
Did you set your conditions as a repeat?

@MNB

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)

Actions:
cVacationLights1On- Turn LightsOn
cVacationLights1Off- Turn LightsOff

@wilme2

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).

Thanks for giving this more thought and posting!

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…

Oops that’s right …
Change to:

cVacationLights1- pVacationSwitch==1 AND sSunsetTo2300 and sRandomOnOff ? 1 : 0

Action:
newTargetValue: {(cVacationLights1)}

When the Condition holds a value … it fires when ever the value changes.

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules