openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.87k stars 3.58k forks source link

[hue] Expose Hue White with Ambiance (color temperature-only) light color (HSV/RGB) to the UI #10479

Closed mechalas closed 1 year ago

mechalas commented 3 years ago

One of the nice features of the openHAB UI is that the color channel in a color light will provide the currently-displayed color of a Hue bulb, whether that light is in xy, hsb, or ct mode. This allows the UI to give a (reasonably) accurate representation of the current light's color state.

There's a gap, however, for Hue White with Ambiance lights: these lights only have a Brightness channel and a Color Temperature channel. Without a Color channel, there is no way for the UI to easily reflect the color shown on the bulb since the color conversion is not exposed. The equations for converting mired to RGB are complicated, especially since they involve the intermediate step of conversion to xy, and are thus impractical for simple expressions,

Can this be addressed in the binding itself through the addition of a read-only color channel, that can do the conversion? Or would this need to be addressed in openHAB's core?

Running openHAB 3.0.1 on Ubuntu 20.04 LTS, x86_64.

Rossko57 commented 3 years ago

color light will provide the currently-displayed color of a Hue bulb, whether that light is in xy, hsb, or ct mode.

This is what Items are about. The UI has absolutely no idea about device modes, it only understands Color Items which by design hide those details. All Color Items are alike.

With that in mind ...

Can this be addressed in the binding itself through the addition of a read-only color channel,

Sure, that is just a single variable value ... a Number.

lolodomo commented 1 year ago

I understand your wish but adding a color channel to a thing that is a white bulb makes no real sense.