dear all,
I am trying to translate values from open-meteo into german using template integration.
this is the information I get from open-meteo:
temperature: 16.2
wind_bearing: 5
wind_speed: 7.6
forecast:
- datetime: '2022-05-07'
condition: rainy
precipitation: 0.33
temperature: 16.8
templow: 8.8
wind_bearing: 56
wind_speed: 13.6
- datetime: '2022-05-08'
condition: cloudy
precipitation: 0
temperature: 16.3
templow: 8.9
wind_bearing: 77
wind_speed: 16.2
this is my configuration
- platform: template
sensors:
openmeteo_currentday_condition_german:
unique_id: openmeteo_currentday_condition_german
friendly_name: 'Wetterlage heute'
value_template: >
{% set cond = state_attr('weather.open_meteo', 'forecast')[0].condition %}
{% if cond = 'rainy' %}
regnerisch
{% elif cond = 'cloudy' %}
bewölkt
{% endif %}
and this is the error:
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token 'end of statement block', got '=') for dictionary value @ data['sensors']['openmeteo_currentday_condition_german']['value_template']. Got "{% set cond = state_attr('weather.open_meteo', 'forecast')[0].condition %} {% if cond = 'rainy' %}\n regnerisch\n{% elif cond = 'cloudy' %}\n bewölkt\n{% endif %}\n". (See ?, line ?).
Can somebody help me solving this issue?
Thanks a lot!