Hue Bulbs Not Restoring Colors

color
light

#1

1) Give a description of the problem
Hue Bulb not restoring color.

2) What is the expected behavior?
This is just a test piston so I can learn how to use functions. When I press the button on my remote, it is supposed to store the current state, change to orange for 10 seconds and then revert back to the stored state.

3) What is happening/not happening?
The first part of the piston runs as expected, however when it comes time to restore, the bulb briefly goes back to the correct color and then changes to green. The test variables I have set up show that no color is being saved to the local store. I am using the Hue B Smart DTHs for my bulbs and am curious if this is just an incompatibility between that and WebCore

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
(2/26/2018, 11:05:43 AM +362ms
+0ms ╔Received event [Home].time = 1519661144244 with a delay of -882ms
+347ms ║RunTime Analysis CS > 194ms > PS > 79ms > PE > 74ms > CE
+351ms ║Runtime (45104 bytes) successfully initialized in 79ms (v0.3.000.20180224) (350ms)
+353ms ║╔Execution stage started
+412ms ║║Restoring attribute ‘color’ to value ‘’ using command setColor()
+689ms ║║Executed physical command [LR Lamp Center].setColor([]) (273ms)
+705ms ║║Restoring attribute ‘colorTemperature’ to value ‘2732’ using command setColorTemperature(2732)
+2142ms ║║Executed physical command [LR Lamp Center].setColorTemperature([2732]) (1434ms)
+2155ms ║║Restoring attribute ‘hue’ to value ‘23.0’ using command setHue(23.0)
+2351ms ║║Executed physical command [LR Lamp Center].setHue([23.0]) (194ms)
+2363ms ║║Restoring attribute ‘level’ to value ‘100’ using command setLevel(100)
+2407ms ║║Executed physical command [LR Lamp Center].setLevel([100]) (43ms)
+2421ms ║║Restoring attribute ‘saturation’ to value ‘100’ using command setSaturation(100)
+2513ms ║║Executed physical command [LR Lamp Center].setSaturation([100]) (91ms)
+2517ms ║║Restoring attribute ‘switch’ to value ‘on’ using command on()
+2573ms ║║Executed physical command [LR Lamp Center].on() (51ms)
+2574ms ║║Executed virtual command [LR Lamp Center].loadStateLocally (2191ms)
+2577ms ║╚Execution stage complete. (2224ms)
+2579ms ╚Event processed successfully (2579ms)
2/26/2018, 11:05:26 AM +548ms
+1ms ╔Received event [Aeon Minimote].button = pushed with a delay of 972ms
+95ms ║RunTime Analysis CS > 13ms > PS > 37ms > PE > 44ms > CE
+97ms ║Runtime (44754 bytes) successfully initialized in 37ms (v0.3.000.20180224) (95ms)
+98ms ║╔Execution stage started
+109ms ║║Comparison (enum) pushed gets (string) pushed = true (1ms)
+110ms ║║Condition #7 evaluated true (5ms)
+111ms ║║Condition group #1 evaluated true (state did not change) (7ms)
+113ms ║║Cancelling statement #24’s schedules…
+651ms ║║Executed physical command [LR Lamp Center].refresh() (533ms)
+651ms ║║Executed [LR Lamp Center].refresh (534ms)
+655ms ║║Executed virtual command [LR Lamp Center].wait (1ms)
+656ms ║║Waiting for 3000ms
+3664ms ║║Executed virtual command [LR Lamp Center].setVariable (2ms)
+3672ms ║║Executed virtual command [LR Lamp Center].setVariable (2ms)
+3680ms ║║Executed virtual command [LR Lamp Center].setVariable (3ms)
+3687ms ║║Executed virtual command [LR Lamp Center].setVariable (2ms)
+3696ms ║║Executed virtual command [LR Lamp Center].setVariable (3ms)
+3704ms ║║Executed virtual command [LR Lamp Center].setVariable (3ms)
+3726ms ║║Executed virtual command [LR Lamp Center].saveStateLocally (14ms)
+3729ms ║║Executed virtual command [LR Lamp Center].wait (0ms)
+3730ms ║║Waiting for 3000ms
+7690ms ║║Executed physical command [LR Lamp Center].setColor([[hex: #ff8040, hue:6, saturation:100, level:63]]) (954ms)
+7690ms ║║Executed [LR Lamp Center].setColor (957ms)
+7694ms ║║Executed virtual command [LR Lamp Center].wait (1ms)
+7695ms ║║Requesting a wake up for Mon, Feb 26 2018 @ 11:05:44 AM EST (in 10.0s)
+7699ms ║╚Execution stage complete. (7601ms)
+7701ms ║Setting up scheduled job for Mon, Feb 26 2018 @ 11:05:44 AM EST (in 9.996s)
+7708ms ╚Event processed successfully (7708ms)


#2

Color is already a combination of Hue, Level and Saturation.

So you’re actually storing too much stuff.

Leave some of them out. So just do color and not H/S/L or just do H/S/L and not color.

In general color and colorTemperature fight with each other too.

So again…don’t use both.


#3

Tried both formats eliminating color temperature all together.

  1. Using H/S/L and switch, bulb reverted to green
  2. Using color and switch, bulb did not revert the color and stayed orange.

#4

Another piece of information I just discovered. I normally use a hue tap to control the lighting so the bulb gets set directly from the hue bridge. If I set the color via the ST app, everything works as expected. Is there a way force a refresh aside from the refresh statement I’m already using?


#5

I’m not aware of any…

So you say when you use the ST app it all works. What does the ST IDE say for the values?

It sounds like what you’re saying is that the Hue Tap is making changes to the bulb that ST does not know about… So when ST (or WC) goes to put the bulb back to the stored value…that stored value is what ST thinks the bulb should be…but not really what the bulb was.


#6

I’m going to suggest doing the same thing here:


#7

There is already a 3 second delay after capturing. That was one of the first things I tried.


#8

Just checked. Verified the ST hub was indicating the proper H/S/L. Bulb transitioned back to green after the 10 second wait, should have been the “Bright” setting. Could it be the fact that I’m using a Hue preset?


#9

I’ve never seen that and I have several Hue bulbs installed. I wouldn’t think using a preset would have any affect on things either. WC or ST only cares about what the bulb was set at…not how it got set there.

Very odd.


#10

I am too.
I’ve spent quite a bit of time trying to restore colors but have been unable to reliably do so regardless of how I save the attributes/variables. Using ‘color’ doesn’t work at all and individual attributes are store/restored with varying results. Restoring in different orders with various pauses doesn’t help either.
I think it may have to do with the Smartthings vs. Phillips method of setting hue and that the Hue B Smart handler need a tweak? I also think we’d need to determine if the initial color was a white ( below a certain ColorTemperature?) and only restore that specific variable, or restore it last.

To actually see what’s being stored, I’m saving the variables (except for switch) as devices. I think you could also use “integer”.

Capture

I’m pretty sure I could capture/restore with the default hue integration, but can’t be certain.
If you ever get this working, I’d be very interested to see your method.


#11

Just a question, are you using a Gen 1 or Gen 2 Hue Bridge? I was just reading something on the Hue B Smart about the differences between Gen 1 and Gen 2 scenes that may impact this. I am using a Gen 1 Bridge.


#12

I’m on Gen 2.
I initially had a Gen 1, have used it for testing and have issues with both.


#13

Instead of changing color of the bulb, Try using the setToGroup function of a Hue B Smart scene switch. Pass a parameter of the groupID of the Hue B Smart group that contains the bulbs you want to control.