- Platform information:
- OS: _what OS is used and which version: x86 64bit ubuntu
- openHAB version: docker container of openhab/openhab:3.3.0"
Hi,
I am using openhab to read in some mqtt messages from zigbee2mqtt. For example I receive json strings like this from a zigbee switch.
{"action":"on","battery":74,"last_seen":"2023-12-20T19:37:53+01:00","linkquality":114,"update":{"state":"available"}}
To link this data to an item, I created a generic mqtt thing within the openhab GUI and specified the “Incoming Value Transformations” to “JSONPATH:$.action” and set the “Custom On/Open Value” to “on” in one of the “thing”-channels.
This works fine, but I still get a warning inside of the openhab.log file which sais:
2023-12-20 19:37:53.100 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'on' from channel 'mqtt:topic:mosquitto:sw_02:state' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.on.
I found a post regarding this topic (here) and the solution seems to be to add a dedicated transformation from ‘on’ to ‘ON’.
So basically I have two questions:
- How can I link a custom transformation created within my myTransformation.map file to my GUI ‘thing’? In the mentioned post it was done within the items file itself.
- Why is this necessary? Whats the point of the GUI settings “Custom On/Open Value” if I need a mapping anyway? And why does it work despite the warning?
Many thanks in advance.