Can we change weather state language?

Hello everyone.

I have an automation that triggered everynight at 21:00 which tells me tomorrows Forecast taken from Accuweather. The message is delivered via a telegram bot. Message content is Turkish. There are 3 states taken from Accu : temperature, condition and humidity. Temperature and Humidity are numbers so I am ok with them. But condition is in English and no matter what I do, I can’t change it to Turkish.

Here is my code :slight_smile:

service: notify.telegrambot
data:
  message: >
    Yarınki hava durumu{{ state_attr('weather.colak_ismail_2',
    'forecast')[1].temperature }} drece, hava genel olarak  {{
    state_attr('weather.colak_ismail_2', 'forecast')[1].condition }} ve rüzgarın hızıda  {{ state_attr('weather.colak_ismail_2', 'forecast')[1].wind_speed
    }} km/h

As you can see everything comes up in Turkish but not the condition. If it is rainy it says rainy. Is there a way to convert weather states in that condition to another language ?

Someone in the forum has shared a code which has to be entered into configuration yaml to change the language to Russian but that trick did not work on me.

Here is the share value template :slight_smile:

- 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 %}

What you could do is create an array with the translations that you use to translate the state.

{% set weather = {
                'clear-night': "açık-gece",
                'cloudy': "bulutlu",
                'exceptional': "olağanüstü",
                'fog': "",
                'hail': "",
                'lightning': "",
                'lightning-rainy': "",
                'partlycloudy': "",
                'pouring': "",
                'rainy': "",
                'snowy': "",
                'snowy-rainy': "",
                'sunny': "",
                'windy': "",
                'windy-variant': ""
              } %}

then in the message use it:

service: notify.telegrambot
data:
  message: >
          {% set weather = {
                'clear-night': "açık-gece",
                'cloudy': "bulutlu",
                'exceptional': "olağanüstü",
                'fog': "",
                'hail': "",
                'lightning': "",
                'lightning-rainy': "",
                'partlycloudy': "",
                'pouring': "",
                'rainy': "",
                'snowy': "",
                'snowy-rainy': "",
                'sunny': "",
                'windy': "",
                'windy-variant': ""
              } %}
    Yarınki hava durumu{{ state_attr('weather.colak_ismail_2',
    'forecast')[1].temperature }} drece, hava genel olarak  {{
    weather[state_attr('weather.colak_ismail_2', 'forecast')[1].condition] }} ve rüzgarın hızıda  {{ state_attr('weather.colak_ismail_2', 'forecast')[1].wind_speed
    }} km/h
2 Likes

İt’s very kind of you that you already changed some data into my language :slight_smile: Thank you very much. That solved my problem. I have been dealing with that for hours. Now its solved. Lovely.

I’m still learning HA and I don’t understand everything yet. I use the original HA weather card and it is also important for me that the weather state is displayed in my language.
Could you please elaborate on where to put your following codes?

thanks for this. i tried copying this list into my action and changed it to dutch. however it just skips it and keep stating it in English? i tried it in the template editor and still see it shows the english word?
Can you please tell me what im doing wrong?


thanks!

This is the part you should have used.

{{weather[state_attr('weather.colak_ismail_2', 'forecast')[1].condition] }} 

Here we use the weather variable to ask for the translation.

{{weather[states('weather.thuis')] }} 

you are the best!!! it works!

I have a question regarding the language of the condition state.
If I open the weather entity e.g. DWD weather. I see the condition state in my local language (german).

If I open the same entity with the developer tools to see the current states and atributes. The language is english.

I try to create a welcome dashboard and an english weather condition looks a little bit weird in that context


Does anybody of you have an idea what I have to change that the weather condition state will display in german?
Thx and best regards