8000 IKEA Tradfri RGB - No color picker · Issue #9603 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

IKEA Tradfri RGB - No color picker #9603

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

Closed
robinjoh90 opened this issue Sep 27, 2017 · 9 comments
Closed

IKEA Tradfri RGB - No color picker #9603

robinjoh90 opened this issue Sep 27, 2017 · 9 comments

Comments

@robinjoh90
Copy link

IKEA has now released their RGB lamp, but I don't get a color picker in the front end. It seems like the only difference between the RGB lamp and the one with color temp is the name.

Dump of RGB lamp with pytradfri

{'3': {'0': 'IKEA of Sweden',
        '1': 'TRADFRI bulb E27 CWS opal 600lm',
        '2': '',
        '3': '1.3.002',
        '6': 1},
  '3311': [{'5706': '0',
            '5707': 0,
            '5708': 0,
            '5709': 19831,
            '5710': 37676,
            '5711': 0,
            '5850': 1,
            '5851': 50,
            '9003': 0}],
  '5750': 2,
  '9001': 'Bed lamp',
  '9002': 1506531778,
  '9003': 65539,
  '9019': 1,
  '9020': 1506538984,
  '9054': 0}

Dump of color temp light with pytradfri

{'3': {'0': 'IKEA of Sweden',
        '1': 'TRADFRI bulb E27 WS opal 980lm',
        '2': '',
        '3': '1.2.217',
        '6': 1},
  '3311': [{'5706': 'f1e0b5',
            '5707': 0,
            '5708': 0,
            '5709': 30140,
            '5710': 26909,
            '5711': 370,
            '5850': 1,
            '5851': 27,
            '9003': 0}],
  '5750': 2,
  '9001': 'Kök',
  '9002': 1495482458,
  '9003': 65537,
  '9019': 1,
  '9020': 1506543309,
  '9054': 0}

I changed

if self._light.device_info.manufacturer == IKEA:
                self._features |= SUPPORT_COLOR_TEMP

to

if self._light.device_info.manufacturer == IKEA and "CWS" not in self._light.device_info.model_number:
                self._features |= SUPPORT_COLOR_TEMP

in the file /components/light/tradfri.py, but I dont know if this is the correct solution.

@mories76
Copy link

Your code change supported_features from 3 to 17 which is ok.
But the color picker is only available after you select one the 20 default colors from the Ikea app.
If you restart HA and are on a default color the color picker is available. Once you pick a random color and restart the color picker is gone, until you choose a default color.

I haven't found a solution for this yet.

@spektren

Copy link
Contributor
spektren commented Oct 3, 2017

My guess is, the polymer interface decides on its own (not based on the detected features in pytradfri) to only show the color picker if there is any data in the coap parameter 5706 (like "5706":"efd275"). As stated by @mories76, this is only the case after setting one of the predefined rgb colors via coap parameter 5706 (set_hex_color() with predefined rgb color in pytradfri). If set_rgb_color() is used to set a user defined color the data in 5706 will be "0" and no color picker is displayed.

Unfortunately, I can't find the section in polymer where the decision is made.

spektren added a commit to spektren/home-assistant that referenced this issue Oct 4, 2017
Added feature detection (SUPPORT_RGB_COLOR) for IKEA tradfri RGB bulbs. 

String comparison with manufacturer/device id used because I think there isn't a suitable property/param to identify the RGB capability. Both IKEA WS and RGB have data in the same parameters (x, y, rgb). 

Color picker in UI is only offered after one of the default RGB colors (i.e. efd275) is set in param 5706. For now I couldn't find the section in polymer where the decision (to show a color picker or not) is made. 

see also: 
<home-assistant#9603>
@matemaciek
Copy link
Contributor

Maybe we should change pytradfri behaviour, so that it sets 5706 argument basing on existing x and y?

@jareware
Copy link
jareware commented Oct 7, 2017

Doesn't seem like an interface issue; based on my quick testing (just got one), the bulb itself only seems to accept pre-defined color codes, when PUT'ing with coap-client.

@matemaciek
Copy link
Contributor

Fix is on the way (-:

@spektren
Copy link
Contributor
spektren commented Oct 8, 2017

It's probably the gateway which simply does not pass any rgb/hex values in param 5706 to the bulb which arent't one of the ~20 predefined ones.
When a non predefined color is set thru xy with the params 5709 and 5710 the gateway reports the rgb param 5706 as "0".

I think @matemaciek suggested to modify pytradfri to calculate the current rgb values from the current xy values and report rgb to i.e. HA (although the GW reports rgb "0").

@ggravlingen
8000 Copy link
Contributor

@matemaciek has applied some color vodoo to the pytradfri-lib and this magic is available in version 3.0.1 :)

@matemaciek
Copy link
Contributor

#9703 fixes it (-:

@amelchio
Copy link
Contributor

I will close this issue as it is reported to be fixed.

@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
< 4776 div class="js-discussion-sidebar-item" data-target="create-branch.sidebarContainer">
7 participants
0