Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

air_pollution_level does not work with template sensor #44

Closed
Th30wl opened this issue Apr 14, 2021 · 0 comments · Fixed by #45
Closed

air_pollution_level does not work with template sensor #44

Th30wl opened this issue Apr 14, 2021 · 0 comments · Fixed by #45

Comments

@Th30wl
Copy link

Th30wl commented Apr 14, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant