Hey all. I have created a way to upload data from the awesome Weathersnoop software which runs on the Mac OS. That's the good news. The bad news is there is something not quite working yet. But appears to be 99.9% there? I am hoping for some help from all you experts. I must be missing something ridiculously simple.
Here is the scoop. (And the AppleScript code is provided further below for those interested. I am in touch will the developer for Weathersnoop and will provide them details to hopefully add Windy Upload to the product once this is working.)
Summary: I have created a station, gotten an API key, and have been uploading every 7 minutes for two+ weeks whilst trying everything to fix. The station shows on Windy, and even shows when the latest update had occurred (e.g., 3 mins ago), but no weather data.
The details: I am uploading via the API documentation:
I am getting "SUCCESS" replies back (or other messages if I try to do so under 5 mins) so I know it's communicating.
It shows within the Windy.com UI, for example (see the "pws Round Hill, Overland Park, KS" on the lower right:
However, obviously no weather data. And here is what I get as well when I go to my station:
Here is what I get when I retrieve my station data back from the API:
From: https://stations.windy.com/pws/station/[myAPIKey]/0
{"header":{"name":"Round Hill, Overland Park, KS","content":{"url":"","text":"Greg Fay"},"agl_temp":10,"agl_wind":10,"elev_m":322.48,"lat":38.97056060774817,"lon":-94.64931964874268,"stationType":"Davis Vantage Pro 2","shareOption":"Open","id":"f065e403","stationId":0,"type":"pws","updated":"2020-05-04T08:00:55.962Z","observation":{"avgFreqMin":7.054794520547945,"records":1,"avgDelayMin":5,"sumRows":146,"default":false,"latestObs":"2020-05-04T04:15:39.629Z"},"observationUpdated":"2020-05-04T04:15:39.629Z"},"data":null}
I'm assuming "data" being "null" is a bad thing. ;)
Things I've tried based on dozens of other articles of people having issues:
- Waiting days.
- Forum posts (in the wrong area I think).
- Adding stationid.
- Adding the latitude and longitude.
- Using a new API Key.
- Deleting and recreating the entire station and using the new API Key.
- Waiting weeks. ;)
FYI, here is the code. I've added lots of debugging logic to it:
tell application "WeatherSnoop 5"
tell agent of first document
--display dialog "Temp: " & value of weather property "Outdoor Temperature"
set MyAPIKey to "[myAPIKey]"
set WeatherParams to ¬
"winddir=" & value of weather property "Wind Direction" & ¬
"&windspeedmph=" & value of weather property "Wind Speed" & ¬
"&windgustmph=" & value of weather property "10 Minute Wind Gust" & ¬
"&tempf=" & value of weather property "Outdoor Temperature" & ¬
"&rainin=" & value of weather property "Day Rain" & ¬
"&baromin=" & value of weather property "Barometric Pressure (Absolute)" & ¬
"&dewptf=" & value of weather property "Outdoor Dew Point" & ¬
"&humidity=" & value of weather property "Outdoor Humidity"
set WindyURL to "curl https://stations.windy.com/pws/update/" & MyAPIKey & "?" & WeatherParams & "&stationId=0"
set WindyURLsafe to "https://stations.windy.com/pws/update/" & "MYAPIKEY" & "?" & WeatherParams & "&stationId=0"
set myResult to do shell script WindyURL
end tell
end tell
set myTime to do shell script "date "
set myString to "----------Timestamp: " & myTime & "-----------" & linefeed & WindyURLsafe & linefeed & myResult
copy myString to stdout
...and here is a sample output (intentionally showing one with a "too soon" error:
----------Timestamp: Mon May 4 13:45:16 CDT 2020-----------
https://stations.windy.com/pws/update/MYAPIKEY?winddir=120&windspeedmph=7.0&windgustmph=13.0&tempf=53.5&rainin=0.41&baromin=28.70&dewptf=49.4&latitude=-94.64931964874268&longiture=38.97056060774817&humidity=86&stationId=0
SUCCESS
----------Timestamp: Mon May 4 13:52:18 CDT 2020-----------
https://stations.windy.com/pws/update/MYAPIKEY?winddir=123&windspeedmph=9.0&windgustmph=13.0&tempf=53.8&rainin=0.41&baromin=28.69&dewptf=49.7&latitude=-94.64931964874268&longiture=38.97056060774817&humidity=86&stationId=0
SUCCESS
----------Timestamp: Mon May 4 15:09:59 CDT 2020-----------
https://stations.windy.com/pws/update/MYAPIKEY?winddir=131&windspeedmph=4.0&windgustmph=10.0&tempf=56.4&rainin=0.41&baromin=28.69&dewptf=50.6&humidity=81&stationId=0
SUCCESS
NOTICE: Measurements not inserted to database because cooldown time 4 minutes (time since previous insertion is 1.07 minutes)!
----------Timestamp: Mon May 4 15:17:00 CDT 2020-----------
https://stations.windy.com/pws/update/MYAPIKEY?winddir=129&windspeedmph=5.0&windgustmph=8.0&tempf=56.5&rainin=0.41&baromin=28.69&dewptf=50.7&humidity=81&stationId=0
SUCCESS
----------Timestamp: Mon May 4 15:24:01 CDT 2020-----------
https://stations.windy.com/pws/update/MYAPIKEY?winddir=144&windspeedmph=6.0&windgustmph=7.0&tempf=56.7&rainin=0.41&baromin=28.68&dewptf=51.3&humidity=82&stationId=0
SUCCESS
Thanks in advance!!
Greg