glenndehaan / ikea-tradfri-coap-docs

How can you communicate to your ikea tradfri gateway/hub through coap-client
MIT License
191 stars 20 forks source link

Limited colors #1

Closed gnbl closed 5 years ago

gnbl commented 5 years ago

Awesome, thanks for this info. I found that unfortunately only the hex values listed seen to be supported - writing any other value defaults to 'efd275': 'Warm glow',

But querying the bulb also gives changing values for 5707, 5708, 5709, 5710 - using a "remote control"'s )>) button to change color, I get these 9 settings:

"3311":[{"5850":1,"5851":254,"5707":5309, "5708":52400,"5709":32886,"5710":27217,"5706":"efd275","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":4980, "5708":62974,"5709":35848,"5710":26214,"5706":"ebb63e","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":4137, "5708":65279,"5709":38011,"5710":24904,"5706":"e78834","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":1490, "5708":61206,"5709":40632,"5710":22282,"5706":"da5d41","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":59789,"5708":65279,"5709":32768,"5710":15729,"5706":"d9337c","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":55784,"5708":44554,"5709":22282,"5710":12452,"5706":"c984bb","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":47324,"5708":51774,"5709":13107,"5710":6554, "5706":"6c83ba","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":5427, "5708":42596,"5709":30015,"5710":26870,"5706":"f1e0b5","9003":0}]
"3311":[{"5850":1,"5851":254,"5707":5800, "5708":24394,"5709":25022,"5710":24884,"5706":"f5faf6","9003":0}]

Changing 5707 and 5708 does not seem to have an effect. 5709 seems to affect warmth, i.e. higher values approach red. 5710 seems to affect green, i.e. higher values approach green.

The app "Hue Essentials" must have figured it out, as it allows specifying a (HEX) color, achieving what could be a full red (#ff0000):

"3311":[{"5850":1,"5851":254,"5707":0,"5708":65279,"5709":45914,"5710":19615,"5706":"0","9003":0}]


From http://sprunge.us/CCQF via http://jaimejim.github.io/tradfri/:

    public static final String COLOR = "5706";
    public static final String COLOR_X = "5709";
    public static final String COLOR_Y = "5710";

Which probably is CIE xy chromaticity - https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space


Also see https://github.com/ffleurey/ThingML-Tradfri

glenndehaan commented 5 years ago

The HEX default was indeed a known thing but I forgot to write it down.

The color X and color Y is a great finding. And I didn't know about that. After some more research and testing it is indeed possible to display the xyY color space. I will post a new version of the documentation shortly.