vche / appdaemon_weatherentity

Appdaemon widget for displaying homeassistant weather entities in dashboards
GNU General Public License v3.0
11 stars 5 forks source link

Forecasts no longer work #14

Open brainrecall opened 2 months ago

brainrecall commented 2 months ago

Hi, thanks for this awesome widget. It's been a great addition, since the default AppDaemon weather widget is still stuck using the non-free Dark Sky API. Just pointing to a weather entity on HA is a smart choice and decouples the dependency.

Unfortunately, HA made some recent changes in 2024.04 and now weather forecasts are no longer attributes on the entity. They must be accessed by a service call, https://www.home-assistant.io/integrations/weather/#service-weatherget_forecasts

I'm not sure if AppDaemon can directly call a service like that, if not it might require something like a timed template or other automation to populate a different entity with the forecast data.

Has there been any work or thought on getting forecasts working again?

vche commented 2 months ago

Hi, thanks for raising this. I'm not using this anymore, so no i wasn't aware nor did I think of anything, but i'll try to have a look as soon as i can free up some time.

If you're willing to contribute you're also welcome

vche commented 2 months ago

Problem

Solution

I'll compare them when i can and push a fix

clews commented 2 months ago

For the impatient: I fixed this temporarily by using a triggered template like the one mentioned here:

https://github.com/home-assistant/core/issues/112628#issuecomment-1986196691

It works for me (replacing weather.home with sensor.weather_hourly in my dashboard widget) and it also works for daily forecast (replacing hourly by daily, i made a second template to have both):

No patch needed on the appdaemon widget for this workaround.

mad-ady commented 1 month ago

@clews thanks for pointing out the workaround. Indeed, it has worked for me as well!

One (slightly off-topic) question - you mention you're using a daily forecast template too. I'm using OpenWeatherMap, which doesn't provide daily forecasts, only hourly. Which weather provider are you using, or if using OpenWeatherMap, how are you getting daily forecasts out of it?

Thanks!