This code is built to be hosted on the free Google Apps Script platform. It takes in weather station data from:
- IBM Wunderground,
- MyAcurite,
- Davis WeatherLink,
- WeatherFlow Tempest,
- Ambient Weather,
- aprs.fi (CWOP), or
- a custom data source in RTL_433 JSON format,
and periodically sends it on to
- IBM Wunderground,
- Windy.com,
- Aeris PWSWeather,
- WeatherCloud,
- OpenWeatherMap,
- WindGuru,
- MET (UK) WOW and/or
- NOAA CWOP.
- Create a new Google Apps Script project and give it a name
- Overwrite the default
Code.gs
file withcode.gs
from the latest release in this repository - Configure the script for you:
-
Choose your datasource:
IBM Wunderground
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.
- Set the
datasource
toibm
on line 10 - Set your
ibmAPIKey
on line 12 - Set your
ibmStationID
on line 13
MyAcurite
Experimental. Uses the undocumented MyAcurite private API.
- Set the
datasource
toacurite
on Line 10 - Set your
acuriteUsername
on Line 15 - Set your
acuritePassword
on line 16 - Set your
acuriteHubName
(the user-set name on the internet-connected receiver) on line 17 - Set your
acuriteStationName
(the user-set name of the outdoor sensor/station) on line 18
Davis Weatherlink
Uses the Davis Weatherlink API v2.
- Set the
datasource
todavis
on line 10 - Set your
davisApiKey
on line 20 - Set your
davisApiSecret
on line 21 - Set your
davisStationName
on line 22
Weatherflow Tempest
Uses a Weatherflow Tempest Personal Use Token.
- Set the
datasource
toweatherflow
on Line 10 - Set your
weatherflowPUT
on line 24 - Set your
weatherflowSationID
on Line 25
Ambient Weather
Uses the Ambient Weather API.
- Set the
datasource
toambient
on Line 10 - Set your
ambientWeatherStationName
on line 27 - Set your
ambientWeatherApiKey
on Line 28
aprs.fi (CWOP)
Uses the aprs.fi API to fetch APRS packet data from a CWOP station.
- Set the
datasource
toaprs
on Line 10 - Set your
aprsStationID
on line 30 - Set your
aprsApiKey
on Line 31 from your aprs.fi account
Custom Data Source
Send weather station readings from any system in RTL_433 JSON format.
- Set the
datasource
tocustom
on Line 10 - Set your station's latitude and longitude on lines 33 and 34 in decimal degrees
- Click
Deploy ▼
→ New deployment → '⚙' → Web app, and change 'Who has access' to 'Anyone' and press 'Deploy' - Begin HTTP POSTing JSON data to the
https://script.google.com/macros/...
URL provided in the confirmation dialog
- Set the
-
and choose one or more forwarding destinations:
IBM Wunderground
To send to Wunderground:
- Set
updateWunderground
totrue
on Line 38 - Set your
wundergroundAPIKey
on Line 39 - Set your
wundergroundStationID
on line 40
Windy.com
To send to Windy.com:
- Set
updateWindy
totrue
on Line 42 - Set your
windyAPIKey
on Line 43 - Set your
windyStationID
on line 44. It's likely0
,1
,2
, etc.
Aeris PWSWeather
To send to PWSWeather:
- Set
updatePWSWeather
totrue
on Line 46 - Set your
pwsWeatherAPIKey
from your station's profile page on line 47 - Set your
pwsWeatherStationID
on Line 48
WeatherCloud
To send to WeatherCloud:
Retrieve your station's ID and API Key by going to your Devices, then clicking Settings → 🔌 Link on your station.
- Set
updateWeatherCloud
totrue
on Line 50 - Set your
weathercloudAPIKey
on Line 51 - Set your
weathercloudID
on Line 52 - Set whether or not you have a WeatherCloud Pro or Premium account with
hasWeatherCloudPro
astrue
orfalse
on line 53
OpenWeatherMap
Creation 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:- Set
updateOpenWeatherMap
totrue
on Line 55 - Set
openWeatherMapAPIKey
to your API Key on Line 56 - Set your
openWeatherMapStationId
to your OpenWeatherMap station'sexternal_id
on line 57
WindGuru
Send to WindGuru:
Start by registering a new "Other / Upload API" station, then:
- Set
updateWindGuru
totrue
on Line 59 - Set
windGuruStationUID
to your chosen station UID on Line 60 - Set your
windGuruStationPassword
to your chosen station API password (note, not your account's password) on line 61
Met (UK) WOW
Send to The Met Office's Weather Observations Website:
Start by registering a new Site. During registration, one of the fields in your Site's options is "Authentication Key". Choose any 6-Digit number. Then:
- Set
updateWOW
totrue
on Line 63 - Set
wowSiteID
to the generated Site ID on Line 64 - Set
wowAuthKey
to your chosen 6-Digit Authentication Key that you chose when creating or editing the Site on line 65
NOAA Citizen Weather Observer Program (CWOP)
Send to CWOP. Start by registering for a new station, then when you receive your email:
- Set
updateCWOP
totrue
on Line 67 - Set
cwopStationIDOrHamCallsign
to your assigned CWOP station ID that you received via email on Line 68 - If you are using your ham radio callsign as your station ID and you have received a validation code from NOAA CWOP support, set
cwopValidationCode
to your validation code on Line 69
- Set
- Run the "Schedule" function (not the "doPost" function) by selecting "Schedule" in the dropdown and pressing the
▷ 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.
- Copy the code from
code.gs
in this release over yourCode.gs
file. - Make sure your API Keys and settings at the top of the file are correct and
💾 Save
. - Run the
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.