dnguyen800/air-visual-card

air_pollution_level does not work with template sensor

Closed this issue · 0 comments

I have the following template sensor that I use to translate the pollution level to my language:

- platform: template
  sensors:
    pollution_level_translated:
      friendly_name: "Kvalitet Vazduha"
      value_template: >
        {% if states("sensor.u_s_air_quality_index")|int <= 50 %}
          Dobar
        {% elif  states("sensor.u_s_air_quality_index")|int <= 100 %}
          Malo zagađen
        {% elif  states("sensor.u_s_air_quality_index")|int <= 150 %}
          Nezdrav za hronične bolesnike
        {% elif  states("sensor.u_s_air_quality_index")|int <= 200 %}
          Nezdrav
        {% elif  states("sensor.u_s_air_quality_index")|int <= 300 %}
          Veoma nezdrav
        {% else %}
          Opasno zagađen
        {% endif % }

However setting air_pollution_level still shows the text in English:

image