Simple RGB light coordinator


#1

being completely new to this tool I’m just looking for an example piston that coordinates a group (2 in this case) of RGB bulbs to a master bulb. I’ve found pistons the can group switches but not coordinate color hue and level to a master bulb


#2

Something like this might work for you. It will end up with them all at the same color and level… however it’s not instant, it takes a little time for each bulb to set.

You could shorten that up and maybe speed it up a little and eliminate the variables and setting the variables. Just set the attributes straight away…

Like this:


#3

thanks! I’ll try them out and tweak them. should be a good exercise to be more self sufficient in writing my own.


#4

I started messing with this piston and it works momentarily. when an attribute of the main bulb changes the 2nd bulb coordinates. problem is that the 2nd bulb reverts back to it’s default state after a few seconds. I don’t have any others automatons or pistons managing either of these devices that I know of


#5

I use a slight variation of this… Basically, adding a 1 second delay so the “master” bulb has time to ‘settle down’ before sending the commands to the other devices.

Essentially, using this format:

temp

This is especially important if you are spinning a dial for brightness, because most dimmers are aware of 100 levels between 0 and 100. We only want the final level to be pushed to the other devices.
(ideally, the dial will have stopped spinning before the 1 second is up)


Also, with some bulbs (Philips Hue and a few others), the colors are matched better if you delete any lines relating to color, and just use Hue, Saturation, Level and Switch. For some reason, using “Set color” will never match on those bulbs.

This is how I restore HSL in one line:

temp


#6

Doh, never used the HSL line before. But that being said, any idea why OP light is reverting back? Logs might help @anon86179111


#7

Yes, looking thru the IDE’s log would be the most helpful. It usually shows what programming sent the command


#8

here’s a log of switching the main light to red. the 2nd light went to red for a second then went back to white.

12/29/2018, 10:40:25 PM +83ms
+2ms ╔Received event [Island Lights].hue = 97 with a delay of 63ms
+88ms ║RunTime Analysis CS > 20ms > PS > 51ms > PE > 18ms > CE
+91ms ║Runtime (39905 bytes) successfully initialized in 51ms (v0.3.109.20181207) (88ms)
+92ms ║╔Execution stage started
+105ms ║║Comparison (integer) 349 changes = true (1ms)
+107ms ║║Cancelling condition #18’s schedules…
+108ms ║║Condition #18 evaluated true (6ms)
+109ms ║║Cancelling condition #17’s schedules…
+110ms ║║Condition group #17 evaluated true (state changed) (10ms)
+113ms ║║Cancelling statement #6’s schedules…
+127ms ║║Executed virtual command [Island Lights].setVariable (4ms)
+136ms ║║Executed virtual command [Island Lights].setVariable (3ms)
+146ms ║║Executed virtual command [Island Lights].setVariable (3ms)
+157ms ║║Executed virtual command [Island Lights].setVariable (3ms)
+167ms ║║Executed virtual command [Island Lights].setVariable (3ms)
+171ms ║║Cancelling statement #12’s schedules…
+291ms ║║Executed physical command [island light north].setColor([[hex: #000000, hue:0, saturation:0, level:0]]) (112ms)
+292ms ║║Executed [island light north].setColor (116ms)
+319ms ║║Executed physical command [island light north].setHue([96]) (21ms)
+320ms ║║Executed [island light north].setHue (24ms)
+332ms ║║Skipped execution of physical command [island light north].setLevel([10]) because it would make no change to the device. (7ms)
+334ms ║║Executed [island light north].setLevel (9ms)
+356ms ║║Executed physical command [island light north].setSaturation([99]) (18ms)
+358ms ║║Executed [island light north].setSaturation (20ms)
+365ms ║║Skipped execution of physical command [island light north].on([]) because it would make no change to the device. (3ms)
+367ms ║║Executed virtual command [island light north].setSwitch (6ms)
+372ms ║╚Execution stage complete. (280ms)
+374ms ╚Event processed successfully (374ms)


#9

Try deleting the line of code that says:
Set color to {Color} (only while blah blah blah)

Detailed explanation above.


#10

You explained very briefly what you want to do, if you write me a detailed explanation, then I can help you though. It’s gonna be cool, man!