Issues with grabbing color of two RGB light strip


#1

1) Give a description of the problem
I want my Ring Doorbell when motion is detected to turn on two RGB light strips to a temp of
2700. webCore is to grab the current state of the light to return back after motion is finished.

2) What is the expected behaviour?
Expected behavior is for webCore to capture the current status of the light. If it’s on, what color, etc and to return back to the state after 30 seconds of motion ended.

3) What is happening/not happening?
What is working is if the light is off, Ring doorbell detects motion, light turns on to temp 2700 and after 30 seconds, lights go off. Works perfect!

What is not working is if I have the lights set to blue, motion detected - the lights change to temp 2700. After 30 seconds, the light strips turn to two random colors. I want the light strip to go back to blue.

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

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

|+2ms|╔Received event [Home].time = 1591833023340 with a delay of 91ms|
| --- | --- |
|+2295ms|║RunTime Analysis CS &gt; 2051ms &gt; PS &gt; 185ms &gt; PE &gt; 60ms &gt; CE|
|+2298ms|║Runtime (42858 bytes) successfully initialized in 185ms (v0.2.101.20171227) (2292ms)|
|+2299ms|║╔Execution stage started|
|+2346ms|║║Cancelling condition #5's schedules...|
|+2348ms|║║Cancelling condition #5's schedules...|
|+2370ms|║║Cancelling condition #9's schedules...|
|+2371ms|║║Condition #9 evaluated true (2ms)|
|+2373ms|║║Cancelling condition #8's schedules...|
|+2373ms|║║Condition group #8 evaluated true (state changed) (5ms)|
|+2376ms|║║Cancelling statement #10's schedules...|
|+2417ms|║║Restoring attribute 'color' to value '' using command setColor()|
|+4143ms|║║Executed physical command [Porch 1].setColor([]) (1725ms)|
|+4153ms|║║Restoring attribute 'colorTemperature' to value '2703' using command setColorTemperature(2703)|
|+4184ms|║║Executed physical command [Porch 1].setColorTemperature([2703]) (29ms)|
|+4199ms|║║Restoring attribute 'hue' to value '65.0' using command setHue(65.0)|
|+4231ms|║║Executed physical command [Porch 1].setHue([65.0]) (31ms)|
|+4242ms|║║Restoring attribute 'level' to value '100' using command setLevel(100)|
|+4249ms|║║Skipped execution of physical command [Porch 1].setLevel([100]) because it would make no change to the device. (6ms)|
|+4259ms|║║Restoring attribute 'saturation' to value '99.21568' using command setSaturation(99.21568)|
|+4304ms|║║Executed physical command [Porch 1].setSaturation([99.21568]) (44ms)|
|+4308ms|║║Restoring attribute 'switch' to value 'on' using command on()|
|+4311ms|║║Skipped execution of physical command [Porch 1].on([]) because it would make no change to the device. (2ms)|
|+4312ms|║║Executed virtual command [Porch 1].loadStateGlobally (1906ms)|
|+4324ms|║║Restoring attribute 'color' to value '' using command setColor()|
|+4346ms|║║Executed physical command [Porch 2].setColor([]) (20ms)|
|+4356ms|║║Restoring attribute 'colorTemperature' to value '2725' using command setColorTemperature(2725)|
|+4385ms|║║Executed physical command [Porch 2].setColorTemperature([2725]) (28ms)|
|+4395ms|║║Restoring attribute 'hue' to value '353.0' using command setHue(353.0)|
|+4425ms|║║Executed physical command [Porch 2].setHue([353.0]) (29ms)|
|+4435ms|║║Restoring attribute 'level' to value '100' using command setLevel(100)|
|+4442ms|║║Skipped execution of physical command [Porch 2].setLevel([100]) because it would make no change to the device. (5ms)|
|+4452ms|║║Restoring attribute 'saturation' to value '99.21568' using command setSaturation(99.21568)|
|+4497ms|║║Executed physical command [Porch 2].setSaturation([99.21568]) (44ms)|
|+4500ms|║║Restoring attribute 'switch' to value 'on' using command on()|
|+4503ms|║║Skipped execution of physical command [Porch 2].on([]) because it would make no change to the device. (2ms)|
|+4504ms|║║Executed virtual command [Porch 2].loadStateGlobally (191ms)|
|+4528ms|║╚Execution stage complete. (2229ms)|
|+4530ms|╚Event processed successfully (4529ms)|
|6/10/2020, 7:49:53 PM +71ms|
|+1ms|╔Received event [Front Door Ring].motion = inactive with a delay of 49ms|
|+193ms|║RunTime Analysis CS &gt; 17ms &gt; PS &gt; 146ms &gt; PE &gt; 30ms &gt; CE|
|+196ms|║Runtime (42859 bytes) successfully initialized in 146ms (v0.2.101.20171227) (193ms)|
|+197ms|║╔Execution stage started|
|+238ms|║║Comparison (time) 71393272 is_between (datetime) 1591837260000 .. (datetime) 1591783380000 = true (9ms)|
|+239ms|║║Time restriction check passed|
|+241ms|║║Condition #14 evaluated true (40ms)|
|+242ms|║║Condition group #5 evaluated true (state did not change) (42ms)|
|+246ms|║║Comparison (enum) inactive changes_to (string) active = false (1ms)|
|+248ms|║║Cancelling condition #6's schedules...|
|+249ms|║║Condition #6 evaluated false (6ms)|
|+250ms|║║Cancelling condition #5's schedules...|
|+251ms|║║Condition group #5 evaluated false (state changed) (7ms)|
|+258ms|║║Comparison (enum) inactive stays (string) inactive = true (3ms)|
|+268ms|║║Adding a timed trigger schedule for condition 9|
|+272ms|║║Condition #9 evaluated false (19ms)|
|+273ms|║║Condition group #8 evaluated false (state did not change) (20ms)|
|+282ms|║╚Execution stage complete. (86ms)|
|+284ms|║Setting up scheduled job for Wed, Jun 10 2020 @ 7:50:23 PM EDT (in 29.986s)|
|+292ms|╚Event processed successfully (291ms)|
|6/10/2020, 7:49:14 PM +221ms|
|+2ms|╔Received event [Front Door Ring].motion = active with a delay of 1105ms|
|+1138ms|║RunTime Analysis CS &gt; 940ms &gt; PS &gt; 157ms &gt; PE &gt; 42ms &gt; CE|
|+1141ms|║Runtime (42853 bytes) successfully initialized in 157ms (v0.2.101.20171227) (1137ms)|
|+1142ms|║╔Execution stage started|
|+1183ms|║║Comparison (time) 71355370 is_between (datetime) 1591837260000 .. (datetime) 1591783380000 = true (7ms)|
|+1185ms|║║Time restriction check passed|
|+1187ms|║║Condition #14 evaluated true (39ms)|
|+1188ms|║║Cancelling condition #5's schedules...|
|+1189ms|║║Condition group #5 evaluated true (state changed) (41ms)|
|+1195ms|║║Comparison (enum) active changes_to (string) active = true (1ms)|
|+1196ms|║║Cancelling condition #6's schedules...|
|+1197ms|║║Condition #6 evaluated true (6ms)|
|+1198ms|║║Condition group #5 evaluated true (state did not change) (7ms)|
|+1200ms|║║Cancelling statement #7's schedules...|
|+1241ms|║║Executed virtual command [Porch 1].saveStateGlobally (14ms)|
|+1255ms|║║Executed virtual command [Porch 2].saveStateGlobally (12ms)|
|+1268ms|║║Skipped execution of physical command [Porch 1].setLevel([100]) because it would make no change to the device. (7ms)|
|+1269ms|║║Executed virtual command [Porch 1].adjustLevel (11ms)|
|+1277ms|║║Skipped execution of physical command [Porch 2].setLevel([100]) because it would make no change to the device. (5ms)|
|+1278ms|║║Executed virtual command [Porch 2].adjustLevel (8ms)|
|+1443ms|║║Executed physical command [Porch 1].temp2700() (163ms)|
|+1444ms|║║Executed [Porch 1].temp2700 (165ms)|
|+1475ms|║║Executed physical command [Porch 2].temp2700() (29ms)|
|+1476ms|║║Executed [Porch 2].temp2700 (30ms)|
|+1484ms|║║Comparison (enum) active stays (string) inactive = false (3ms)|
|+1486ms|║║Cancelling any timed trigger schedules for condition 9|
|+1487ms|║║Cancelling statement #9's schedules...|
|+1488ms|║║Cancelling condition #9's schedules...|
|+1489ms|║║Condition #9 evaluated false (10ms)|
|+1490ms|║║Cancelling condition #8's schedules...|
|+1490ms|║║Condition group #8 evaluated false (state changed) (12ms)|
|+1507ms|║╚Execution stage complete. (365ms)|
|+1508ms|╚Event processed successfully (1508ms)|

