RGB(W) LEDs: de facto service IDs

I’ve received two different RGB LED devices in the last month: the “LIFX” RGBW bulb, and the “Holiday by MooresCloud” 50-LED RGB string. Both can be controlled over Wi-Fi. Obviously I’m thinking of Vera plugins for them both. I’m looking at the plugins for Philips Hue and MiLight for prior art.

It doesn’t look like anyone’s made platform-neutral service IDs for RGB or RGBW LEDs yet. Is it time? What are the control point authors using?

@intveltr and I did discuss whether we could use the same service for colour setting in our plugins for Hue and MiLight. At the time our conclusion was that, due to major differences in the way the two lamp types handled colour, it was not feasible.

In MiLightCU1 (RGB) and MiLightRGBW (RGB+W), Hue is a simple eight-bit value that maps to a mix of two colours. Sadly the mapping is not quite the same for the RGB lamp, the RGB+W lamp and the RGB+W LED strip. White is indicated by a special mode rather than a Hue value. MiLIGHTWU1 (White) does not use Hue but does have a colour-temperature parameter of 2700-5000K.

If we can agree on a device-independent service that conveys the necessary parameters, I will happily add it to the MiLightxxx plugins.

Thanks RexBeckett. I did vaguely recall seeing the discussion you mentioned, but it wasn’t something I was able to contribute to at the time.

Maybe it’s best to chip away at the problem, and make several services. Lamps can pick and choose the service(s) that correspond to their abilities.

[ul][li]Colour temperature: MiLightWU1 and LIFX and Hue seem to have this. With LIFX the temperature is sent directly in kelvin, with MiLightWU1 it’s faked in the plugin.[/li]
[li]RGB: Holiday by MooresCloud has this. I wonder if we can just reuse the UPnP Dimming service type three times. Then all we’d have to pick is three service names for the channels.[/li]
[li]RGBW: Similar thoughts on using the Dimming service type.[/li]
[li]HSV: LIFX has this. MiLightCU1 has a cut-down version of this were you can specify only the hue and not the saturation. The inconsistency of the hue across their devices is unfortunate but it could perhaps be compensated for within the plugin.[/li][/ul]

Are there any other models that people have seen? CIELab? YCbCr? Pantone? X11 colour names?

There are several industry-standard colour spaces that offer device independence. CIE XYZ and CIE Yxy are the most frequently used in my world. But, given that the plugins are going to have to convert the incoming value to their own colour space, we should try to keep it simple. I regularly convert between colour spaces but it usually requires matrix arithmetic. I don’t really want to perform several 3 x 3 matrix multiplications in my plugins just to set the lamp to red.

How about sRGB? It’s simple and easy to process. Well, having said that, it will still be fun mapping that to MiLight’s strange and limited colour space - which only ever uses a mix of two colours unless it is white. ::slight_smile:

I must say that I don’t go a bundle on needing three separate UPnP services to convey RGB. It surely must be possible to introduce a new service that provides all required colour information in one hit.

I am interested in seeing where this goes as I am slowly working on an arduino project that will control rgb(w) strip lights and integrate with the Arduino sensor project.

  • Garrett