Weather.tomorrow_io_daily Problem

Ich habe mir eine Wetterkarte gebastelt.
Wenn ich die Karte antippe, öffnet sich die Wochenvorschau.


Alles läuft soweit, das Problem ist nur, dass in der Zeit von 00:00 bis 03:00 ich scheinbar keine Daten empfange und die Karte auf einen Fehler läuft, so dass nur der fehlerhafte code zu sehen ist.
Jemand eine Idee woran das liegen könnte?`

Hier der Auszug aus meiner configuration.yaml:

  - trigger:
      - platform: time_pattern
        hours: /1
      - platform: homeassistant
        event: start        
    action:
      - service: weather.get_forecasts
        target:
          entity_id:
            - weather.tomorrow_io_daily
        data:
            type: hourly
        response_variable: hourly
      - service: weather.get_forecasts
        target:
          entity_id:
            - weather.tomorrow_io_daily
        data:
            type: daily
        response_variable: daily        
    sensor:
      - name: Wetter Vorhersage alles
        unique_id: wetter_vorhersage_alles
        state: "{{ now().isoformat() }}"
        attributes:
          now_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(hourly['weather.tomorrow_io_daily'].forecast[0].condition) }}
          now_icon: >
            {% set weather = hourly['weather.tomorrow_io_daily'].forecast[0].condition %}
            {% if is_state('sun.sun', 'above_horizon') %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
            {% else %}
            {{ '/local/weather_icons/' + weather + '_night.svg' }}
            {% endif %} 
          now_wind_direction: >
            {% set direction = ['N','NNO','NO','ONO','O','OSO','SO','SSO','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}      
            {% set degree = (hourly['weather.tomorrow_io_daily'].forecast[0].wind_bearing | float) %}
            {{ direction[((degree+11.25)/22.5)|int] }}
          now_wind_desc: >
            {% from 'weather_wind.jinja' import get_wind_description %}
            {{ get_wind_description(hourly['weather.tomorrow_io_daily'].forecast[0].wind_speed | float) }}
            {% set sensor = (hourly['weather.tomorrow_io_daily'].forecast[0].wind_speed | float) %}
            {% if sensor > 0 and sensor < 0.99 %}
            Windstille
            {% elif sensor > 1 and sensor < 6.99 %}
            Leiser Zug
            {% elif sensor > 7 and sensor < 11.99 %}
            Leichte Brise
            {% elif sensor > 12 and sensor < 19.99 %}
            Schwacher Wind
            {% elif sensor > 20 and sensor < 29.99 %}
            Mäßiger Wind
            {% elif sensor > 30 and sensor < 39.99 %}
            Frischer Wind
            {% elif sensor > 40 and sensor < 50.99 %}
            Starker Wind
            {% elif sensor > 51 and sensor < 62.99 %}
            Streifer Wind
            {% elif sensor > 63 and sensor < 75.99 %}
            Stürmischer Wind
            {% elif sensor > 76 and sensor < 87.99 %}
            Sturm
            {% elif sensor > 88 and sensor < 102.99 %}
            Schwerer Sturm
            {% elif sensor > 103 and sensor < 117.99 %}
            Orkanartiger Sturm
            {% else %}
            Orkan
            {% endif %}               
          now_temp: "{{ hourly['weather.tomorrow_io_daily'].forecast[0].temperature }}"
          now_precipitation: "{{ hourly['weather.tomorrow_io_daily'].forecast[0].precipitation }}"
          now_precipitation_probability: "{{ hourly['weather.tomorrow_io_daily'].forecast[0].precipitation_probability }}"            
          now_humidity: "{{ hourly['weather.tomorrow_io_daily'].forecast[0].humidity }}"
          now_wind_speed: "{{ hourly['weather.tomorrow_io_daily'].forecast[0].wind_speed }}"
          today_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(daily['weather.tomorrow_io_daily'].forecast[0].condition) }}
          today_icon: >
            {% set weather = daily['weather.tomorrow_io_daily'].forecast[0].condition %}
            {% if is_state('sun.sun', 'above_horizon') %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
            {% else %}
            {{ '/local/weather_icons/' + weather + '_night.svg' }}
            {% endif %} 
          today_wind_direction: >
            {% set direction = ['N','NNO','NO','ONO','O','OSO','SO','SSO','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}      
            {% set degree = (daily['weather.tomorrow_io_daily'].forecast[0].wind_bearing | float) %}
            {{ direction[((degree+11.25)/22.5)|int] }}
          today_wind_desc: >
            {% from 'weather_wind.jinja' import get_wind_description %}
            {{ get_wind_description(hourly['weather.tomorrow_io_daily'].forecast[0].wind_speed | float) }}
            {% set sensor = (hourly['weather.tomorrow_io_daily'].forecast[0].wind_speed | float) %}
            {% if sensor > 0 and sensor < 0.99 %}
            Windstille
            {% elif sensor > 1 and sensor < 6.99 %}
            Leiser Zug
            {% elif sensor > 7 and sensor < 11.99 %}
            Leichte Brise
            {% elif sensor > 12 and sensor < 19.99 %}
            Schwacher Wind
            {% elif sensor > 20 and sensor < 29.99 %}
            Mäßiger Wind
            {% elif sensor > 30 and sensor < 39.99 %}
            Frischer Wind
            {% elif sensor > 40 and sensor < 50.99 %}
            Starker Wind
            {% elif sensor > 51 and sensor < 62.99 %}
            Streifer Wind
            {% elif sensor > 63 and sensor < 75.99 %}
            Stürmischer Wind
            {% elif sensor > 76 and sensor < 87.99 %}
            Sturm
            {% elif sensor > 88 and sensor < 102.99 %}
            Schwerer Sturm
            {% elif sensor > 103 and sensor < 117.99 %}
            Orkanartiger Sturm
            {% else %}
            Orkan
            {% endif %}  
          today_temp: "{{ daily['weather.tomorrow_io_daily'].forecast[0].temperature }}"
          today_precipitation: "{{ daily['weather.tomorrow_io_daily'].forecast[0].precipitation }}"
          today_precipitation_probability: "{{ daily['weather.tomorrow_io_daily'].forecast[0].precipitation_probability }}"            
          today_humidity: "{{ daily['weather.tomorrow_io_daily'].forecast[0].humidity }}"
          today_wind_speed: "{{ daily['weather.tomorrow_io_daily'].forecast[0].wind_speed }}"
          forc1_datetime: "{{ daily['weather.tomorrow_io_daily'].forecast[1].datetime }}"
          forc1_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(daily['weather.tomorrow_io_daily'].forecast[1].condition) }}
          forc1_icon: >
            {% set weather = daily['weather.tomorrow_io_daily'].forecast[1].condition %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
          forc1_temp: "{{ daily['weather.tomorrow_io_daily'].forecast[1].temperature }}"
          forc1_precipitation: "{{ daily['weather.tomorrow_io_daily'].forecast[1].precipitation }}"
          forc2_datetime: "{{ daily['weather.tomorrow_io_daily'].forecast[2].datetime }}"
          forc2_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(daily['weather.tomorrow_io_daily'].forecast[2].condition) }}
          forc2_icon: >
            {% set weather = daily['weather.tomorrow_io_daily'].forecast[2].condition %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
          forc2_temp: "{{ daily['weather.tomorrow_io_daily'].forecast[2].temperature }}"
          forc2_precipitation: "{{ daily['weather.tomorrow_io_daily'].forecast[2].precipitation }}"  
          forc3_datetime: "{{ daily['weather.tomorrow_io_daily'].forecast[3].datetime }}"
          forc3_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(daily['weather.tomorrow_io_daily'].forecast[3].condition) }}
          forc3_icon: >
            {% set weather = daily['weather.tomorrow_io_daily'].forecast[3].condition %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
          forc3_temp: "{{ daily['weather.tomorrow_io_daily'].forecast[3].temperature }}"
          forc3_precipitation: "{{ daily['weather.tomorrow_io_daily'].forecast[3].precipitation }}"  
          forc4_datetime: "{{ daily['weather.tomorrow_io_daily'].forecast[4].datetime }}"
          forc4_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(daily['weather.tomorrow_io_daily'].forecast[4].condition) }}
          forc4_icon: >
            {% set weather = daily['weather.tomorrow_io_daily'].forecast[4].condition %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
          forc4_temp: "{{ daily['weather.tomorrow_io_daily'].forecast[4].temperature }}"
          forc4_precipitation: "{{ daily['weather.tomorrow_io_daily'].forecast[4].precipitation }}"  
          forc5_datetime: "{{ daily['weather.tomorrow_io_daily'].forecast[5].datetime }}"
          forc5_condition: >
            {% from 'weather_translate.jinja' import translate_condition %}
            {{ translate_condition(daily['weather.tomorrow_io_daily'].forecast[5].condition) }}
          forc5_icon: >
            {% set weather = daily['weather.tomorrow_io_daily'].forecast[5].condition %}
            {{ '/local/weather_icons/' + weather + '.svg' }}
          forc5_temp: "{{ daily['weather.tomorrow_io_daily'].forecast[5].temperature }}"
          forc5_precipitation: "{{ daily['weather.tomorrow_io_daily'].forecast[5].precipitation }}"


Schau mal bitte nach, ob deine Wetter-Entität forecast-Attribute für die fehlenden Stunden hat.

In den 3 Stunden kommt wohl nix rein. Nicht verfügbar in der Zeit wird mir angezeigt.

Kannst ja testweise mal die Attribut-Templates rausnehmen, vielleicht ist da ein Fehler drin bzw. nur ein Attribut wird in der Zeit nicht geliefert.
Mein Sensor schaut so aus und ich bekomme 24 forecast-Attributblöcke, einen für jede nächste Stunde:

    sensor:
      - name: Temperatur-Vorhersage
        unique_id: temperatur_vorhersage
        state: "{{ now().isoformat() }}"
        attributes:
          forecast: "{{ hourly['weather.tomorrow_io_alexrenzohome_hourly']['forecast'] }}"

mit folgenden Unterattributen:

- datetime: '2025-04-08T10:00:00+00:00'
  condition: cloudy
  precipitation_probability: 0
  wind_bearing: 319
  temperature: 8.6
  dew_point: 2
  wind_speed: 16.56
  precipitation: 0
  humidity: 63

Die animierten Icons und den Rest möchte ich schon behalten.
Ist nur merkwürdig, dass ich in den 3 Stunden scheinbar keine Daten rein bekomme.

Schau dir mal deinen Vorhersage-Sensor unter Entwicklerwerkeuge / Zustände an, ob da für 0-3 Uhr alles fehlt oder nur einzelne Attribute.

Wetter Vorhersage alles geändert zu 2025-04-08T03:00:00.288263+02:00

03:00:00 - Vor 10 Stunden

Wetter Vorhersage alles wurde nicht verfügbar

00:00:00 - Vor 13 Stunden

7. April 2025

Wetter Vorhersage alles geändert zu 2025-04-07T23:00:00.297567+02:00