Ambient Weather Parser
Pinned FeaturedI made a parser for ambientweather.net which has been working for me, so I figured I'd release it so there's another PWS source option besides WUnderground.
-
I'm going to let the fixed parser run a couple update cycles on my HD-16 before I upload the changes to github. The short story is that when Ambient Weather changed their API backend and inserted Cloudflare this caused two problems: the default user-agent python uses is blacklisted/blocked by Cloudflare (http 403 error/cloudflare 1010 error), and https won't handshake with Cloudflare (the ssl library error). I fixed it up plus added more logging so the user can turn logs to debug level and verify for themselves that it's getting data.
I bought an Observer IP last year but I got busy with other stuff before I could look at it.
-
uploaded new one and works. thanks. i still noticed on the prior version that it would randomly not be installed (most likely after rainmachine reboots itself), so hoping maybe that is also resolved. :) luckily the keys stay in place after reuploading the .py file just sometimes i don't always check and it is frustrating to see it disappear after the rainmachine i guess auto reboots sometimes.
-
Thanks for working on the parser update. I didn't notice any issues until I checked my Rainmachine dashboard today and see the error. My old shell script that calls the API URL still works fine without any changes, though. Did they just change the output from their API endpoint which broke the earlier parser?
I find it handy to be able to just run this little script when I want to know the conditions on my Ambient Weather station. (This is for FreeBSD -- use curl instead of fetch):#!/bin/sh
appKey=<YOUR_APP_KEY>
apiKey=<YOUR_API_KEY>fetch -q -o - https://api.ambientweather.net/v1/devices?applicationKey=$appKey\&apiKey=$apiKey | json_pp
-
After updating to the newer parser and rebooting the RainMachine, now the error message shows
"Retrying: No data returned"
But, I can still successfully fetch the weather data JSON from the command line, which is the same local network as my RainMachine units. So I know that the API service is working, the network is working...
What might account for this error?
-
@morgan - be sure to update to the latest file form Seth at https://github.com/WillCodeForCats/rainmachine-amweather - I updated this morning and it's working fine.
-
To help the real developers and those that understand python...I noticed that if I run the API call with "&limit=1" at the end it returns no data, removing that it does return data...but a bunch of it...while it seems to work and is loaded to the Rainmachine, it might be excessive. I know the limit of 1 was working earlier today April 6 2020.
-
Cloudflare is 100% the cause of the previous problems (rainmachine ssl library can't negotiate with cloudflare, and outright blocking with a 1010 error code after that), so I wouldn't be surprised if it's a problem again. I can't look at it until tonight when I'm done with work.
Unfortunately I'm not joining any Facebook groups so the best I can do is what I've been doing. If they're set on using cloudflare now and it's going to be a recurring problem, I will refocus my efforts on looking at the Observer IP. I can try to add something to catch cloudflare errors so at least it can say "blocked by cloudflare" in the UI instead if that's the case.
-
Hi, I logged into my Mini 8 and noticed that the last date that the original parser was successfully run was 3/30/20. So I uploaded the updated parser and am now getting an error message saying "Error - No data received from server" (similar to what Robby was getting). Do I need to generate a new apikey and applicationkey in order to get this started again?
Thanks for your help!
-
OK, I deleted it and re-uploaded it today and am still getting the "Failed to run" error which is different from the old parser which generated the "no data received from server" error. This leads me to believe something may be wrong with the parser itself (not saying Seth's script is bad but maybe my version is corrupt?) Can someone help me troubleshoot this if I provide you with a log file? Thanks!!
-
Getting the following error on my RM.
I have already tried deleting and re-uploading from the UI, haven't gotten in through SSH yet but I am sure that is next.
2020-04-21 06:18:01,371 - ERROR - rmParserManager:168 - * Cannot execute parser Ambient Weather Network Parser 2020-04-21 06:18:01,373 - ERROR - rmParserManager:169 - global name 'urllib' is not defined Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 165, in run File "./RMParserFramework/rmParser.py", line 49, in timedPerform File "/rainmachine-app/RMParserFramework/parsers/user-ambientweather-parser.py", line 55, in perform query_string = urllib.urlencode(parameterList) NameError: global name 'urllib' is not defined
-
@Seth I have noticed that while the parser is showing as working on the main page dashboard I am not seeing actual rain results making it to the weather services comparison under the Rain (observed) tab.
It always reads 0.00 inches of rain observed even when there was rain observed by the ambient weather device.
Can anyone else confirm they are seeing this same issue or am I the only one?
-
Rainmachine updated to 4.0.1132 and wiped out my ambient weather parser. when trying to reload and setup it says "Error uploading ambientweather-parser.py". here are the log results.
I have tried different browsers (Google Chrome, Microsoft edge, and internet explorer) all without success. I'm using windows 10.
Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-ambientweather-parser.py", line 17, in ImportError: cannot import name convertRadiationFromWattsToMegaJoules 2020-06-05 07:16:45,497 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2020-06-05 07:16:46,687 - ERROR - rmParserManager:419 - * Error installing/loading parser user-ambientweather-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-ambientweather-parser.py' 2020-06-05 07:16:46,689 - ERROR - rmParserManager:420 - cannot import name convertRadiationFromWattsToMegaJoules
Any help would be appreciated?
Thanks
Please sign in to leave a comment.
Comments
99 comments