Control Philips Hue Color via rule: If color temperature changed, then color control is no longer possible

Hello everybody,

I have a Müller tint LED-Strip white + color connected to my Philips Hue Bridge. The bridge is integrated into OpenHAB via Philips Hue Binding.

In order to use the LED strip, it is defined in my items file:
/* EG Wohnzimmer LED Streifen hinter TV */
Color FernseherColor “Color” (EGWZSwitch, EGWZCouchAndTVSwitch, EGWZHelligkeit, EGWZFarbe, EGWZCouchAndTVColor) {channel=“hue:0210:0017886a4aca:63:color”}
Dimmer FernseherColorTemperature “Color temperature” (EGWZFarbtemperatur, EGWZCouchAndTVFarbtemperatur) {channel=“hue:0210:0017886a4aca:63:color_temperature”}
String FernseherAlert “Alert” {channel=“hue:0210:0017886a4aca:63:alert”}
Switch FernseherEffect “Color loop” {channel=“hue:0210:0017886a4aca:63:effect”}

The LED stripe works so far and can be controled quite well with the colorpicker in my sitemap via BasicUI.
What I would like to have is a series of buttons that can be used to directly control certain color and color-temperature values directly.

Therefore, I created a dimmer in my items file:

Dimmer EGWZFernseherColorValues

As I understand it, the dimmer supports 101 values, from 0 to 100, right?

Then I created a switch with the desired buttons in my sitemap:

Switch item=EGWZFernseherColorValues label="TV Hintergr." icon="lights" mappings=[1="Rot", 2="Grün", 3="Blau", 4="Rosa", 5="Kalt", 6="Warm", 7="Hell"]

When I press the 1st button, the LED-Strip should light in red, 2nd button green, 3rd blue, 4th pink, 5th cold-white, 6th warm-white and 7th button full brightness.

For this I have created a rule in my rules file:

rule "EG_WZ_TV_Backlit_Colors_rule"
  when
    Item EGWZFernseherColorValues received command
  then
        switch receivedCommand {
                case 1:{ // Rot
					postUpdate(FernseherColor, new Status(hs))
					var DecimalType hue = new DecimalType(1) // 0-360; 0=red, 120=green, 240=blue, 360=red (again)
					var PercentType sat = new PercentType(50) // 0-100 (% ColorTemp)
					var PercentType bright = new PercentType(100) // 0-100 (% brightness)
					var HSBType light = new HSBType(hue,sat,bright)
					FernseherColor.sendCommand(light.toString)

				}
                case 2:{ // Grün
                       var DecimalType hue = new DecimalType(120)
                       var PercentType sat = new PercentType(50)
                       var PercentType bright = new PercentType(100)
                       var HSBType light = new HSBType(hue,sat,bright)
                       FernseherColor.sendCommand(light.toString)
				}
				case 3:{{// Blau
                        FernseherEffect.sendCommand(OFF)
                        var DecimalType hue = new DecimalType(240)
                        var PercentType sat = new PercentType(50)
                        var PercentType bright = new PercentType(100)
                        var HSBType light = new HSBType(hue,sat,bright)
                        FernseherColor.sendCommand(light.toString)
                }
                case 4:{ // Rosa
                        var DecimalType hue = new DecimalType(327)
                        var PercentType sat = new PercentType(98)
                        var PercentType bright = new PercentType(100)
                        var HSBType light = new HSBType(hue,sat,bright)
                        FernseherColor.sendCommand(light.toString)
                }
                case 5:{ // Kalt
                        FernseherColor.sendCommand(100)
                        FernseherColorTemperature.sendCommand(0)
                }
                case 6:{ // Warm
                        FernseherColor.sendCommand(100)
                        FernseherColorTemperature.sendCommand(100)
                }
                case 7:{ // Hell
                        FernseherColor.sendCommand(100)
                        FernseherColorTemperature.sendCommand(50)
                }
        }
  end

When I press the 1st button, the LED strip lights up in red, the 2nd in green, etc.
So far so good!
When I set one of the color temperature values, the exact desired brightness and color temperature are also shown to me. Perfect …
… NOT! If I now want to select one of the colors again, this is not possible.
My LED strip is caught in the color temperature.
The only way to get back into color mode (which I found) is through the Philips Hue app.
How can I leave the color temperature mode and get back into the color mode (for case 1-4 in my rule)

Thanks for the help in advance!
Daniel

1 Like