UI-Lovelace-Minimalist / UI

UI-Lovelace-Minimalist is a "theme" for HomeAssistant
https://ui-lovelace-minimalist.github.io/UI/
Other
1.57k stars 420 forks source link

Update weather entity usage due to removal of forecast property. #1492

Closed Canario0 closed 2 months ago

Canario0 commented 2 months ago

Describe the bug According to the version 2024.4 the property "forecast" has been remove in favor of the service "weather.get_forecasts" see: release.

To Reproduce Steps to reproduce the behavior:

  1. Use the popup "popup_weather_forecast"

Expected behavior Been able to open the popup and display the data.

Screenshots image

Canario0 commented 2 months ago

Solution: create a sensor to update the data.

template:
  - trigger:
      - platform: time_pattern
        hours: /6
    action:
      - service: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.aemet
        response_variable: forecast_daily
    sensor:
      - name: Weather Forecast Daily
        unique_id: weather_forecast_aemet_daily
        state: "{{ states('sensor.aemet_condition') }}"
        attributes:
          forecast: "{{ forecast_daily['weather.aemet'].forecast }}"

This code created the sensor "sensor.aemet" which I did set in the ui component as ulm_weather: "sensor.aemet" and did work without needing any update on the code side.