Translate weather forecast with state_translated in a template

Hello everyone,
can someone help me how to get the following script to work?
I need the translation into German for the notification of the weather forecast, I really don’t know where to put the template state_translated.

Here is the script:

alias: Get Weather info
sequence:
  - metadata: {}
    data:
      type: daily
    target:
      entity_id: weather.forecast_home
    response_variable: tageswetter
    action: weather.get_forecasts
  - data:
      entity_id: media_player.sonos_lautsprecher_schlafzimmer
      message: >-
        Heute wird das Wetter voraussichtlich {{
        tageswetter['weather.forecast_home'].forecast[0].condition }}, mit einer
        Höchsttemperatur von {{
        tageswetter['weather.forecast_home'].forecast[0].temperature }} Grad und
        einer Tiefsttemperatur von {{
        tageswetter['weather.forecast_home'].forecast[0].templow }} Grad. Die
        maximale Windgeschwindigkeit wird bei {{
        tageswetter['weather.forecast_home'].forecast[0].wind_speed }} km/h
        liegen. Die Regenwahrscheinlichkeit liegt bei ca. {{
        tageswetter['weather.forecast_home'].forecast[0].precipitation }}%.
      cache: true
    action: tts.cloud_say
description: ""
icon: mdi:weather-cloudy

https://www.home-assistant.io/blog/2024/03/06/release-20243/#translating-states-in-your-templates

I am grateful for any help

Have you tried this suggestion?

That function accepts an entity ID string as the input and returns the translated current state of that entity. The only place that it might be used would be to replace the first sentence:

Heute wird das Wetter voraussichtlich {{state_transalted('weather.forecast_home') }}, mit einer
Höchsttemperatur von {{tageswetter['weather.forecast_home'].forecast[0].temperature }} 
Grad und einer Tiefsttemperatur von {{tageswetter['weather.forecast_home'].forecast[0].templow }} Grad. 
Die maximale Windgeschwindigkeit wird bei {{tageswetter['weather.forecast_home'].forecast[0].wind_speed }} km/h liegen. 
Die Regenwahrscheinlichkeit liegt bei ca. {{tageswetter['weather.forecast_home'].forecast[0].precipitation }}%.

Thanks a lot, yes i got it working now :slight_smile:

alias: Get Weather info
sequence:
  - metadata: {}
    data:
      type: daily
    target:
      entity_id: weather.forecast_home
    response_variable: tageswetter
    action: weather.get_forecasts
  - data:
      entity_id: media_player.sonos_lautsprecher_schlafzimmer
      message: |-
        {% set weather_condition = {
               'clear': 'und klar',
               'clear-night': 'und klare Nacht',
               'cloudy': 'bewölkt',
               'exceptional': 'und außergewöhnlich',
               'fog': 'mit Nebel',
               'hail': 'mit Hagel',
               'lightning': 'mit Gewitter',
               'lightning-rainy': 'mit Gewitter und Regen',
               'partlycloudy': 'und teilweise bewölkt',
               'pouring': 'und strömender Regen',
               'rainy': 'und regnerisch',
               'snowy': 'und verschneit',
               'snowy-rainy': 'mit Schnee und Regen',
               'sunny': 'und sonnig',
               'windy': 'und windig',
               'windy-variant': 'mit Wind und Wolken'
             } %}  
         Heute ist das Wetter voraussichtlich {{ weather_condition[tageswetter['weather.forecast_home'].forecast[0].condition]  }}, 
         mit einer Höchsttemperatur von {{
         tageswetter['weather.forecast_home'].forecast[0].temperature }} Grad
         und einer Tiefsttemperatur von {{
         tageswetter['weather.forecast_home'].forecast[0].templow }} Grad. 
         Die maximale Windgeschwindigkeit wird bei {{
         tageswetter['weather.forecast_home'].forecast[0].wind_speed }} km/h liegen.
         Die Regenwahrscheinlichkeit liegt bei ca. {{
         tageswetter['weather.forecast_home'].forecast[0].precipitation }}%.
      cache: true
    action: tts.cloud_say
description: ""
icon: mdi:weather-cloudy