Adding Color Wheel for RGB in HABpanel

color
openhab2
items
Tags: #<Tag:0x00007fadf9dcdb20> #<Tag:0x00007fadf9dcd9b8> #<Tag:0x00007fadf9dcd7d8>

(Daniel Müller) #1

Is there a possibility to work with RGB colors in the HABpanel? Actually I added a Color Picker widget to the UI, but this uses HSL instead of RGB. I want to send the colors per MQTT to an Arduino, which controls a RGB stripe (so I need to have RGB).

In the Widget itself I set an OpenHAB Item which defines a Color object.

I got the idea for the RGB controller here: RGB LED strip control using Arduino and MQTT

But here they use 3 items:

/* LED STRIPS */
Color LivSoffitLight "Living Room Soffit Color" (Lights_LivingRoom)
String LivSoffitLightColor (Lights_LivingRoom) {mqtt=">[mosquitto:control/arduino_LED/livingroom/color:command:*:default]"}
Number LivSoffitAnimation "Living Room Soffit Animation" (Lights_LivingRoom) {mqtt=">[mosquitto:control/arduino_LED/livingroom/animation:command:*:default]"}

With this items file my MQTT didn’t sent anything, so I changed the above to use just one item:

Color LivSoffitLight "Living Room Soffit Color" (Lights_LivingRoom) {mqtt=">[broker:control/arduino_LED/livingroom/color:command:*:default]"}

So, my questions here are:

  • Is there a possibility to use a RGB Color Wheel, instead the HSL one?
  • Why does the three items of the tutorial not work for me?
  • And is it ok to use just the one item “Color” instead of all three of the tutorial?

(AG) #2

Do you have an associated rule set up to convert the HSL value to RGB?

Animation item was not used, but i may implement with a new digital strip down the road.


(Matt Shepherd) #3

Did you get this working? I’m having the same issues.