Hi,
I have a read/write channel that sends/receives 0/1 for ON and OFF command, I’d like to create a switch based on the number channel. Obviously I can create another switch and two rules that sync the number → switch and vice versa. However I recall there was a way to do on-the-fly transformation so I tried the below:
Switch hue_colourloop_switch "Hue Colourloop [MAP(switchToNumber.map):%s]" (gHue) {channel="hue:0840:xxxxxxxxxxxx:135:status"}
In switchToNumber.map I define the following:
ON=1
OFF=0
However it doesn’t seems to work. In OH UI when I switch ON/OFF I see the value changes between 1 and 0, however the binding doesn’t seem to receive the number hence I cannot control the device.
Anything I did wrong? Also appreciate if you have better idea how to solve the problem?
Many thanks!