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