How often does the variable $randomLevel change?
It does not change per se. It’s a new random value every time you request it.
And how do I request it?
I am comparing the variable for a random light automation. So
If $randomLevel is less then 50 turn lights A.
If $randomLevel is greater or equal to 50 turn lights B.
Will that comparison cause a value change?
yes, each will get a new value. use:
if $randomLevel is less than 50 then turn on a else turn on b end if;
or store the random value into a variable first and use the variable - though the if then else is the better, more efficient way
Thanks for the information!
Here is the ultimate random light setup… triggered every 30 minutes whilst alarm is on, it randomly waits 1-29 minutes for each light in the list individually, and then performs a random toggle.
With this will only one bulb be on at a time?
Completely random, any of the selected devices can be on or off at any time.
Thanks, one other question, if device is on at end of time restriction, how does it get switched off, I assume you dont want a light left on all night? Do you have another piston to switch everything off?
Yep, another piston turns everything off at bedtime, but only if the alarm is still armed.