Hi all!
I’m trying to make three sliders on knx visu to control rgb led strip. Brightness and saturation sliders works great because they is 0-100. But HUE value must be 0-359 and from knx i can get only 0-100 value.
I need transform 0-100 from knx to 0-359 in OH.
There is my config that i can’t get working:
knx.things
Type dimmer : hue "kitchen2hue" [ position="13/5/0", readTransform="JS(convert.js)"]
Type dimmer : saturation "kitchen2sat" [ position="13/5/1" ]
Type dimmer : brightness "kitchen2br" [ position="13/5/2" ]
rule "hue"
when
Item hue changed
then
var DecimalType hueINT = hue.state
var PercentType saturationINT = saturation.state
var PercentType brightnessINT = brightness.state
var HSBType lightOBJ = new HSBType(hueINT, saturationINT, brightnessINT)
RGB.sendCommand(lightOBJ.toString)
end
Your saturation and brightness dimmer type channels are linked to Dimmer type items.
Does your linking of dimmer type channel to a Number type Item work, without the transform?
So if you link your KNX dimmer type channel (no transform) to a 0-100 Dimmer type Item, you should be able to do your scaling maths in the rule instead.
I tried a transform profile as well, but with no effect. Can you tell me what is wrong here:
Number EG_GW_Hzg_Stellgroesse_Ist "Hzg Stellgröße Ist [%d]" {channel="knx:device:bridge:EG_GW_RCTLR:EG_GW_Hzg_Stellgroesse_Ist" [profile="transform:JS", function="multiply_by_100.js"]}