home-assistant-libs / pytradfri

IKEA Trådfri/Tradfri API. Control and observe your lights from Python. Examples available. On pypi. Sans-io.
MIT License
947 stars 129 forks source link

Supported colors in RGB bulbs #263

Closed sleeplesslord closed 4 years ago

sleeplesslord commented 4 years ago

This is technically a question about the hardware, but I'm asking here since it's not supported in official software.

I'm wondering whether the Trådfri bulbs with multi-color support have support for the full RGB spectrum. I know that the app only provides a set amount of colors, but I see that the API pytradfri provides allows for passing XY values. Will any RGB-color work provided that it's converted?

ggravlingen commented 4 years ago

This library mirrors what's possible to do out of the box with the gateway. We've added a few examples on color calculations here: https://github.com/ggravlingen/pytradfri/blob/master/examples/example_color.py

sleeplesslord commented 4 years ago

The color example uses (0, 0, 102) which isn't in the list of supported hexes, so that means that the supported color spectrum is wider than the preset colors, right?

To clarify, I'm asking because I don't own a color bulb (so I can't test it myself) and I was hoping to decide whether to buy one based on the color capabilities. I've seen that there are some things the app doesn't let you do that are actually possible (like adding a bulb to multiple groups), so I was hoping full RGB color (or at least more than 20) was also possible.

If the color example works as expected (the bulb turns dark blue) then that answers my question.

ggravlingen commented 4 years ago

I believe this may be worth a read: https://github.com/ffleurey/ThingML-Tradfri

sleeplesslord commented 4 years ago

Thank you, that's exactly the information I was looking for!