bremor / bureau_of_meteorology

Custom component for retrieving weather information from the Bureau of Meteorology.
MIT License
190 stars 31 forks source link

Read first: deprecated forecast - HA 2023.9 #189

Closed purcell-lab closed 7 months ago

purcell-lab commented 1 year ago

Nice work on this integration.

I have just upgraded to HA 2023.9 beta and am receiving this error message.

HA 2023.9 is expected to be released on 6 September, at which point I would envisage you will get more users of your integration seeing this issue as it states the issue needs to be resolved before 2024.3.

image

2023-08-31 09:28:05.967 DEBUG (MainThread) [custom_components.bureau_of_meteorology] Finished fetching bureau_of_meteorology data in 0.000 seconds (success: True)
2023-08-31 09:28:05.998 WARNING (MainThread) [homeassistant.components.weather] custom_components.bureau_of_meteorology.weather::None is using a forecast attribute on an instance of WeatherEntity, this is deprecated and will be unsupported from Home Assistant 2024.3. Please report it to the custom integration author.
2023-08-31 09:28:06.006 WARNING (MainThread) [homeassistant.components.weather] custom_components.bureau_of_meteorology.weather::None is using a forecast attribute on an instance of WeatherEntity, this is deprecated and will be unsupported from Home Assistant 2024.3. Please report it to the custom integration author.
davewatson91 commented 1 year ago

This is no longer a beta, all HA users that update to 2023.9 are recieving this message.

oneseventhree commented 1 year ago

yep - there will be a flurry of us as we all update

ashmckenzie commented 1 year ago

https://github.com/bremor/bureau_of_meteorology/pull/190 seems to address this when I tested locally, am not sure if there's more to change however @bremor ?

harrisony commented 1 year ago

It's a little bit bigger of a change to implement I suspect

https://developers.home-assistant.io/blog/2023/08/07/weather_entity_forecast_types

wkeithchau commented 1 year ago

It seems like the WeatherDaily and WeatherHourly needs to get scrapped since the WeatherEntity doesn't need seperate entities for different forecast types. Is the solution to merge the two entities into one and define async_forecast_dailyand async_forecast_hourly (I believe these can be same code from WeatherDaily.forecast and WeatherHourly.forecast?).

evilmarty commented 1 year ago

Hi folks. I've put up #193 to address this issue. It keeps things AS-IS for the moment but I think longer term need a discussion on unifying WeatherDaily and WeatherHourly and what that transition looks like as it will be a breaking change.

Makin-Things commented 1 year ago

@evilmarty thanks for the work to fix this..

I have merged and created a pre-release v1.2.0. Please test and report any issues as well as any successes.

CRCinAU commented 1 year ago

Installed the update - is there supposed to be a forecast imported now?

I thought in the past it had a 7 day forecast - but I can't seem to see that anymore?

tomlut commented 1 year ago

Working for me. Thanks Simon and evilmarty.

lexiismadd commented 1 year ago

The update fixed the notice, but now the hourly forecast is missing.. Any ideas?

julianjwong commented 1 year ago

I've lost hourly and daily forecasts. Can't seem to get them back despite deleting my sensors, redownloading via HACS and setting up sensors from scratch. Any tips appreciated

Swamp-Ig commented 1 year ago

The code needs to be fixed to reenable the forecasts again. I can see how to do it but don't have time right now.

tathamoddie commented 1 year ago

No urgency here ...

I tried the v1.2.0 pre-release, and it removed the HA warning but lost forecasts.

I reverted to v1.1.21, and forecasts resumed just fine. The HA warning is that the integration needs to be updated prior to HA 2024.3, so that's a full 5 months away yet.

For anybody who wants forecasts now, just use v1.1.21 of the BOM integration.

julianjwong commented 1 year ago

No urgency here ...

I tried the v1.2.0 pre-release, and it removed the HA warning but lost forecasts.

I reverted to v1.1.21, and forecasts resumed just fine. The HA warning is that the integration needs to be updated prior to HA 2024.3, so that's a full 5 months away yet.

For anybody who wants forecasts now, just use v1.1.21 of the BOM integration.

Thanks Tatham, did the trick. I didn't think I opted in for pre releases and blindly updated to get rid of the integration warning.

purcell-lab commented 7 months ago

Looks like time is up, I had pinned to 1.1.21 of the BOM integration which has provided me forecasts.

Home Assistant 2024.4.b release seems to no longer present those forecasts ;-(

tathamoddie commented 7 months ago

I don't think you need to pin to an old version any more; I'm not.

Try BOM integration 1.3.0 with 2024.4.

Everything is back in alignment.

purcell-lab commented 7 months ago

Nice work, 1.3.0 has the BoM forecasts.

Screenshot_20240330-185743

purcell-lab commented 7 months ago

But no longer available as attributes ;-(

So I have to go from:

{{state_attr('weather.noosa_heads_hourly','forecast')}}

To something that calls a lot of services, stores those values somewhere so I can use them in an automation ;-(

image

https://community.home-assistant.io/t/petition-dont-delete-the-forecast-attribute/609298/240

tomlut commented 7 months ago

That is not the integration developer's fault.

The core HA team have implemented this method for accessing forecasts for performance reasons.