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 <[email protected]> wrote: > > > 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 <[email protected]> wrote: >>> >> >> 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 >> >>> On Apr 26, 2020, at 9:50 AM, John Kline <[email protected]> wrote: >>> >>> 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 <[email protected]> wrote: >>>>> >>>> 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 >>>> >>>>> On Apr 25, 2020, at 5:20 PM, John Kline <[email protected]> wrote: >>>>> >>>>> 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 <[email protected]> wrote: >>>>>>> >>>>>> >>>>>> 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 <[email protected]> wrote: >>>>>>>> >>>>>>> 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 >>>>>>> >>>>>>>> On Apr 25, 2020, at 2:48 PM, John Kline <[email protected]> wrote: >>>>>>>> >>>>>>>> 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 <[email protected]> wrote: >>>>>>>>>> >>>>>>>>> >>>>>>>>> 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 >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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 [email protected]. >>>>>>>>> To view this discussion on the web visit >>>>>>>>> https://groups.google.com/d/msgid/weewx-user/B0791C0B-3281-4B24-B3BF-9C0FB08F650F%40kdbarto.org. >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> 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 [email protected]. >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/weewx-user/D9F2FB46-0DB0-444F-A6B1-2FA010DA09AE%40johnkline.com. >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 [email protected]. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/weewx-user/CAADAC99-1915-4991-BE1B-17A2B6494962%40kdbarto.org. >>>>> >>>>> >>>>> -- >>>>> 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 [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/weewx-user/4D096217-378D-4503-834D-4209225A78F1%40johnkline.com. >>>> >>>> >>>> -- >>>> 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 [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/weewx-user/C18B5595-C485-4CE4-BA85-3786D9413E5D%40kdbarto.org. >>> >>> >>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/weewx-user/47C38971-5964-402B-AD6E-4D7612F7697C%40johnkline.com. >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/F6F9C7FF-AD3A-4808-AC67-D719C4F3E0C4%40kdbarto.org. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/72CC0D1F-79A2-4CEF-A4A4-B346166DAE6C%40johnkline.com.
