Hi all. I have an issue with OH3 MAP transformations I don’t really understand…
I have a bunch of thermostats from different manufacturers which report different strings for their current operation mode. To be able to use them with the dynamic heater control icon, I convert them to percent numbers as following:
String TSOG1Kuche_ModusdesHeizkorperreglers "TS OG1 Küche Modus" <Heating> ( TSOG1Kuche ) [ "Status", "Temperature" ] {
channel="avmfritz:FRITZ_DECT_301:192_168_100_1:099950441610:radiator_mode" [
function="thermostat_modus_itemlink.map",
profile="transform:MAP"
],
listWidget="widget:ts_temperaturemode",
stateDescription=" " [
pattern="MAP(thermostat_modus_widget.map):%s"
]
}
String TSOG1WC_CurrentHeatingMode "TS OG1 WC Modus" <heating> ( TSOG1WC ) [ "Status", "Temperature" ] {
channel="somfytahoma:valveheatingsystem:5c9e9e2952:ede130d7-5912-482f-9f4b-ff9f4bc0ebae:current_heating_mode" [
function="thermostat_modus_itemlink.map",
profile="transform:MAP"
],
listWidget="widget:ts_temperaturemode",
stateDescription=" " [
pattern="MAP(thermostat_modus_widget.map):%s"
]
}
The thermostat_modus_itemlink.map defines the numbers that each operating mode should represent:
! AVM thermostats
OFF=0
BOOST=100
COMFORT=100
ECO=40
WINDOW_OPEN=40
ON=100
! somfy thermostats
frostprotection=0
away=40
eco=70
comfort=100
This part works fine, all thermostats show up with a number instead of a string for their operation mode.
For convenient state reading, I apply another MAP transformation for the StateDescription:
0=Aus
40=Spar
70=Eco
100=An
For the somfy thermostat, this works in the UI, state is “Aus”:
But for the AVM thermostats (all of them), it shows “undefined”:
In the item popup, it shows “0” as operation mode and the correct icon:
I don’t understand why it is working for somfy, but not for AVM. Why do the AVM thermostats show “undefined”? Both use the same 2 transforms and the same widget…
I already did about 2 hours of research, but could not find any clue.
Big thanks in advance for any insight
BTW: The different map files for the channel link and the state description are a result of some of my trials to fix this. Both were one file at the beginning, when I suspected the MAP may be confused if it finds its target result as a source in the map also. But didn’t help obviously.