Hi,
I got some outputs of a sensor which I want to rename.
I want the output “1” to be “Manual” and “2” to be “Automatic”.
I tried it like this but it doesn’t work.
sonnen_modus:
friendly_name: 'Sonnen modus'
value_template: >-
{% set names = {
1: "Manual",
2: "Automatic",
} %}
{{ names[states.sensor.json_sonnen.attributes["OperatingMode"]] }}
If it is possible, I would like the other possible outputs to just stay the same (so if the output is “0” I want it to display “0” etc.)
Can anyone help?