🌦️ Google Apps Script code to send your weather station data to Wunderground, Windy, PWSWeather, Weathercloud, OpenWeatherMap, WindGuru, and/or CWOP
This code is built to be hosted on the free Google Apps Script platform. It takes in weather station data from:
and periodically sends it on to
Code.gs
file with code.gs
from the latest release in this repositoryChoose your datasource:
Uses the IBM Wunderground API.
Note: Unfortunately, it looks like the new Wunderground API keys have started expiring 6 months after being generated, so you may need to replace the key if that happens.
datasource
to ibm
on line 10ibmAPIKey
on line 12ibmStationId
on line 13Experimental. Uses the undocumented MyAcurite private API.
datasource
to acurite
on Line 10acuriteUsername
on Line 15acuritePassword
on line 16acuriteHubName
(the user-set name on the internet-connected receiver) on line 17acuriteStationName
(the user-set name of the outdoor sensor/station) on line 18Uses the Davis Weatherlink API v2.
datasource
to davis
on line 10davisApiKey
on line 20davisApiSecret
on line 21davisStationName
on line 22Uses a Weatherflow Tempest Personal Use Token.
datasource
to weatherflow
on Line 10weatherflowPUT
on line 24weatherflowSationId
on Line 25Uses the Ambient Weather API.
datasource
to ambient
on Line 10ambientWeatherStationName
on line 27ambientWeatherApiKey
on Line 28Uses the aprs.fi API to fetch APRS packet data from a CWOP station.
datasource
to aprs
on Line 10aprsStationID
on line 30aprsApiKey
on Line 31 from your aprs.fi account
and choose one or more forwarding destinations:
To send to Wunderground:
updateWunderground
to true
on Line 35wundergroundAPIKey
on Line 36wundergroundStationId
on line 37To send to Windy.com:
updateWindy
to true
on Line 39windyAPIKey
on Line 40windyStationId
on line 41. It's likely 0
, 1
, 2
, etc.To send to PWSWeather:
updatePWSWeather
to true
on Line 43pwsWeatherAPIKey
from your station's profile page on line 44pwsWeatherStationID
on Line 45To send to WeatherCloud:
Retrieve your station's ID and API Key by going to your Devices, then clicking Settings → 🔌 Link on your station.
updateWeatherCloud
to true
on Line 47weathercloudAPIKey
on Line 48weathercloudID
on Line 49hasWeatherCloudPro
as true
or false
on line 50Creation of a new OpenWeatherMap station must be done by API, not on the OpenWeatherMap website. More information is available in the OpenWeatherMap Station API documentation. The basic concept for what must be done is available in the createNewOWMStation_()
function. Remove the _
character from the name of that function to make it selectable from the ▷ Run
button in the toolbar. If you do so, make sure you note your new station's ID and other details in the log (available in the Executions tab in the sidebar after running!), then:
updateOpenWeatherMap
to true
on Line 52openWeatherMapAPIKey
to your API Key on Line 53openWeatherMapStationId
to your OpenWeatherMap station's external_id
on line 54Send to WindGuru:
Start by registering a new "Other / Upload API" station, then:
updateWindGuru
to true
on Line 56windGuruStationUID
to your chosen station UID on Line 57windGuruStationPassword
to your chosen station API password (note, not your account's password) on line 58Send to CWOP. Start by registering for a new station, then when you receive your email:
updateCWOP
to true
on Line 60cwopStationIDOrHamCallsign
to your assigned CWOP station ID that you received via email on Line 61cwopValidationCode
to your validation code on Line 62▷ Run
button in the toolbar. You're done! You can see it periodically running in the ☰▶
Executions tab on the left sidebar. This code is executed on Google's servers and does not require a computer to remain on.If you ever make changes to the API keys or enabled services, just run the Schedule function again.
code.gs
in this release over your Code.gs
file.💾 Save
.Schedule
function again with the ▷ Run
button in the toolbar.Feel free to take a look at the source and adapt as you please. This source is licensed as follows:
Station Forwarder is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.