kotope / esphome_eink_dashboard

Home Assistant Dashboard for LilyGO T5 4.7 E-Ink display
62 stars 7 forks source link

weather forecast broken with HA Release 2024.4.3 #3

Open fhb opened 4 months ago

fhb commented 4 months ago

The weather forecast attribute has been removed with Release 2024.4.3 - April 12, any plans on updating the yaml? Otherwise I'll try to recreate it with the current implementation.

"The previously deprecated forecast attribute of weather entities, has now been removed. Use the weather.get_forecasts service to get the forecast data instead."

Edit: you don't have to change anything. I just added the following code to my configuration.yaml

template:
  - trigger:
    - platform: state
      entity_id: weather.forecast_home
    - platform: homeassistant
      event: start
    - platform: event
      event_type: event_template_reloaded
    action:
      - service: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.forecast_home
        response_variable: daily
    sensor:
      - name: Weather metno Daily Forecast
        unique_id: weather_forecast_metno_daily
        state: "{{ states('weather.forecast_home') }}"
        attributes:
          forecast: "{{ daily['weather.forecast_home'].forecast }}"

and changed part of the esphome yml to

- platform: homeassistant
    entity_id: sensor.weather_metno_daily_forecast
    attribute: forecast
    id: w_forecast
    internal: true
kotope commented 4 months ago

Hi!

Yes, that's correct. I fixed it on my environment like that as well, but have not pushed the change in here yet.