Number to String MAP transformation in GUI

hi folks,
I just setup my second openhab instance and i try to configure everything via UI. In my first instance i did most via file configuration.

Now i try to transform the “Set Point Mode” channel of my homematic HmIPW-STH thermostet from

0=Auto
0.0=Auto
1=Manuel
1.0=Manuel

But it dont’ work. In my sitemap it’s still shown as 0 or 1.

If i define the item in .items file, it’S working

Number thermostat_spm  "Set point mode [MAP(ccu_thermostat_setPoint_mode.map):%s]"

This is my GUI item:

label: Set Point Mode
type: Number
category: ""
groupNames:
  - HM_THERMOSTAT_CHILDROOM_SOUTH
tags:
  - Point

My ChannelLink

I saw that similar posts but both are without a solution unfortunatelly.

Hope anyone may assist here. It drives me crazy meanwhile. I could just define the item in the *.item file but then i don’t see it in the semantic model. Didn’t find a way to link manually defined items to semantic model.

Thank you and have a nice christmas time :slight_smile:

  • Platform information:
    • Hardware: proxmox lxc container 4gb ram
    • OS: Ubuntu 24.04.1 LTS
    • Java Runtime Environment: openJDK 17.0.13
    • openHAB version: 4.3.0

or the newer

The difference between your two approaches is that the file based transformation only transforms the displayed value of the state, whereas in your UI based transformation, you’re using a profile to transform the actual state.

What you want is NOT using a profile, ie. set it to Default profile. Instead, use: Item → Add Metadata → State Description → Pattern. This would be the equivalent of what you were doing in the .items file.

Lastly, you can fully assign semantic models using your .items file. The semantic model in an Item definition is set through the item’s Tag, and group memberships.

Here’s an example:

Number thermostat_spm  "Set point mode [MAP(ccu_thermostat_setPoint_mode.map):%s]" ["Setpoint", "Temperature"]

I don’t actually understand what your “thermostat_spm” actually does. I assumed it’s for temperature, but if it’s for something else, you can assign a different tag.

You can find the list of tags here:
https://github.com/openhab/openhab-core/blob/main/bundles/org.openhab.core.semantics/model/SemanticTags.csv

Basically you google “semantictags csv” it’ll give you that link.

There is a comprehensive explanation about how to set up semantic model using .items file on this forum somewhere. [EDIT: posted above]

Hey,
thank you so much for all of your input! Exactly what i was looking for!
The “State Description” does the trick :slight_smile:
Thank you