Hi Everyone,
I’m using OH 3.2 and external mosquitto to control my mqtt stuff…
this runs without errors my mqtt service is stable.
I have a device (rgb-bulb) with a switch channel for white mode.
it sends 0
or 1
for ON / OFF
This is the according Item:
Switch LightWhite "White" <none>
{channel="mqtt:topic:MosquittoMqttBroker:RGB-Bulb-01:white"}
in log I have this warning entry:
[WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '0' not supported
by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.0
so I thought this should be easy to handle with a transformation in the mqtt.things configuration file:
Type switch : white "White" [
stateTopic="tele/OpenHAB/RGB-Bulb-01/STATE",
commandTopic="cmnd/OpenHAB/RGB-Bulb-01/White",
transformationPattern="JSONPATH:$.White",
on="1",
off="0"
]
but the problem remained
I thought maybe the logic of the conversion is inverted and tried
Type switch : white "White" [
stateTopic="tele/OpenHAB/RGB-Bulb-01/STATE",
commandTopic="cmnd/OpenHAB/RGB-Bulb-01/White",
transformationPattern="JSONPATH:$.White",
1="on",
0="off"
]
but the warning is still there…
I searched the forums for other solution but only found some older entries for OH 2.4 and UI-based stuff that wasn’t useful because the syntax differs - but nothing else…
maybe I’m blind and the solution is easy but I can’t find it