Grouping randomly changing lights


#1

1) Give a description of the problem
I want to create a disco/party mode with my three lights. I have them set to change randomly, but they are each changing randomly instead of together.

2) What is the expected behaviour?
I would like the to change in sync, where they all three change to a random new color together instead of individually.

3) What is happening/not happening?
The lights are changing randomly, individually.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full

+0ms â•”Received event [My home].time = 1587610566093 with a delay of 2025ms
+115ms â•‘RunTime Analysis CS > 61ms > PS > 7ms > PE > 48ms > CE
+118ms â•‘Runtime (37298 bytes) successfully initialized in 7ms (v0.3.110.20191009) (117ms)
+119ms â•‘â•”Execution stage started
+183ms â•‘â•‘Comparison (enum) on is (string) on = true (1ms)
+185ms â•‘â•‘Condition #4 evaluated true (7ms)
+186ms â•‘â•‘Condition group #3 evaluated true (state did not change) (8ms)
+188ms ║║Cancelling statement #5’s schedules…
+223ms â•‘â•‘Executed physical command [Ceiling 1].setColor([[hex: #F0FFFF, hue:50, saturation:100, level:97]]) (20ms)
+225ms â•‘â•‘Executed [Ceiling 1].setColor (28ms)
+239ms â•‘â•‘Executed physical command [Ceiling 2].setColor([[hex: #F08080, hue:0, saturation:79, level:72]]) (10ms)
+241ms â•‘â•‘Executed [Ceiling 2].setColor (12ms)
+275ms â•‘â•‘Executed physical command [Lamp].setColor([[hex: #FFC0CB, hue:97, saturation:100, level:88]]) (28ms)
+276ms â•‘â•‘Executed [Lamp].setColor (30ms)
+285ms â•‘â•‘Executed virtual command [Ceiling 1, Ceiling 2, Lamp].wait (0ms)
+287ms â•‘â•‘Waiting for 400ms
+694ms â•‘â•‘Comparison (enum) on is (string) on = true (1ms)
+695ms â•‘â•‘Condition #4 evaluated true (6ms)
+696ms â•‘â•‘Condition group #3 evaluated true (state did not change) (8ms)
+698ms ║║Cancelling statement #5’s schedules…
+714ms â•‘â•‘Executed physical command [Ceiling 1].setColor([[hex: #FF1493, hue:91, saturation:100, level:54]]) (8ms)
+715ms â•‘â•‘Executed [Ceiling 1].setColor (10ms)
+730ms â•‘â•‘Executed physical command [Ceiling 2].setColor([[hex: #DCDCDC, hue:0, saturation:0, level:86]]) (10ms)
+731ms â•‘â•‘Executed [Ceiling 2].setColor (12ms)
+743ms â•‘â•‘Executed physical command [Lamp].setColor([[hex: #00FF00, hue:33, saturation:100, level:50]]) (7ms)
+744ms â•‘â•‘Executed [Lamp].setColor (10ms)
+750ms â•‘â•‘Executed virtual command [Ceiling 1, Ceiling 2, Lamp].wait (0ms)
+750ms â•‘â•‘Waiting for 400ms
+1160ms â•‘â•‘Comparison (enum) on is (string) on = true (2ms)
+1163ms â•‘â•‘Condition #4 evaluated true (8ms)
+1164ms â•‘â•‘Condition group #3 evaluated true (state did not change) (11ms)
+1167ms ║║Cancelling statement #5’s schedules…
+1190ms â•‘â•‘Executed physical command [Ceiling 1].setColor([[hex: #9370DB, hue:72, saturation:60, level:65]]) (10ms)
+1191ms â•‘â•‘Executed [Ceiling 1].setColor (12ms)
+1205ms â•‘â•‘Executed physical command [Ceiling 2].setColor([[hex: #E0FFFF, hue:50, saturation:100, level:94]]) (9ms)
+1206ms â•‘â•‘Executed [Ceiling 2].setColor (12ms)
+1218ms â•‘â•‘Executed physical command [Lamp].setColor([[hex: #B22222, hue:0, saturation:68, level:42]]) (8ms)
+1219ms â•‘â•‘Executed [Lamp].setColor (9ms)
+1226ms â•‘â•‘Executed virtual command [Ceiling 1, Ceiling 2, Lamp].wait (0ms)
+1227ms â•‘â•‘Waiting for 400ms
+1636ms â•‘â•‘Comparison (enum) on is (string) on = true (2ms)
+1638ms â•‘â•‘Condition #4 evaluated true (8ms)
+1639ms â•‘â•‘Condition group #3 evaluated true (state did not change) (9ms)
+1641ms ║║Cancelling statement #5’s schedules…
+1660ms â•‘â•‘Executed physical command [Ceiling 1].setColor([[hex: #FFB6C1, hue:98, saturation:100, level:86]]) (9ms)
+1661ms â•‘â•‘Executed [Ceiling 1].setColor (11ms)
+1673ms â•‘â•‘Executed physical command [Ceiling 2].setColor([[hex: #FF6347, hue:3, saturation:100, level:64]]) (7ms)
+1674ms â•‘â•‘Executed [Ceiling 2].setColor (10ms)
+1686ms â•‘â•‘Executed physical command [Lamp].setColor([[hex: #ADFF2F, hue:23, saturation:100, level:59]]) (7ms)
+1687ms â•‘â•‘Executed [Lamp].setColor (9ms)
+1693ms â•‘â•‘Executed virtual command [Ceiling 1, Ceiling 2, Lamp].wait (1ms)
+1694ms â•‘â•‘Waiting for 400ms

#2

Try storing random color to variable first then set the lights to use the variable.


#3

That’s a good idea. How would I do that? I’m newer to coding.