Skip to content

Instantly share code, notes, and snippets.

@bphermansson
Created September 10, 2023 07:18
Show Gist options
  • Save bphermansson/b889b73372f24e853f0c3180647849b4 to your computer and use it in GitHub Desktop.
Save bphermansson/b889b73372f24e853f0c3180647849b4 to your computer and use it in GitHub Desktop.
Template for Home Assistant to get prediction from the SMHI integration in swedish language
prediction:
friendly_name: "Weather prediction"
value_template: >-
{%- set state = states('weather.smhi_home') -%}
{% if state == 'clear-night' %} klart, natt
{% elif state == 'cloudy' %} molnigt
{% elif state == 'exceptional' %} exceptionellt
{% elif state == 'fog' %} dimma
{% elif state == 'hail' %} hagel
{% elif state == 'lightning' %} åska
{% elif state == 'lightning-rainy' %} åska, regn
{% elif state == 'partlycloudy' %} delvis molnigt
{% elif state == 'pouring' %} ösregn
{% elif state == 'rainy' %} regnigt
{% elif state == 'snowy' %} snöigt
{% elif state == 'snowy-rainy' %} snöblandat regn
{% elif state == 'sunny' %} soligt
{% elif state == 'windy' %} blåsigt
{% elif state == 'windy-variant' %} vindbyar
{% else %} Okänt väder
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment