Hello, I have an LED-Stripe with osram oti dali 75.
So 4 channels R-G-B-WW over KNX.
At the Moment 4x Slider-Items,
How can i controll this with an colorpicker in openhab2. ?
i found some rules
like this:
rule "LEDColorChanging"
when Item LEDstripe changed
then
logInfo(“LED”, “Color changing”)
hsbValue = LEDstripe.state as HSBType
redValue = String.format("%02X", (hsbValue.red.floatValue * 2.55) as int)
greenValue = String.format("%02X", (hsbValue.green.floatValue * 2.55) as int)
blueValue = String.format("%02X", (hsbValue.blue.floatValue * 2.55) as int)
sendCommand(Text_Text, redValue + greenValue + blueValue)
logInfo("LED Color changed", "R" + redValue + "G" + greenValue + "B" + blueValue)
end
but i can`t adopt this.
Here I’m a beginner. What do i have to declare?
Thanks
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
2
Sorry to bump an old post again, but this is the best and most recent thread on the topic.
I’ve been spliting hsbValue to RGB components with openHAB2 for a while, but now I’ve moved on to RGBW strips with openHAB V3.
Does anyone know if there has been any change with the hsbValue to now offer hsbValue.white.intValue ?
FYI
This rule works in OH3 (I need to tidy up the ON & OFF part using an else section, to accommodate commands from Alexa & Google etc)
rule "Middle colour"
when
Item MidRoomColourVR received command
then
logInfo("Middle","Middle Colour ="+receivedCommand.toString)
if (receivedCommand.toString == "ON") {MidRoomColourVR.sendCommand("0,0,100")}
if (receivedCommand.toString == "OFF") {MidRoomColourVR.sendCommand("0,0,0")}
var HSBType hsbValue = receivedCommand as HSBType
var int redValue = hsbValue.red.intValue
var int greenValue = hsbValue.green.intValue
var int blueValue = hsbValue.blue.intValue
logInfo("Middle","Middle HSB Value ="+hsbValue+" RGB Values : Red ="+redValue+" : Green ="+greenValue+" : Blue ="+blueValue)
MidRoom4DCCH1.sendCommand(redValue)
MidRoom4DCCH2.sendCommand(greenValue)
MidRoom4DCCH3.sendCommand(blueValue)
end