Toggle Lights hourly

Hi, Just got my VERA setup a few days ago and now I’m trying to expand what I’m doing with them. One thing I wanted to do was have a set of lights go on for 5 minutes then off ever hour between 10pm and 4 am. In general where would I start with such a goal?

From a MCV perspective this is a COMPLEX scene requiring you to use LUA.
The reason … you have complex Conditions … Hourly interval between Certain times.

There are multiple ways to do this. One way:

  1. Create a Scene
  2. Add and Hourly timer.
  3. In the LUA code for the Scene if the time is between 10:00 PM and 4:00 A.M.
    return true else return false
  4. When you return false from step 3 the actions of the Scene will not fire.
    Create Immediate action for Scene to turn on Lights.
    Create a delayed schedule for 5 Minutes … Here you can turn off the lights.

NOTE: if your Vera restarts during the 5 minute period after 4:00 A.M. the lights will stay on all day. Vera does not handle the delayed actions of a scene if a restart happens!

For a better approach see:,13802.0.html

Thanks, I’ve been poking around with the PLEG plug-in - very cool stuff. I’m seeing now that there are always a few ways to accomplish things between the plug-ins and using the LUUP code. I’ll keep experimenting; really appreciate the support to help me get started in the right direction.

fsa317, I do need to run exactly same automation. Could you please share how have you implemented with PLEG? Thanks in advance

If you are looking to have lights come on to simulate that someone is home when they are not, there are some apps that do this.

I use “Deus Ex Machina”, which randomly turns lights on and off while we are away.

Thanks JoeTomasone, but I do need exactly same automation: lights go on for 5 minutes then off every hour between 7am and 11pm (no random)

In PLEG this can be done as follows:

Create TWO input Schedules:
Hourly Interval Schedule … ON with an interval of 1:00:00 OFF with an interval of 5:00
DailySchedule ON Mon-Sun at 7:00:00 OFF Mon-Sun at 23:00:00

Two conditions:
LightOn Hourly AND DailySchedule
LightOff NOT LightOn

And of course the Actions would be:
LightOn Turn on light(s)
LightOff Turn off light(s)

You may need more logic if this needs to some how interact with a manual schedule (i.e. if the light was already on … should it be turned off ?)

Thank you very much RichardTSchaefer!