Ah, I see, didn’t find out how to convert.
I’ll try to add a Template Sensor then! Just to learn… Maybe I’ll go back to manually define the MQTT sensors (instead of auto-discovery).
Maybe one could explain the “magic” happening here, this register have a map
-object:
{
"register": "47260",
"factor": 1,
"size": "u8",
"mode": "R/W",
"titel": "Fan Mode",
"info": "Fan mode",
"unit": "",
"min": "0",
"max": "4",
"map": [
{
"0": "Normal"
},
{
"1": "Hastighet 1"
},
{
"2": "Hastighet 2"
},
{
"3": "Hastighet 3"
},
{
"4": "Hastighet 4"
}
],
"logset": false,
"data": "Normal",
"raw_data": 0,
"timestamp": 1599724178940
}
Compared to the register I need to do a template for:
{
"register": "47041",
"factor": 1,
"size": "s8",
"mode": "R/W",
"titel": "Hot water comfort mode",
"info": "Setting in menu 2.2. 0=Economy,1=Normal,2=Luxury,4=Smart Control 0=Economy 1=Normal 2=Luxury",
"unit": "",
"min": "0",
"max": "4",
"data": 1,
"raw_data": 1,
"timestamp": 1599724232919,
"logset": false
}
I see the difference of data
. It seems to make some mapping-magic. I have not found any documentation in HA about the mapping, but it seems to produce the same result as the template. Am I correct? Maybe can try to implement the mapping on the publishing node instead…