Weather conditions in local language in template

Hi!
How get Weather conditions in local language in template, i try:

{{ states('weather.home') }}

or

{{ states('weather.gismeteo') }}

But receive cloudy (English) instead of Облачно (Russian), but in Lovelace card and in GUI i see Облачно

2 Likes
# Current Weather 

- platform: template
  sensors:
    current_weather:
      value_template: >-
        {%- set state = states('weather.home') -%}
        {% if state == 'clear-night' %} Ясно, ночь
        {% elif state == 'cloudy' %} Облачно
        {% elif state == 'exceptional' %} Предупреждение
        {% elif state == 'fog' %} Туман
        {% elif state == 'hail' %} Град
        {% elif state == 'lightning' %} Молния
        {% elif state == 'lightning-rainy' %} Молния, дождь
        {% elif state == 'partlycloudy' %} Переменная облачность
        {% elif state == 'pouring' %} Ливень
        {% elif state == 'rainy' %} Дождь
        {% elif state == 'snowy' %} Снег
        {% elif state == 'snowy-rainy' %} Снег с дождем
        {% elif state == 'sunny' %} Ясно
        {% elif state == 'windy' %} Ветрено
        {% elif state == 'windy-variant' %} Ветрено
        {% else %} Нет данных
        {% endif %}
4 Likes

Did you find out eventually?

You should try and use {{ states(‘sensor.current_weather’) }} to get the local language.

I couldn’t find a standard solution.

So you propose to use the template sensor that I wrote and gave above? :slight_smile:
That’s what I use, because I haven’t found any other solution yet.

I probably misunderstood what you were trying to achieve with this.

Do you want to have weather conditions in your local language without the need for the sensor template?

I am pretty sure that the weather integrations all outputs in english.

Yes…

This seems to be the case, but then the GUI converts to local.

Do you have your language in Home Assistant set to your local language or English?

My weather integration automatically translates when I switch language without using the template sensor.

Local language …

In GUI yes, i see weather on local language, but {{ states(‘weather.home’) }} return state on English

1 Like

same for me, how to get the local language out of weather.home ?

I made a template sensor.

Hey, great work with the template! I just cannot figure out where to use it. Should I put that code inside the configuration.yaml?

Configuration.yaml or some package file, or sensor include file…
But be sure to look at the documentation for correct syntax, indentation, etc.

Your teamplate sensor does not work for me.

Changed the name of the weather sensor to yours? Have you checked in the developer tools in the template editor? what does it show?

I did but nothing happened. Anyway I solved the problem with burying your code inside the message.

Here is my final working template. Thanks a lot.

service: notify.telegrambot
data:
  title: Yarınki Hava Durumu Tahmini🌡
  message: >
    {% set weather = {
                'clear-night': "açık-gece",
                'cloudy': "bulutlu",
                'exceptional': "olağanüstü 🌞",
                'fog': "sisli",
                'hail': "dolu",
                'lightning': "şimşek 🌩",
                'lightning-rainy': "şimşek ve yağışlı ⛈",
                'partlycloudy': "parçalı bulutlu ⛅",
                'pouring': "sağanak yağışlı ☔",
                'rainy': "yağmurlu ☔",
                'snowy': "kar ☃️",
                'snowy-rainy': "karla karışık yağmurlu",
                'sunny': "güneşli ☀️",
                'windy': "rüzgarlı 💨",
                'windy-variant': "rüzgar varyantlı 💨"
              } %}
    Sıcaklığın {{ state_attr('weather.colak_ismail_2','forecast')[1].temperature
    }}℃ ve havanın {{weather[state_attr('weather.colak_ismail_2',
    'forecast')[1].condition] }} olması bekleniyor.  Rüzgar hızı ise 💨
    {{state_attr('weather.colak_ismail_2', 'forecast')[1].wind_speed }} km/h
    olarak bekleniyor.

2 Likes

Hello. I am trying to do the same thing but when I add the piece of code nothing happens. This is my original code:

alias: Weather
description: ""
trigger:
  - platform: event
    event_data: {}
    event_type: rhasspy_Clima
condition: []
action:
  - service: mqtt.publish
    data:
      topic: hermes/dialogueManager/endSession
      payload_template: >-
        {"sessionId": "{{ trigger.event.data._intent.sessionId }}", "text": "El
        pronostico de hoy es: {{ states("weather.forecast")}}"}
mode: single

Could you help me?
Thank you!

I am trying to get the Forecast as Text on my UI but also nothing happens:

{% set weather = {
                'clear-night': "açık-gece",
                'cloudy': "bulutlu",
                'exceptional': "olağanüstü 🌞",
                'fog': "sisli",
                'hail': "dolu",
                'lightning': "şimşek 🌩",
                'lightning-rainy': "şimşek ve yağışlı ⛈",
                'partlycloudy': "parçalı bulutlu ⛅",
                'pouring': "sağanak yağışlı ☔",
                'rainy': "yağmurlu ☔",
                'snowy': "kar ☃️",
                'snowy-rainy': "karla karışık yağmurlu",
                'sunny': "güneşli ☀️",
                'windy': "rüzgarlı 💨",
                'windy-variant': "rüzgar varyantlı 💨"
              } %}
{% set time = now().hour %}

{% if (time > 21) %}
  Morgen werden es {{ state_attr('weather.giessen','forecast')[1].temperature }}°C und {{ state_attr('weather.giessen','forecast')[1].condition }}.
{% else %}
  Heute werden es {{ state_attr('weather.giessen','forecast')[0].temperature }}°C und {{ state_attr('weather.giessen','forecast')[0].condition }}.
{% endif %}