WU Forecast

237 views
Skip to first unread message

St. B.

unread,
Jun 8, 2019, 2:18:26 PM6/8/19
to weewx-development
Hi, 

I have made local changes to my forecast.py, to be able to parse the new WU forecast. Is there a repo somewhere to post a PR (or did I miss altogether the update f the forecast package that takes care of this)?

Regards,

Jerome Helbert

unread,
Jun 20, 2019, 11:33:56 PM6/20/19
to weewx-development
I'm not sure how the forecast module is version controlled, it doesn't seem to be a part of the main weewx github, although the wiki page there does link to its binaries. It doesn't look like Matt has updated the forecast module since Feb, so I don't think we've missed an update.

I would love a copy of your modified forecast module, I miss my WU forecasts a ton.

gjr80

unread,
Jun 21, 2019, 12:11:43 AM6/21/19
to weewx-development
Correct the forecasting extension is not part of WeeWX per se. Matthew maintains it and it is not available in a publicly accessible repo as far as I know. Unfortunately you will need to wait for Matthew to pick up on this.

Gary

St. B.

unread,
Jun 23, 2019, 10:19:23 AM6/23/19
to weewx-development
Hi, 

I can email the update forecast.py file if you want, until Matthew shows up with the appropriate code.

mwall

unread,
Jun 23, 2019, 10:25:51 AM6/23/19
to weewx-development
On Sunday, June 23, 2019 at 10:19:23 AM UTC-4, St. B. wrote:
I can email the update forecast.py file if you want, until Matthew shows up with the appropriate code.

do you mind posting it in this thread?  then i can merge it into the forecast codebase and get a new release out.

many of the older extensions i wrote (including weewx-forecast) are living in a subversion repository.  these will be moved over to gitlab repositories sometime in the next month or two.

m

St. B.

unread,
Jun 23, 2019, 11:26:52 AM6/23/19
to weewx-development
Ok, 

There you go :) 

There might be some other WU forecast information that can be used, I tried to get what I saw relevant in my use and the and also the sample forecast webpages.

With SVN you'll easily see what I changed and what I added :)


Hope it helps.

Regards,
forecast.py

St. B.

unread,
Jun 23, 2019, 12:33:01 PM6/23/19
to weewx-development
I forgot to mention that : 
  - I reused the key and location preference keys.

The location key should be like : 
   location = "geocode=45.7,5.9"

Or something alike to indicate the location of requested forecasts. The new WU API support other formats, but I did not bother looking into these.

Jerome Helbert

unread,
Jun 23, 2019, 12:56:09 PM6/23/19
to weewx-development
Awesome!

Yeah, I was just merging your changes into my local code when I ran into the geocode issue in the location. To keep compatibility with the previous version, I think the geocode= part should be in the line that assembles the url, not in the location variable itself. 
ie change:
u = '%s%s&format=json&units=e&language=en-US&apiKey=%s' % (url, location, api_key) \
to
u = '%sgeocode=%s&format=json&units=e&language=en-US&apiKey=%s' % (url, location, api_key) \

That way no one needs to change their configuration to use the new code.

Jerome Helbert

unread,
Jun 23, 2019, 1:00:01 PM6/23/19
to weewx-development
Awwww, I didn't realize the new API doesn't do hourly forecasts... that was the biggest thing I was missed from the forecast sources 

:( sad

St. B.

unread,
Jun 23, 2019, 1:01:28 PM6/23/19
to weewx-development
Hi,

Geocode in the URL was my first attempt, but I though that by keeping it in the configuration (which need patching for the new key in any cases) would make it easier to handle other cases (like using forecast for another town, using name instead of coords). My conf was using town name in the original version.

In any case a proper implementation should allow handling the various formats as stated in the API (as it did in the previous version of the extension).

++
Reply all
Reply to author
Forward
0 new messages