Color-changing across three LIFX bulbs
-
Three LIFX outdoor bulbs, call them #1, #2, #3.
The goal is to have the following outcome:
#1, color A
#2, color B
#3, color C
after 00:00:10, hard shift:
#1, color B
#2, color C
#3, color A
after 00:00:10, hard shift:
#1, color C
#2, color A
#3, color B
after 00:00:10, hard shift:
#1, color A
#2, color B
#3, color CVisual being that the colors essentially move in a single direction across the house all night long.
I thought maybe cannibalizing Reactor Ex Machina until I realized I'm shifting COLORS, not ENTITIES.
Thoughts, anyone?
-
ok set a expression named rotated with value of ["a","b","c"] then set the expression to blank, the last value should be ["a","b","c"]
Then you use the expression variable to set your there colour lamps. the last reaction in the rule should be to set the expression variable to ${{push(rotated,shift(rotated))}} which will rotate the last value of the expression variable, removing the first value and placing it on the end. -
["a","b","c"] would hold the value of the colour setting. I do not own any lifx lamps, so do not know the value you would send. But a,b,c could be hex colour values or rgb colour array etc.
${{rotated[0]}} would be the colur of first lamp. ${{rotated[1]}} would be second etc
What does Lifx lamps require to be sent to change colour?
-
[[255,0,0],[0,255,0],[0,0,255]]
would be the initial array to set a starting value, instead of ["a","b","c"]
So red, green, blue for the 3 lights.
Then in light 1
red would be${{rotated[0][0]}}
green would be${{rotated[0][1]}}
blue would be${{rotated[0][2]}}
For light 2 set the first index to [1] and for 3rd light to [2].This would work for nth number of lights, you would just add an array element for each light.
[edited for corrections]
-
T toggledbits locked this topic on