Random lights during set time period

I am trying to set some lights to "look" random for when we are away. I can build the actions but I can't seem to get the trigger right. This is logic of what I am trying to do.

  1. Rule only runs between sunset and 10pm
  2. Once triggered, the rule waits for a random delay (between 0 and 30 mins).
  3. The lights then turn on for a random time between 0 and 30 mins.
  4. Lights turn off.
  5. If it is still between sunset and 10pm, then repeat.

I am sure that this is simple, but I can't seem to crack it!

Thanks in advance.

There's an app called Vacation Lighting Director that might meet your needs.

If you want to try RM this may serve as a start, though I am not sure the random repeat will work the way I intend. It will the first time through the rule but after that I don't know what will happen if you change the random_repeat variable in the middle of the repeat block. Will it use the value of random_repeat at the time the "while" loop started the current iteration (which is my intent) or will it evalute it again at the end of the repeat iteration, thus making even more random than I intended.

1 Like