Aeris forecast not displaying.

139 views
Skip to first unread message

David Barto

unread,
Apr 25, 2020, 3:23:42 PM4/25/20
to weewx...@googlegroups.com
galfert posted that you can get free Aeris forecasting:

The free Aeris Weather account is not advertised. You have to use the link I provided to get in on the special "Contributor account" only for those that contribute with their station to PWSweather.com.

This link: https://www.aerisweather.com/signup/pws/

-----
So I signed up for Aeris through the pws, and got my 2 hashes.

I added the Aeris data to weewx.conf and restarted.
The forecast page doesn't show any forecast for Aeris, while the
NWS does show up.

https://www.kdbarto.org/weather/forecast/multiple-tables.html

The log output for weewx is showing an error:
/var/log/system.log:Apr 25 11:17:16 Magrathea weewx[28709]: forecast: AerisThread: Aeris: failed attempt 1 to download forecast: HTTP Error 400: Bad Request
/var/log/system.log:Apr 25 11:17:16 Magrathea weewx[28709]: forecast: WUThread: WU: failed attempt 1 to download forecast: HTTP Error 503: Service Unavailable
/var/log/system.log:Apr 25 11:17:17 Magrathea weewx[28709]: forecast: AerisThread: Aeris: failed attempt 2 to download forecast: HTTP Error 400: Bad Request
/var/log/system.log:Apr 25 11:17:17 Magrathea weewx[28709]: forecast: WUThread: WU: failed attempt 2 to download forecast: HTTP Error 503: Service Unavailable
/var/log/system.log:Apr 25 11:17:17 Magrathea weewx[28709]: forecast: AerisThread: Aeris: failed attempt 3 to download forecast: HTTP Error 400: Bad Request
/var/log/system.log:Apr 25 11:17:17 Magrathea weewx[28709]: forecast: AerisThread: Aeris: failed to download forecast
/var/log/system.log:Apr 25 11:17:17 Magrathea weewx[28709]: forecast: AerisThread: Aeris: no forecast data for 32.983056,-117.04 from http://api.aerisapi.com/forecasts/

Clearly I've not configured something correctly. Anyone want to point out the error of my ways?

Thanks.

David

John Kline

unread,
Apr 25, 2020, 5:48:48 PM4/25/20
to weewx...@googlegroups.com
I switched from my free trial Aeris to a free one based on the thread you mention.  I got back the same client ID and secret.  It continues to work for me.

You should be able to do something like the following to test:

PYTHONPATH=/home/weewx/bin python3 bin/user/forecast.py --method Aeris --action download --client-id XXX --client-secret XXX--loc "37.431495,-122.110937"

If you could do that, you could quickly see wether the issue is that no forecast is available for the location you requested.

Alas, I notice that Aeris isn’t supported when running as main.  I added the support to do that and fixed some bugs WRT command line arguments.  I will add it to my fork, but I will need to test more.

What version of WeeWX and the forecast plugin are you running?

ALSO, PLEASE REPLY ON THE LIST RATHER THAN DIRECTLY TO ME.


On Apr 25, 2020, at 12:23 PM, David Barto <ba...@kdbarto.org> wrote:


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/B0791C0B-3281-4B24-B3BF-9C0FB08F650F%40kdbarto.org.

David Barto

unread,
Apr 25, 2020, 7:51:19 PM4/25/20
to weewx...@googlegroups.com
Running Weewx 3.9.2.
Forecast skins/forecast/skin.conf:    version = 3.3.2


Magrathea:weewx-installed katherinebarto$ PYTHONPATH=/Users/shared/weewx/bin python bin/user/forecast.py --method Aeris --action download --client-id XXX --client-secret YYY --loc “32.98265 -117.0405"

Returns:
unsupported forecast method Aeris

John Kline

unread,
Apr 25, 2020, 7:59:27 PM4/25/20
to weewx...@googlegroups.com
Here’s a diff showing the changes I had to make so that the command below will run.

Please make those changes and then run the command again pointing to your changed file.  You don’t even have to update the forecast.py that weewx is using.  This is just so that you don’t get the method not supported error below when running directly.

Of course, you also need to plug in your client-I’d and secret-key.

BTW, you didn’t have to send me this error.  I told you it wouldn’t work without modifying the code.

On Apr 25, 2020, at 4:51 PM, David Barto <ba...@kdbarto.org> wrote:

Running Weewx 3.9.2.

John Kline

unread,
Apr 25, 2020, 8:20:42 PM4/25/20
to weewx...@googlegroups.com
Yikes.  Forgot the diff.  The line numbers won’t match, but this should be easy to apply to your current forecast.py.