#2

It’s weird but, with many bulbs, capture/restore using color or colorTemp will not match up properly.

I recommend trying capturing and restoring color using only Hue, Saturation and Level.
(although in your case, you also need to capture switch)


#3

I tried removing the two color options and no luck. I also tried again with removing the switch option and no dice. Also removed color coordinator under SmartApps automation and still didn’t work. Appreciate your help tho!


#4

Didn’t work at all, or didn’t quite match the previous color?


#5

I would say not match colors. If the lights were off, they would return back to the state off after motion. If I had lights set as blue, once motion ended, one strip would go to white and another pinkish. These light strips are Sylvania RGB if that makes a difference?


#6

OK cool… (trying to determine which works best for your brand)
Can you try an alternative version of my earlier statement?

IE: Only capture and restore Color, Level & Switch? (ignoring colorTemp, hue, saturation)

If that also fails, then I may:
Only capture and restore colorTemp, Level & Switch? (ignoring color, hue and saturation)


Edit:

From what I have seen, each brand & model number will internally refer to one of the three.
(HSL… or color… or colorTemp)

Once you know how that bulb “sees itself”, then it is easy to return to that state later.


#7

On a different topic, it is also worth testing using local variables instead of a global…
(Just to remove extraneous elements from your test)

I would probably take a close note of the variables both before and after each test…
(To see what is happening behind the scenes)


