pirate-weather-ha icon indicating copy to clipboard operation
pirate-weather-ha copied to clipboard

Wind Gust Forecast

Open jhemak opened this issue 11 months ago • 6 comments

Describe the feature

Would it be possible to add wind_gust to the hourly forecast?

Home Assistant version

No response

Integration version

No response

Acknowledgements

  • [X] I have searched this repository and API Repository to see if the feature has already been requested.
  • [X] This featre request is sepecific to the HA Integration.
  • [X] I have written an informative title.

jhemak avatar Mar 10 '24 05:03 jhemak

I've created a beta release (v1.4.5) which should add wind gusts to the forecasts. If everything is working without issue then I'll merge in the changes and release the stable version later today.

cloneofghosts avatar Mar 10 '24 17:03 cloneofghosts

Wow, you are fast! I'll take a look ASAP this week and let you know. Thank you!

jhemak avatar Mar 11 '24 11:03 jhemak

Beta looks good, however two comments/questions:

(1) There are some hours where the wind_gust_speed is less than the wind_speed. Does that make sense? Could it possibly be coming across with the wrong units? The historical sensors do not have this issue.

(2) Do you happen to know if there is a way to request (or store) only the next X hours of forecasts when setting up the template sensor vs. all the many hours that come back as attributes in the response by default?

Thank for the speedy help and good work on this!!

jhemak avatar Mar 11 '24 21:03 jhemak

Thanks for testing. I'm going to merge in the changes and then release the stable version. As for your questions:

  1. I checked the API for my location and I do see some hours where the wind gusts are lower than the wind speed. I saw it occur on the 70th forecast hour. At that point the model used switched from HRRR to GFS. I would assume this is something related to the weather model used and is more of an issue with the API itself rather than a HA issue.
  2. You're talking about setting up a template using weather.get_forecasts? If so you can change the forecast attribute to something like this forecast: "{{ hourly['weather.pirateweather'].forecast[:24] }}" and it will only give you an hourly forecast for the next 24h. Change 24 to the number of forecast hours you wish to get in the template.

cloneofghosts avatar Mar 11 '24 22:03 cloneofghosts

Awesome - thanks for the second tip! As for the first issue, you are probably right. Unfortunately, there does seem to be something strange going on with the forecasted wind gust data.

What I plotted in HA:

image

What is currently shown on Merry Sky:

image

Among the strange things... the Merry Sky view shows gusts up to 34mph but what I see in HA goes up to only 14.5. Perhaps it's due to caching on their end, I'm not sure. It's also a bit odd the disconnect between history and forecast at the point of transition.

jhemak avatar Mar 12 '24 00:03 jhemak

Looking at your graph it seems like it isn't converting the wind gusts from m/s to mph. If I convert 14.5 m/s to mph I get 32.43558 mph which is close to what Merry Sky is showing you.

What I find really weird is the wind gusts are being converted to mph in the current conditions and not the forecasts. It's quite possible that I missed something when I set this up. I'll try and take a look later to see if I can figure anything out but I'll also ping @alexander0042 to see if he can take a look as well.

cloneofghosts avatar Mar 12 '24 14:03 cloneofghosts

Any discoveries as of yet?

jhemak avatar Mar 15 '24 21:03 jhemak

I actually was able to figure out what the issue was thanks to the future branch. I will release a new version with the fix shortly. The beta version with the fix uses the V2 beta API.

cloneofghosts avatar Mar 16 '24 01:03 cloneofghosts

New version released which should hopefully fix this issue for you.

cloneofghosts avatar Mar 16 '24 01:03 cloneofghosts

You are the man! Looks great now. Thanks a ton!

jhemak avatar Mar 16 '24 01:03 jhemak