[SOLVED] MQTTv2 Configuring a channel transformation in paperUI

(Fug1) #1

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?

0 Likes

(Rich Koshak) #2

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.

0 Likes

(Fug1) #3

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.

0 Likes

(Fug1) #4

Alternatively, if the map transformation should be done to the item, is there a way to configure an item transformation using paper UI?

0 Likes

(Rich Koshak) #5

Since it’s the MQTT binding you have the format wrong.

MAP:thermostatFanOpState.map

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.

1 Like

(Fug1) #6

Brilliant, that worked…thanks so much!

0 Likes

(Siegfried Polysius) #7

Hi,

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:
0=Detecting
1=Parking
2=Mowing
3=SearchingStation
4=Charging
5=Searching
7=Error
8=Missing Loop
16=Off
17=Sleeping
18=Waiting for Door
98=Offline
99=Unknown
=Mystery

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…)

Best,
Siegi

0 Likes

(Siegfried Polysius) #8

Rookie mistake… It actually works after I installed the MAP transformation add-on…

0 Likes