diff --git a/bin/user/forecast.py b/bin/user/forecast.py
index d947fb3..2254fed 100644
--- a/bin/user/forecast.py
+++ b/bin/user/forecast.py
@@ -5033,9 +5033,9 @@ if __name__ == "__main__":
                           help="specify the location")
         parser.add_option("--api-key", dest="api_key", type=str, metavar="KEY",
                           help="specify the api key")
-        parser.add_option("--client-id", dest="client-id", type=str,
+        parser.add_option("--client-id", dest="client_id", type=str,
                           metavar="ID", help="specify the client id")
-        parser.add_option("--client-secret", dest="client-secret", type=str,
+        parser.add_option("--client-secret", dest="client_secret", type=str,
                           metavar="SECRET", help="specify the client secret")
         parser.add_option("--filename", dest="filename", metavar="FILENAME",
                           help="file that contains forecast data",
@@ -5078,6 +5078,9 @@ if __name__ == "__main__":
                 fcast = AerisForecast.download(
                     options.client_id, options.client_secret, options.loc)
                 print(fcast)
+            elif options.method.lower() == 'aeris':
+                fcast = AerisForecast.download(options.client_id, options.client_secret, options.loc)
+                print(fcast)
             elif options.method.lower() == 'wwo':
                 fcast = WWOForecast.download(options.api_key, options.loc)
                 print(fcast)

On Apr 25, 2020, at 4:59 PM, John Kline <jo...@johnkline.com> wrote:



David Barto

unread,
Apr 26, 2020, 12:09:53 PM4/26/20
to weewx...@googlegroups.com
Brilliant. Now I get the forecast if I set the location to “Poway, CA.” and that works for me.
Where in the configuration for Aeris would I change the location for getting their forecast for my city?

David

John Kline

unread,
Apr 26, 2020, 12:50:38 PM4/26/20
to weewx...@googlegroups.com
Add location to the Aeris entry in weewx.conf.

    [[Aeris]]
        client_id = XXX
        client_secret = XXX
        location = "Poway, CA"

On Apr 26, 2020, at 9:09 AM, David Barto <ba...@kdbarto.org> wrote:

Brilliant. Now I get the forecast if I set the location to “Poway, CA.” and that works for me.

David Barto

unread,
Apr 26, 2020, 1:26:20 PM4/26/20
to weewx...@googlegroups.com
Well dang, set it as noted, getting the same failure.

/var/log/system.log:Apr 26 10:16:16 Magrathea weewx[51991]: forecast: WUThread: WU: failed attempt 1 to download forecast: HTTP Error 503: Service Unavailable
/var/log/system.log:Apr 26 10:16:16 Magrathea weewx[51991]: forecast: AerisThread: Aeris: failed attempt 2 to download forecast: HTTP Error 400: Bad Request
/var/log/system.log:Apr 26 10:16:16 Magrathea weewx[51991]: forecast: AerisThread: Aeris: failed attempt 3 to download forecast: HTTP Error 400: Bad Request
/var/log/system.log:Apr 26 10:16:16 Magrathea weewx[51991]: forecast: AerisThread: Aeris: failed to download forecast
/var/log/system.log:Apr 26 10:16:16 Magrathea weewx[51991]: forecast: AerisThread: Aeris: no forecast data for Poway, CA from http://api.aerisapi.com/forecasts/

I’ll just wait until 4.0 and see if that changes anything.

David

John Kline

unread,
Apr 26, 2020, 1:50:58 PM4/26/20
to weewx...@googlegroups.com
If you got that failure with weewx using the same forecast.py you used successfully from the command line, that is indeed strange.  Are you really sure you used the same client-id and secret-key in weewx.conf that you used from the command line?

The other option is that the service was temporarily down.  That’s what a 503 is.  It could actually start working for you.

And of assumes that you are trying this from the same machine where you ran the forecast from the command line.  Also assuming you don’t have intermittent network connectivity problems.

On Apr 26, 2020, at 10:26 AM, David Barto <ba...@kdbarto.org> wrote:



John Kline

unread,
Apr 26, 2020, 8:35:01 PM4/26/20
to weewx...@googlegroups.com
Hi David,

I tried this in my weewx.conf file.  You’ll need to remove the space in the location (after the comma) to get this to run.

location = "Poway,CA"

I’ll add code to encode the space on my fork (if that solves the issue), but you should be in business 3.9.2 by simply removing the space.

On Apr 26, 2020, at 10:50 AM, John Kline <jo...@johnkline.com> wrote:



David Barto

unread,
Apr 27, 2020, 7:09:34 AM4/27/20
to weewx...@googlegroups.com
I only have python installed on my weather machine/http host, and I copied the id/secret data from the weewx.conf file to the command line. So all that stayed the same.

This morning it is still reporting the same error(s).

David

David Barto

unread,
Apr 27, 2020, 7:19:55 AM4/27/20
to weewx...@googlegroups.com
Made this change, still no forecast. Bummer.

David

Reply all
Reply to author
Forward
0 new messages