Random Number / Random Time in Rule Engine

Hello! I there a “random number” that i can use on the rule engine to program some sort of “away lights”?

I want some chosen lights to turn on and off at random times when im not home. If the random number is from 0 to 9 it is ok with me, becase i can add a 15 plus that random number and i have a perfect time.


Hi @An_Dres, random time trigger is not currently supported, but sounds like a great idea to be added to my list. Other than random time trigger, do you need something like “random” duration to turn the lights off? This sounds to be a great feature but I need to think about the design how users can create “away light” automation easily but with some flexibility. But thanks for the great suggestion.


Thanks for your quick response James! Yes, i need the random trigger only for my away lights…

My away lights would be:

Turn light 1, light 2 and light 3.
2 at a time
For a random number between 10 and 25 minutes.

1 Like

I would also be interested in being able to turn lights on/off randomly. I envision this as being a random offset of sunset/sunrise. This is what I am currently doing with WebCore as a vacation/away crime deterrent.

@Steve_Jackson, thanks for the inputs on random offset of sunset/sunrise. I will need to include that in the design. :wink:

1 Like

I would also find this very useful. I was able to create the rule in sharptools but am missing the random turn offs… I am more than happy to share my rules and webore pistons if it would help.

1 Like

@Terri, it’d be great if you can share your setup and describe the use cases to help give more context about this feature request.

I currently use webcore to randomize my lights cycling on/off at random ti.es between 5-29 minutes when I’m away at night. I like using randomized times vs set intervals because it is more reflective of someone being home. Also, if you are away for an extended period, it is easy to catch on to set intervals and know Noone is home.
Here is my current webcore piston. Is it quite complex and uses variables. I am aware it could be simplified! Actually I did simplify it nicely in the rule engine EXCEPT the lack of randomized times which is why I’m still using webcore (until ST ends groovy).

1 Like

Hi friends, I think that could be a great feature, because the only SmartApp I had found is Vacation Light Director but is not total “random”, only for picking up which lights turns on, but after that the only function is turn them on/off to a predefined time in a cycle. I think a great function could be about:

  1. Set a time frame (specific or from sunset to sunrise, b.e. from 20:00 to 01:00)
  2. Set a time cycle (every X minutes, b.e 60 minutes)
  3. For each cycle, pickup a random light(s) from a group of devices to turn it/them on (b.e 2 random lights from a group of 10)
  4. For each device pickup random time between a min-max to keep each light on (b.e. random time between 10-30 minutes)

So random feature could be:

  • To pick a random device from a group of devices.
  • To set a random time delay between a time frame after random devices were switched on.

The rest of cycle could be programmed as usual in an IF bucle.