If I get the idea of doing the reverse…
I mean, from a card be able to select (Min, Mid, Max), and send it to the topic. Maybe select from a dropdown (or have 3 radio-buttons?).
I got it working when configured the sensor manually in the configuration.
But for learning I switched on the MQTT Discovery, and removed the manual configuration. Now I get the following data.
Topic: homeassistant/sensor/47041/config
Value:
{
"name":"Nibe Hot water comfort mode",
"state_topic":"nibe/modbus/47041"
}
Topic: nibe/modbus/47041
Value (1 = Normal):
1
Topic: nibe/modbus/47041/json
Value:
{
"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": 1599639764959,
"logset": false
}
Is there a way to add a value_template from the UI, or can I add something to a config-file?
Also, I have all data how to translate 0 to 4 into text in the info-JSON-object. Can I use it?
Just some questions to get wiser…