MAP transform with dynamic icons

I have problems translating the English text to German of the weaterforcast app Meteoblue for an item using dynamic icons (iday). Either I receive a correct iday icon image but no translation of the accompanying weather sentence or I get the default iday icon image with the accompanying translated text. Here my definitions in the *.item file.

At the “day0CondA” item (“WetterA”) I get the correct icon numbers for iday (1 to 17) and the corresponding English text explaning the weather condition (also is it unclear to me how 2 parameters are attached to an item, the number between 1 and 17 as well as the text “overcast with light snow”. At the “day0CondC” (“WetterC”) my mapping converts the item number to the German text correctly, but the iday icon is not selected anymore as the icon’s state gets the mapped text:

String  day0CondA   "WetterA [%s %%]"   <iday> (WetterTag0) ["Measurement"]             {channel="meteoblue:weather:metBridge:ChaletLauchernalp:forecastToday#condition", listWidget=" " [iconUseState="true"]}
String  day0CondB  "WetterB [MAP(wettertest.map):%s]" <iday> (WetterTag0) ["Measurement"]             {channel="meteoblue:weather:metBridge:ChaletLauchernalp:forecastToday#condition", listWidget=" " [iconUseState="true"]}
String  day0CondC  "WetterC [%s %%]"  <iday> (WetterTag0) ["Measurement"]            {channel="meteoblue:weather:metBridge:ChaletLauchernalp:forecastToday#condition [profile="transform:MAP", function="wetter.map"], listWidget=" " [iconUseState="true"]}

Here a screenshot of the received output in a Page:

Thanks for your help

Please share your map transformation file

wetter.map file used for the item day0CondC (translation is perfect, but does not have anymore the number and was also “translated”):

key=value
1=Klar, wolkenlos
2=Klar mit einigen Wolken
3=Wechselnd bewölkt
4=Bedeckt
5=Nebel
6=Bedeckt mit Regen
7=Wechselhaft, Schauer möglich
8=Schauer, Gewitter möglich
9=Bedeckt mit Schneefall
10=Wechselhaft mit Schneeschauern
11=Überwiegend bewölkt mit Schnee und Regen
12=Bedeckt mit leichtem Regen
13=Bedeckt mit leichtem Schneefall
14=Überwiegend bewölkt mit Regen
15=Überwiegend bewölkt mit Schneefall
16=Überwiegend bewölkt mit leichtem Regen
17=Überwiegend bewölkt mit leichtem Schneefall
=default

wettertest.map file (for testing day0CondB to see if the icon number changes - but it does not):

key=value
1=11
2=12
3=13
4=14
5=15
6=16
7=17
8=1
9=2
10=3
11=4
12=5
13=6
14=7
15=8
16=9
17=10
=default

command line screenshot (issued now, so other weather info):

I thought it may have been something to do with characters used in map that needed to be escaped however I don’t think this is the issue.

I assume this persists after you clear the cache or reboot?

Yes, I was deleting the neccessary files in db (see below) and the browser cache - still the same behavior:

systemctl stop openhab
cd $OPENHAB_USERDATA/jsondb  (or /var/lib/openhab/jsondb)
rm uicomponents_ui_page.json
rm -r backup
rm users.json (only needed for a complete initialization of openHAB

Interesing is that for my test situation “day0CondB” the map function does not work, for all other kind of item I never have encountered a problem at all with this kind of syntax. Due to that reason I tried it with the “transform:MAP” syntax in the channel.

One thing I do not understand is: how does openhab handle the two “values” for the items “day0Cond…” as the status received from meteoblue is a number (1 to 17) and the text shown is a sentence. So we have two values attached to one item: a number and a text sentence (string?). Or do I see something wrong.