How to create a complex automation to rotate through colors for specific time periods?

I can think of a couple ways to do it, but all are clunky, so hopefully someone will know of a better method. Maybe with the new rules API? I don’t know very much about that.

Anyway, for what it’s worth…

  1. as @JimB71 mentioned, you could daisychain multiple routines together. One routine for each color change. Probably the easiest way to do this would be with Virtual Switches.

Routine a: if button is pressed, turn light on white. Wait one minute, then turn on virtual switch A.

Routine b: if virtual switch a turns on, turn light on green and turn virtual switch an off. (Or you could use a momentary device for virtual switch a. In any case, we want it to turn off again, so that it will be available the next time the button is pressed) wait seven minutes and turn virtual switch b on.

Routine C: if virtual switch B turns on, turn light on yellow, and turn virtual switch b off. Wait one minute and turn virtual switch C on.

Routine D: if virtual switch, C turns on, turn light on red and turn the virtual switch C off. Wait one minute, then activate a scene that fades the light to off.

So…clunky, but should work. And this method has the advantage of being local and entirely within the smartthings ecosystem.

  1. for a somewhat more elegant solution, but cloudbased and requiring multiple ecosystems, create the entire sequence as a “scene playlist“ created in the hue app.

That should work just fine, but the problem is that at present, there’s no way to activate a hue formula from hue labs in SmartThings.

But… you can activate it from Alexa. So you could use an Alexa routine (not a SmartThings routine) to activate the scene playlist. And you would need a virtual device as the if in that routine. And a routine on the smartthings side to actuate that virtual device, so that the Alexa routine would trigger.

Clunky, but doable.

  1. Of course, yet another option would be to just use the Hue scene playlist and add a new physical button in the bathroom that could activate the scene playlist via the hue bridge.

Here’s one example, but there are others.

There is a community-created edge driver that does expose some of the hue compatible buttons to Smartthings now, so you can use those models with both platforms if you want to.

[ST Edge] Philips Hue LAN [BETA]

Like I said, I hope there’s a simpler way than all of these and that someone else will post it. But at least you can get to the desired outcome with one of these methods. :tumbler_glass: