homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
715 stars 60 forks source link

Color bug (Homie 5): xyz does not include brightness #296

Closed Tieske closed 1 month ago

Tieske commented 2 months ago

In the Homie 5 draft, there is "rgb", "hsv", and "xyz" for the color type.

Problem: 2 of them encode brightness, the third doesn't. So they are not equivalent!.

In the "xyz" system (CIE 1931) there are actually 2 representations; "XYZ" and "xyz", which are different:

The only solution I see to this is to either remove "xyz" as an option, or change the definition of "xyz" (currently Chromaticity Coordinates) to Tristimulus Values, meaning, the last value (z) must also be passed along, and they do not have to add up to 1.

@schaze this originated from you I think. And iirc mostly because some devices (Philips Hue and friends) seem to prefer the "xyz" system. So wdyt?

schaze commented 2 months ago

I would argue that hsv and rgb have the bug since this property is supposed to describe the color not the brightness. A light usually has a separate brightness value to adjust its brightness. Having said that, I don't really care about it. For me it was good enough the way it was. But feel free to change it if you like.

Tieske commented 2 months ago

I have been thinking about this as well. Maybe we can document this particular difference between the formats, and users should use rgb & hsv, if brightness is to be encoded in the values, or rgb, hsv, xyz if brightness is not to be encoded.