Hi HA community. I want to convert a integer value in a „text“. I get no error but also doesn’t work. I want give out a text when the value of my power plug is in a certain range. That’s my approach, maybe is wrong. How can I setup properly?
- platform: template
sensors:
luftstufe:
friendly_name: 'Air Level'
unit_of_measurement: "level"
value_template: >-
{% set level = states('sensor.stecker_klima_weiss_leistung')|int (0) %}
{% if level <= 50 %}
one
{% elif 50 < level <= 90 %}
two
{% else %}
under construction
{% endif %}
Sorry, didn‘t know that. I tagged now the post (yours) which gives me the solution. I thought to tag the entire code is needed to show the community hoe it worked for me.
Thanks for advice!