Skip to content

🌦️ Google Apps Script code to send Wunderground/MyAcurite/Weatherlink/Tempest/Ambient Weather PWS data to Wunderground, Windy, PWSWeather, Weathercloud, OpenWeatherMap, WindGuru, and/or CWOP

leoherzog/WundergroundStationForwarder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 

Repository files navigation

Station Forwarder

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

Setup

  1. Create a new Google Apps Script project and give it a name
  2. Overwrite the default Code.gs file with code.gs from the latest release in this repository
  3. 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 to ibm 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 to acurite 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 to davis 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 to weatherflow 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 to ambient on Line 10
    • Set your ambientWeatherStationName on line 27
    • Set your ambientWeatherApiKey on Line 28
  • and choose one or more forwarding destinations:

    IBM Wunderground

    To send to Wunderground:

    • Set updateWunderground to true on Line 32
    • Set your wundergroundAPIKey on Line 33
    • Set your wundergroundStationId on line 34
    Windy.com

    To send to Windy.com:

    • Set updateWindy to true on Line 36
    • Set your windyAPIKey on Line 37
    • Set your windyStationId on line 38. It's likely 0, 1, 2, etc.
    Aeris PWSWeather

    To send to PWSWeather:

    • Set updatePWSWeather to true on Line 40
    • Set your pwsWeatherAPIKey from your station's admin page on line 41
    • Set your pwsWeatherStationID on Line 42
    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 to true on Line 44
    • Set your weathercloudStationId on line 45
    • Set your weathercloudAPIKey on Line 46
    • Set whether or not you have a WeatherCloud Pro or Premium account with hasWeatherCloudPro as true or false on line 47
    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:

    WindGuru

    Send to WindGuru:

    Start by registering a new "Other / Upload API" station, then:

    • Set updateWindGuru to true on Line 53
    • Set windGuruStationUID to your chosen station UID on Line 54
    • Set your windGuruStationPassword to your chosen station API password (note, not your account's password) on line 55
    NOAA Citizen Weather Observer Program (CWOP)

    Send to CWOP. Start by registering for a new station, then when you receive your email:

    • Set updateCWOP to true on Line 57
    • Set cwopStationIDOrHamCallsign to your assigned CWOP station ID that you received via email on Line 58
    • 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 59
  1. Run the "Schedule" function with 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.

How to Update

  1. Copy the code from code.gs in this release over your Code.gs file.
  2. Make sure your API Keys and settings at the top of the file are correct and 💾 Save.
  3. Run the Schedule function again with the ▷ Run button in the toolbar.

License

Feel free to take a look at the source and adapt as you please. This source is licensed as follows:

Creative Commons License

Station Forwarder is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Buy Me A Tea Found this helpful? Buy me a tea!