Perhaps I’m overthinking this rule.

So I want a light to turn on and turn a random color and provided the condition is true then randomize the color of the light every 30 seconds....

One problem I see is how do you stop it once you start it. It's easy to get it started, But, suppose you have a condition, when true it starts this thing, and when it's false, it stops it.

The true action is to turn on and set a random color, and to run an Action. Call that Action-1. Action-1 delays by 30 seconds, then sets a random color and runs another Action, called Action-2. Action-2 delays by 30 seconds and then sets a random color and runs Action-1. So that's going to keep bouncing between those two every 30 seconds.

To stop it, we want each of those actions to have the restriction to disable with Private Boolean. Private Boolean starts out true, which is enabled. The false side of the original rule sets the Private Boolean of both Action-1 and Action-2 to false, thus stopping the 30 second cycle. It also turns off the light (or whatever). This points to the final need of this setup, and that is for the true side of that rule to set the Private Boolean of both Actions to true, so they can run again.

Here is an example of Action-1, with setting the light.

2 Likes

Am I on the right track?

Also, if I created the Random Color actions... can I use them for other actions randomizing colors of other lights with triggers?

Yes. However, you don't want the Dim Master Shower light to 100 in Random 2.

Thank you.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.