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,
- Ecowitt,
- aprs.fi (CWOP),
- The Things Network (LoRaWAN sensors like Dragino LHT65), 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.gsfile withcode.gsfrom 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
datasourcetoibmon line 10 - Set your
ibmAPIKeyon line 12 - Set your
ibmStationIDon line 13
MyAcurite
Experimental. Uses the undocumented MyAcurite private API.
- Set the
datasourcetoacuriteon Line 10 - Set your
acuriteUsernameon Line 15 - Set your
acuritePasswordon 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
datasourcetodavison line 10 - Set your
davisApiKeyon line 20 - Set your
davisApiSecreton line 21 - Set your
davisStationNameon line 22
Weatherflow Tempest
Uses a Weatherflow Tempest Personal Use Token.
- Set the
datasourcetoweatherflowon Line 10 - Set your
weatherflowPUTon line 24 - Set your
weatherflowSationIDon Line 25
Ambient Weather
Uses the Ambient Weather API.
- Set the
datasourcetoambienton Line 10 - Set your
ambientWeatherStationNameon line 27 - Set your
ambientWeatherApiKeyon Line 28
Ecowitt
Uses the Ecowitt.net API.
- Set the
datasourcetoecowitton Line 10 - Set your
ecowittAPIKeyfrom your Ecowitt.net Private Center on Line 30 - Set your
ecowittApplicationKeyfrom your Ecowitt.net Private Center on Line 32 - Set your
ecowittMacAddress(find in your Device List) on Line 32
aprs.fi (CWOP)
Uses the aprs.fi API to fetch APRS packet data from a CWOP station.
- Set the
datasourcetoaprson Line 10 - Set your
aprsStationIDon line 34 - Set your
aprsApiKeyon Line 35 from your aprs.fi account
The Things Network (TTN)
Uses the TTN Storage Integration API to fetch data from LoRaWAN sensors like Dragino LHT65.
Prerequisites:
- Your TTN application must have the Storage Integration enabled
- Create an API key with
Read application trafficrights in your TTN Console
Configuration:
- Set the
datasourcetottnon Line 10 - Set your
ttnClusterto your regional cluster (eu1,nam1, orau1) on line 40 - Set your
ttnApplicationIDon line 41 - Set your
ttnDeviceIDon line 42 - Set your
ttnAPIKeyon line 43 - Set your station's latitude and longitude on lines 37 and 38 in decimal degrees
Supported sensor fields:
- Dragino LHT65:
TempC_SHT,Hum_SHT,TempC_DS,BatV - Dragino LHT65N-E5:
ILL_lx(illuminance) - Generic:
temperature,humidity,pressure,illuminance,battery
Custom Data Source
Send weather station readings from any system in RTL_433 JSON format.
- Set the
datasourcetocustomon Line 10 - Set your station's latitude and longitude on lines 37 and 38 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:
Your Station ID and Station Keys are on your Wunderground Stations list.
- Set
updateWundergroundtotrueon Line 47 - Set your
wundergroundStationIDon Line 48 - Set your
wundergroundStationKeyon line 49
Windy.com
To send to Windy.com:
The Station ID and Station Password is found on your station's detail page in My Stations. This is different than the API keys found at their API Key management page.
- Set
updateWindytotrueon Line 51 - Set your
windyStationPasswordon Line 52 - Set your
windyStationIDon line 53.
Aeris PWSWeather
To send to PWSWeather:
- Set
updatePWSWeathertotrueon Line 55 - Set your
pwsWeatherAPIKeyfrom your station's profile page on line 56 - Set your
pwsWeatherStationIDon Line 57
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
updateWeatherCloudtotrueon Line 59 - Set your
weathercloudAPIKeyon Line 60 - Set your
weathercloudIDon Line 61 - Set whether or not you have a WeatherCloud Pro or Premium account with
hasWeatherCloudProastrueorfalseon line 62
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▷ Runbutton 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
updateOpenWeatherMaptotrueon Line 64 - Set
openWeatherMapAPIKeyto your API Key on Line 65 - Set your
openWeatherMapStationIdto your OpenWeatherMap station'sexternal_idon line 66
WindGuru
Send to WindGuru:
Start by registering a new "Other / Upload API" station, then:
- Set
updateWindGurutotrueon Line 68 - Set
windGuruStationUIDto your chosen station UID on Line 69 - Set your
windGuruStationPasswordto your chosen station API password (note, not your account's password) on line 70
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
updateWOWtotrueon Line 72 - Set
wowSiteIDto the generated Site ID on Line 73 - Set
wowAuthKeyto your chosen 6-Digit Authentication Key that you chose when creating or editing the Site on line 74
NOAA Citizen Weather Observer Program (CWOP)
Send to CWOP. Start by registering for a new station, then when you receive your email:
- Set
updateCWOPtotrueon Line 76 - Set
cwopStationIDOrHamCallsignto your assigned CWOP station ID that you received via email on Line 77 - If you are using your ham radio callsign as your station ID and you have received a validation code from NOAA CWOP support, set
cwopValidationCodeto your validation code on Line 78
- Set
- Run the "Schedule" function (not the "doPost" function) by selecting "Schedule" in the dropdown and pressing the
▷ Runbutton 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.gsin this release over yourCode.gsfile. - Make sure your API Keys and settings at the top of the file are correct and
💾 Save. - Run the
Schedulefunction again with the▷ Runbutton 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.
