How to use W from RGBW together with RGB from adafruit Neopixel

I just managed to set up an adafruit Neopixel RGBW LED strip on my openhab (2) setup.

I’m using an arduino and MQTT to let openhab talk to the arduino.

I have an color item that is visible in the sitemap
and a string item that is an MQTT command
and a rule that is taking the color value and transforming it into an RGB value that is send to the arduino using MQTT

So far so good.

only it’s an rgbW led and not an rgb led.
As far as I know, the color, only creates RGB values.
when I send a RGB value. it works, it’s picked up
what happens on the arduino is that it does not change the W value if it does not receive anything.

so when the W value is 000 , i get normal RGB behavior
when W value is 255, the colors are totally off. (which is normal as the W led is too bright)

The easy and cheap solution would be to only buy RGB strips and then I have no problem, yet then I also have not nice white light.

What I would like to do, is use normal RGB, when I want colors, and when I want white light, I want to have another solution.

How would you solve this?

I would create a separate Dimmer Item to control the W value of the light. You might need to create one or more proxy Items and some rules to control and interpret the interactions between the RGB changes and the W changes.

1 Like

that is also what I had in mind. the rules I had not thought about. Glad I asked. not yet sure what kind of rules I can use, I need tithing about that…

You will probably want to experiment a bit to see how they should interact. For example, if you bump the W up 100% should the RDB fade down or go to 0? Do you want to limit how bright the W can be if the RGB is in certain color ranges (e.g. reds and oranges should allow less W but blues and greens can allow full w)? Perhaps you want to limit W and or RGB based on time of day?

I think the hard part will be coming up with the desired behavior. Coding it up will almost certainly just be a bunch of if statements.

1 Like

Hey @yves would you mind sharing your arduino sketch for a neopixel strip?


what I have done is based on

That’s a pretty sweet implementation using openHAB!

1 Like