OpenHab 3.2
Raspbian (will change eventually, but unlikely to affect this question)
Widget creation that modifies input to a custom output using , in this case a ZWave RGBW LED controller, could be done with any RGBW controller that is manually wired to the light strips though.
Item type therefore is Color
White LED Light strip has 2 channels (3 leads, Anode, +2 cathodes) one for White and one for Warm White.
Wiring is
White = Red Channel of controller 6500Kelvin
Warm White = Blue Channel 3500Kelvin
I need to write a widget slider object which will take the three properties props.coloritem props.white and props.warmwhite
which will be set as follows for the example case
props.coloritem=ZWN037RGBW_Color
props.white=red
props.warmwhite=blue
Display value will be something like:
=((100-(items[props.coloritem].toRGB().[props.white]/2.55)) +(items[props.coloritem].toRGB().[props.warmwhite]/2.55))*(items[props.brightnessitem]/100)
and when the slider changes I need to take the slider value and transform it like:
RGBtoHSB((items[props.brightness]/100)*(100-newslidervalue)),0,(items[props.brightness]/100)*(100-newslidervalue)))
I need help understanding the following given the above data:
Where/what tag do I place the slider value formula?
Where to I put the code for the reverse transform when the slider is changed in the UI?
Finally (and I may figure this one out quickly on my own in a minute) what var/item/prop/value do I enter to get the new slider value when someone changes it?