Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hue Lights don't display color correctly in the UI #14119

Closed
omriasta opened this issue Apr 27, 2018 · 4 comments · Fixed by #14154
Closed

Hue Lights don't display color correctly in the UI #14119

omriasta opened this issue Apr 27, 2018 · 4 comments · Fixed by #14154

Comments

@omriasta
Copy link
Contributor

Home Assistant release with the issue:

0.68 beta with fix from #13944

Last working Home Assistant release (if known):
0.66

Operating environment (Hass.io/Docker/Windows/etc.):

rasbian virtual python env
Component/platform:

hue.py

Description of problem:

Lights display Green in UI for some light groups although the bulbs themselves are set without color

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):


Additional information:

@amelchio Following up from #13944
I am displaying the info for 3 rooms, the differences between them are:
Living Room: All 3rd gen color bulbs
Kitchen: Several white ambiance bulbs and 2 3rd gen hue color spotlights
Master: Several hue white ambiance and 2 2nd gen hue color bulbs
All 3 are set using the "Bright" scene from hue and you can see the xy is almost identical between all 3 in the hue API debug. The Master (room/group) always displayed correctly in HA, the Living room displayed green before the patch from #13944 but now displays correctly with the patch.
And finally the Kitchen is displaying green before/after the patch and since update to 0.66 I believe.

Here is the relevant info from hue debug for Kitchen:

"name": "Kitchen",
"lights": [
"25",
"24",
"23",
"20",
"21",
"19",
"16",
"17"
],
"type": "Room",
"state": {
"all_on": true,
"any_on": true
},
"recycle": false,
"class": "Kitchen",
"action": {
"on": true,
"bri": 254,
"hue": 14957,
"sat": 141,
"effect": "none",
"xy": [
0.4576,
0.4099
],
"ct": 366,
"alert": "none",
"colormode": "hs"
}
}
},

And Hue Attrib for Kitchen:

{
"min_mireds": 153,
"max_mireds": 500,
"brightness": 254,
"hs_color": [
82.163,
55.294
],
"effect_list": [
"colorloop",
"random"
],
"rgb_color": [
202,
255,
113
],
"xy_color": [
0.347,
0.511
],
"is_hue_group": true,
"friendly_name": "Kitchen",
"supported_features": 63
}

And now a different room/group which displays correctly:
Hue debug API for Living Room:

"name": "Living room",
"lights": [
"1",
"2",
"3"
],
"type": "Room",
"state": {
"all_on": true,
"any_on": true
},
"recycle": false,
"class": "Living room",
"action": {
"on": true,
"bri": 254,
"hue": 14957,
"sat": 141,
"effect": "none",
"xy": [
0.4576,
0.4099
],
"ct": 366,
"alert": "none",
"colormode": "xy"
}
},

And Atrribs in HA from Living Room:

{
"min_mireds": 153,
"max_mireds": 500,
"brightness": 254,
"hs_color": [
38.222,
52.941
],
"effect_list": [
"colorloop",
"random"
],
"rgb_color": [
255,
205,
120
],
"xy_color": [
0.459,
0.408
],
"is_hue_group": true,
"friendly_name": "Living room",
"supported_features": 63
}

And lastly a room that has only 2nd gen color bulbs:
Hue Debug API for Master Bedroom:

"name": "Master",
"lights": [
"7",
"8",
"5",
"6"
],
"type": "Room",
"state": {
"all_on": true,
"any_on": true
},
"recycle": false,
"class": "Bedroom",
"action": {
"on": true,
"bri": 254,
"hue": 8403,
"sat": 140,
"effect": "none",
"xy": [
0.4575,
0.4099
],
"ct": 366,
"alert": "none",
"colormode": "xy"
}
},

And HA attribs for Master Bedroom:

{
"min_mireds": 153,
"max_mireds": 500,
"brightness": 254,
"hs_color": [
38.667,
52.941
],
"effect_list": [
"colorloop",
"random"
],
"rgb_color": [
255,
207,
120
],
"xy_color": [
0.457,
0.41
],
"is_hue_group": true,
"friendly_name": "Master",
"supported_features": 63
}

@amelchio
Copy link
Contributor

"action": {
    "bri": 254,
    "hue": 14957,
    "sat": 141,
    "xy": [
        0.4576,
        0.4099
    ],
    "colormode": "hs"
}

Not sure what to do here. The colormode is hs and the hue is green so this does in fact look like a green color to me.

@omriasta
Copy link
Contributor Author

Hmmm...didn't notice that, I wonder why that particular "group/room" is under hs while the rest are all xy? Any idea where one could set the color mode in Hue? Because the Hue app displays the color correctly so it definitely does not see that group as hs....very odd

@omriasta
Copy link
Contributor Author

OK, So not really a solution but it appears to be a Hue bug. As @amelchio noticed the colormode for the group was on hs on this group only. Even though everything was being set and read as xy in the Hue app. HA would read back the hs setting which were different apparently. I deleted the group and recreated, no luck, still stuck in hs.
Then I tried to remove all the bulbs except for the color bulbs and VOILA! the group colormode changed to xy. Then slowly added back the other bulbs and the colormode stayed in xy. I assume that the "colormode" is set to hs if the first bulb in the group is white. It will not change the colormode unless only color bulbs are in the group. After that changes, it will not switch back to hs even after adding white bulbs. So my guess is that the culprit is this setting in the group. The UI now displays the colors correctly!
As far as a fix, I am not sure if we really need hs color settings or if Hue actually updates those occasionally and not the xy parameters? Maybe forcing HA to always read xy? I'm sure that would probably mess up other things...

@amelchio
Copy link
Contributor

I made a PR (#14154) to always use xy but I guess you are no longer able to test it?

@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants