I have an if then statement to turn on this RGB strip under my bed when I turn on my smart switch in my room and I think I’d be kind of fun to have a random color when ever I do this, is this possible? If so, how?
What’s the brand and model of the light strip? If it’s a dumb strip, what’s the brand and model of the controller?
It is a govee one that I used this one method to add to the smartthings app and the trigger device is a Kasa smart dimmer switch that I connected normally to smartthings
I know a few options, but I hope someone else knows something better! But here are my first thoughts.
- I know how to do this IFTTT filter code (requires a paid subscription) because that has a random number generator. You create an array that is a list of colors, then use the random number generator to set the index to that array, then turn on the lights to the color it picked. See the last example on this page.
Pros: uses your existing devices, is pretty easy from a programming standpoint
Cons: if you aren’t already paying for IFTTT, that’s an added monthly cost, cloud based
-
I don’t know if the new rules API has a random number generator available or not. If it does, you should be able to do something similar to the IFTTT example, but free and local.
-
You could always write your own smartapp using the new architecture in any language that does have a random number generator, but that would be a lot of work.
So…I’m sure it’s doable, I just don’t know if the official rules engines support it. . Hopefully someone else will.