How can I send a color as command?

(Gerrit) #1


How can I send a HSBType with sendCommand?

As example Item1.sendCommand(360,1,1) does not work.


(Rich Koshak) #2

See Type Conversions for some details.

But I think just putting the argument in quotes will work in this case:

sendCommand("360,1,1") // note the removed spaces

If not perhaps passing the arguments to an HSBType will work

sendCommand(new HSBType(new DecimalType(360), new PercentType(1), new PercentType(1)))

(Gerrit) #3

Thank you, not it ist possible to switch the stripe on with the specified color.

But I have two Items, the first goes to channel dimmer on the second to the color. Now I expect if I set a color, that the dimmer will be updated but it is still at 0%. Can anybody tell my why?

Switch LED_Kueche_Light_Switch "LED Streifen Küche An/Aus"
Dimmer LED_Kueche_Light_Dimmer "LED Streifen Küche" {channel="zwave:device:de7d553e:node2:switch_dimmer"}
Color  LED_Kueche_Light_Color  "LED Streifen Küche Farbe" {channel="zwave:device:de7d553e:node2:color_color"}
rule "LED_Kueche_Light_ON"
    Item LED_Kueche_Light_Switch changed to ON

rule "LED_Kueche_Light_OFF"
    Item LED_Kueche_Light_Switch changed to OFF

(lipp_markus) #4

Not sure that it is designed to work like that. It is unclear to what level the dimmer (dimmer values can be any number between 0 and 100) should be set, just because the color changed.
If you add to your first rule just below the line with the color command LED_Kueche_Light_Dimmer.sendCommand(ON) your rule switch on the LED light with the color you set in the command before. Please note that ON translates to 100 (max brightness) so pick another value if this is too bright.

(Gerrit) #5

Thank you, but now if I set color to “45,75,0” and after that I sendCommand(50) to the dimmer channel I get a different color.

(lipp_markus) #6

Not sure why this happens, maybe you have to look into the documentation of your devices.
As a work-around, maybe send the color command after the dimmer command. If you still don’t like the color, just play with the values until it does what you want.