olicooper / esphome-nspanel-lovelace-native

Custom ESPHome component for NSPanel utilising the TFT firmware of the project 'joBr99/nspanel-lovelace-ui'
Other
34 stars 6 forks source link

Weather on screensaver tries to read the 'forecast' attribute on weather entities, which has been removed from HA recently. #8

Open CultusMechanicus opened 4 months ago

CultusMechanicus commented 4 months ago

Not really an issue, but you need to point the screensaver weather at a template sensor like the one below as HA 2024.04 removed the 'forecast' attribute out to a service call for some random reason...

template:
  - trigger:
      - platform: time_pattern
        hours: /1
      - platform: homeassistant
        event: start
    action:
      - service: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.home # change to your weather entity
        response_variable: daily
    sensor:
      - name: Weather Forecast Daily
        unique_id: weather_forecast_daily
        state: "{{ states('weather.home') }}" # # change to your weather entity in this line
        attributes:
          temperature: "{{ state_attr('weather.home', 'temperature') }}" # change to your weather entity
          temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}" # change to your weather entity
          forecast: "{{ daily['weather.home'].forecast }}" # change to your weather entity
olicooper commented 4 months ago

Interesting! This change shouldn't be too hard to make, but I will lose the automatic status updates so I might have to poll the service instead now. I am on HA v4.3 so that explains why I haven't spotted this yet. Thankfully the weather service is already included in v4.3.

CultusMechanicus commented 4 months ago

Yeah, I don't quite get the reasoning they had when they moved it from an attribute on weather entities to a service call, it broke a lot of things.

olicooper commented 4 months ago

Unfortunately esphome does not support service calls with response data so I have submitted a feature request https://github.com/esphome/feature-requests/issues/2703