Weather-forecast issues in automation (weather provider: DWD)

Hi fellow Home Automators,

i’ve stumbled upon a recent problem with my daily wakeup-routine, which is pulling (or at least should be) current weather forecast-data and using it for generating textblocks, which are sent through telegram to my mobilephone.
Unfortunately since the deprecation of the old weather-forecast-function since the 2024.4-release the whole wakeup-routine doesn’t work anymore. Actually i always thought i already were sucessful in migrating the old to the new weather forecast-routines, since this breaking change first came up.
As it seems, i was wrong. :smiley:
Now i put all my hope in you guys and girls in pointing out the mistake in my automation.

Wakeup-routine (snippet):

- alias: Wakeup-routine
  trigger:
  - platform: time
    at: input_datetime.wakeup_work
  condition:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
...shortened...
  action:
    - service: weather.get_forecasts
      target:
        entity_id: weather.berlin_tempelhof
      data:
        type: daily
      response_variable: forecast
...shortened...
    - service: notify.telegram_chris
      continue_on_error: true
      data:
        message: >
          --*Wakey wakey* 🌞--
          
          Es ist {{ now().strftime('*%H:%M Uhr* (*%A*, %d %B %Y - *KW%U*)') | replace("Monday", "Montag") | replace("Tuesday", "Dienstag") | replace("Wednesday", "Mittwoch") | replace("Thursday", "Donnerstag") | replace("Friday", "Freitag") | replace("Saturday", "Samstag") | replace("Sunday", "Sonntag") | replace("January", "Januar") | replace("February", "Februar") | replace("March", "März") | replace("April", "April") | replace("May", "Mai") | replace("June", "Juni") | replace("July", "Juli") | replace("August", "August") | replace("September", "September") | replace("October", "Oktober") | replace("November", "November") | replace("December", "Dezember") }}
          
          Aktuell ist es in Berlin *{{ states.weather.berlin_tempelhof.attributes.temperature }}°C* ({% set condition = (states.weather.berlin_tempelhof.attributes.forecast[0].condition) %}{% set conditions = {'clear-night': 'Nacht, klar', 'cloudy': 'bewölkt', 'exceptional': 'außergewöhnlich', 'fog': 'Nebel', 'hail': 'Hagel', 'lightning': 'Gewitter', 'lightning-rainy': 'Gewitter mit Regen', 'partlycloudy': 'teilweise bewölkt', 'pouring': 'gießend', 'rainy': 'regnerisch', 'snowy': 'verschneit', 'snowy-rainy': 'Schnee-Regen', 'sunny': 'sonnig', 'windy': 'windig', 'windy-variant': 'ungleichmäßig windig'} %}{{ conditions[condition] }}) mit einer Luftfeuchtigkeit von *{{ states.weather.berlin_tempelhof.attributes.humidity }}%*.
         
          Tagsüber: _{{ states.weather.berlin_tempelhof.attributes.forecast[0].temperature }}°C_ / Nachts: _{{ states.weather.berlin_tempelhof.attributes.forecast[0].templow }}°C_

          {% if is_state("sun.sun", "above_horizon") -%}
          Die Sonne ist bereits vor {{ relative_time(states.sun.sun.last_changed) | replace("hours", "Stunden") | replace("minutes", "Minuten") | replace("seconds", "Sekunden") }} aufgegangen.
          {%- else -%}
          Die Sonne wird um {{ as_timestamp(state_attr('sun.sun','next_rising'),now()) | timestamp_custom('%H:%M') }} Uhr aufgehen.
          {%- endif %}
        data:
          inline_keyboard:
            - 'Danke Ich bin wach!:/awake'
...shortened...

The error message, i get is:

UndefinedError: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'forecast'

I also get several errors in another automation in detecting frosty days in the future with the exact same message:

Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'forecast' when rendering '{% set ns = namespace(date=0) %} {%- for fc in states.weather.berlin_tempelhof.attributes.forecast -%} {%- if fc.templow < 0 and ns.date == 0 -%} {%- set ns.date = fc.datetime -%} {%- endif -%} {%- endfor -%} {{ns.date}}'

My weather-provider is: Data provided by Deutscher Wetterdienst (DWD)

Interestingly my Frontend-Dashboards-Weathercharts all pulls the correct forecasting-information from the same weather provider, so i think i did something wrong here in my automation.

Thank you all for your support and best wishes
Chris

Probably the breaking change to weather forecasts:

you are fetching the results of the get_forecasts incorrectly. the result is not shoved into the target entity as an attribute. the result is return in the response_variable you specified (forecast). that’s the purpose of the response variable.

        {{ forecast['weather.berline_tempelhof'].forecast[0].temperature }}

as an example, should be what you use. instead of {{ states.wather.berline_tempelhof.attributes.forecast[0].temperature}}