Flashing Lights with Two Colors

Hi All,

I have 4 Hue color lights and was wondering if anyone had any advice on how to have 4 lights flash on and off while alternating two colors? My idea is that when a goal is scored I could trigger a scene to do this.

Thanks for any advice.

There is no way I know of in OH to control all four perfectly synchronized. There will be a slight delay between each bulb.

To implement this, add all the bulbs to the same group. Then in a rule that gets triggered by the goal sendCommand the first color to the group, sleep for a sec, then send the next and so on.

Hi Rick,

Thanks for your time in this. I didn’t put them into groups yet but see below for the rule that is working as I want it to. I found that it would be neat to have them a bit more random while alternating two different colors. I’m sure this could be vastly improved upon but here’s what I’ve got to get it working.

rule "goal "
when
Item goal received command ON
then
Thread::sleep(5000)
var Number counter = null
counter=0
while(counter<10 && Scene_Lights.state==2)
{
counter=counter+1
LR_Lamp_Dimmer.sendCommand(100)
H_Strip_Dimmer.sendCommand(100)
KL_Dimmer.sendCommand(100)
KL_Top_Dimmer.sendCommand(100)
LR_Lamp_Color.sendCommand(“253.780219780219766789741697721183300018310546875,100,100”)
H_Strip_Color.sendCommand(“169.060439560439562001192825846374034881591796875,100,100”)
sendCommand(KL_Color, “253.780219780219766789741697721183300018310546875,99,100”)
sendCommand(KL_Top_Color, “123.05882,100.0,100.0”)
Thread::sleep((Math::random * 1000).intValue)
KL_Dimmer.sendCommand(0)
KL_Top_Dimmer.sendCommand(0)
LR_Lamp_Dimmer.sendCommand(0)
H_Strip_Dimmer.sendCommand(0)

Thread::sleep((Math::random * 1000).intValue)
	LR_Lamp_Dimmer.sendCommand(100)
	H_Strip_Dimmer.sendCommand(100)
	LR_Lamp_Color.sendCommand("169.060439560439562001192825846374034881591796875,100,100")
	H_Strip_Color.sendCommand("253.780219780219766789741697721183300018310546875,100,100")
	sendCommand(KL_Top_Color, "253.780219780219766789741697721183300018310546875,99,100")
	sendCommand(KL_Color, "123.05882,100.0,100.0")
Thread::sleep((Math::random * 1000).intValue)
	KL_Dimmer.sendCommand(0)
	KL_Top_Dimmer.sendCommand(0)
	LR_Lamp_Dimmer.sendCommand(0)
	H_Strip_Dimmer.sendCommand(0)

}
LR_Lamp_Color.sendCommand("253.780219780219766789741697721183300018310546875,100,100")
H_Strip_Color.sendCommand("169.060439560439562001192825846374034881591796875,100,100")
sendCommand(KL_Color, "253.780219780219766789741697721183300018310546875,99,100")
sendCommand(KL_Top_Color, "123.05882,100.0,100.0")
LR_Lamp_Dimmer.sendCommand(100)
	H_Strip_Dimmer.sendCommand(100)
	KL_Dimmer.sendCommand(100)
	KL_Top_Dimmer.sendCommand(100)

end