Random Number Feature

Further to the recent addition of the excellent random timer function. Can I also request the ability to use a random number in automations.

My use case here is to be able to select a group of different lights (X) and have a random number of them (Y) turning on/off randomly during the night to simulate someone being at home. The randomisation would need to be restricted at the lower and upper ends such that out of 10 lights you have between 2 and 5 (for example) coming on randomly.

However I’m sure there’s plenty of other with ideas that would benefit from randomisation :slight_smile:

Hi Ian - thanks for posting and sharing your example! Random numbers are available in rules using expressions. The General Functions in Rule Expressions article documents some of the functions that can be used in expressions including random(0, 10) and pickRandom([10, 20, 30]).

It sounds like what you’re looking for is the ability to perform an action on a random subset of devices. Perhaps the title of the thread could be updated accordingly to ensure the request gets the proper attention it deserves? Otherwise I fear people would interpret ‘Random Number Feature’ to cover the existing expression features mentioned above?

That being said, I suspect that one of the following feature requests could be an alternative way to accomplish issuing actions against a random subset of devices if those requests get enough votes to get implemented: