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.
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.
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.
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).
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:
Set a time frame (specific or from sunset to sunrise, b.e. from 20:00 to 01:00)
Set a time cycle (every X minutes, b.e 60 minutes)
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)
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.
Hi friends, I had found this old post and I would like to update. For users in Smartthings, there is an Smart App named Random Lights on-off. That creates a switch, also you can set for which devices and timing that randomly ON-OFF. Its enough for a vacation, I had used it by a year and it works sharply, I will cancel my vote on this feature because the need its solved. I hope this can help everybody.
I too am in the same predicament with the impending withdrawal of webcore support and also have been.using a randomised lighting piston for a number of years now. I’m looking at Sharp Tools as a replacement for Webcore but I’ve hit my first stumbling block with the lack of a randomiser - hence another vote from me.
Thanks for posting, Ian. Can you share more details about where you would use the random number within your randomized lighting rule? Would you want to use it in the Wait/Delay command or somewhere else?
Using the /math endpoint on our Lab Server, you can pass in a formula of randomInt(max) to get a random number back. I suspect the next key part of this is extending the Delay action to accept a variable.
Thanks for the quick response. The way this works for me in webcore is that a random number of lights (between user defined min/max values) turn on randomly for a random period of time (again between a min/max value).
I hope this helps and thanks again for your interest in my feature request.
Make sure to scroll up and cast a vote at the top of the post!
I would also note that this particular request is for being able to use random numbers on the time side of things (eg. using a random number in a delay).
Ian also mentioned a random number of lights (random selection of lights?) which is not covered by the original feature request and I’m not sure if I’ve seen a separate feature request submitted for that before. Feel free to create a request if one doesn’t already exist.
The use case for a random time in the Rule engine which would be the most beneficial to me would be where instead of turning on random lights it would follow my family’s normal habits when we are away. For us when I think about it we tend to have events that happen within a range of times. For example, we start eating dinner between 5:45-6:15 and finish roughly 30-45min later. We put kids to bed around 7:30-8pm. My wife and I go to bed between 10:30-11:30 etc. All of those habits have fairly predictable lighting patterns depending on the activity. And also there’s a couple different automations which we would run during those events. So to be able to use a “random time” within the between time condition of a flow to turn on a specific device or the ability to select multiple devices or automations would be great. This way, because we are creatures of habit, the automations would mimic those habits, but have some randomization so it’s not the same every time.
In the interim of full support for this, it would be wonderful if Delay could take a variable. That way you could send in a variable and random seed yourself, or via the Math Endpoint. No you have to do an extremely ugly if statement.