One more element to consider:

If the two RGB bulbs are different at all (in brand or model #) then I would not group them, or try to store their data in the same variable.

Just my two cents…


#8

Thank you for all your help. After looking at the boxes, these are two different model numbers. I put them in their own variable and just about had it. They didn’t turn back to the same color but at least both returned to the same, close color. I will play with this some more this weekend!


#9

I am curious which of the three worked best on Sylvania’s bulbs?

HSL? color? colorTemp?

I can whip you up a sample test piston once I know that


#10

The one I’m having the best luck with is Color, Hue, Level and Saturation. I have to Sylvania’s LED strips named Porch 1 and Porch 2. I can get Porch 1 to return back to the captured color and Porch 2 gets there sort of. I have these on a dark blue since my house is blue and Porch 2 comes back as a light blue.

Color, Level Switch stays on White
Color Temp, Level and Switch stays on white
Hue Level Sat Switch - colors change but no where close to original color
Hue Level Sat - colors change but no where close to original color

Edit
I also have Switch included. Right now Color, Hue, Level, Sat and Switch
I tested the lights at Red and neither one will go back to Red


#11

I confess, I have never been impressed with “Capture & Restore” attributes using global states. I tend to capture what I need in local variables, and then restore using "Set color… (hsl)

pic


Side note…

If you have a favorite blue color that you want as your default outside, why not send a few test color commands (direct from webCoRE to the bulbs)… Once you find a pleasing shade of blue, then take note of your last command sent.

This will make it easy at anytime to return to that cool shade of blue, without even fiddling with capture/restore.


Pro Tip…

If you are restoring colors in separate lines, the order of the restore makes a difference to the final color. (I believe the later commands will overwrite the previous ones)


#12

I just found this old post that might be helpful to someone who finds this thread in the future: