I’m just in the process of moving my item configuration from the .items file into paper ui. For some reason, I can’t get the map transform to work properly. In paper UI, I’m configuring the map transform under the channel of a “thing”, using the “Incoming value transformation” field.
My thing is a thermostat, the channel is the thermostatFanOpState, and the transform is entered as “MAP(thermostatFanOpState.map):%s”. The .map file is available in my filesystem under conf/transform. When a state update comes in for this channel, I get an error in the openhab.log that reads ‘Transformation service “[MAP(THERMOSTATFANOPSTATE.MAP) for pattern %s]” not found!’. I’m looking at the channel and see the value “0” coming in, and 0 is mapped to “Off” in the .map file. This same map file works if I apply it to an item in a .items file.
Any idea what I could be doing wrong here?
What binding? Anything that is done at the Channel or Thing level is going to be binding specific.
For the most part, the %s is most likely incorrect. You only use %s and the like on Item labels, never (that I’ve seen) on Things or Channels.
The thermostat is set up as a generic MQTT thing, using the MQTT binding. I’m able to see the state updates come in via MQTT, but it’s complaining about the transformation.
How should a map transformation be set up on a channel in paper UI using the “incoming value transformation” field? The openhab documentation on transformations seems to assume the item is configured in a .item file.
Alternatively, if the map transformation should be done to the item, is there a way to configure an item transformation using paper UI?
Since it’s the MQTT binding you have the format wrong.
It’s sparsely documented here.
No, with 2.x version bindings you do the transform on the Thing or you do it on the Item’s label. You can do both from PaperUI.
Brilliant, that worked…thanks so much!
trying the same thing. I have an mqtt Thing (“generic MQTT Thing”, my lawnmower) with several channels linking to several items.
One channel is the status which comes as a number and should be translated into a String.
I defined a channel (type “Text value”), with the mqtt topic as state topic.
In the incoming value field I put: MAP:mowerstatus.map
In $OPENHAB_CONF/transform, I have a file “mowerstatus.map” that has the appropriate key=value pairs:
18=Waiting for Door
However when I look at the Control, I see the numeric value rather than the transformed string.
What am I doing wrong? ( I see no errors in the logs…)
Rookie mistake… It actually works after I installed the MAP transformation add-on…