Skip to content

Commit

Permalink
Add Three New Data Sources!
Browse files Browse the repository at this point in the history
and a Wunderground sender, in case you don't want to use Wunderground as your source.
  • Loading branch information
leoherzog committed Apr 4, 2022
1 parent b3b962b commit eb1c8fd
Show file tree
Hide file tree
Showing 2 changed files with 542 additions and 98 deletions.
142 changes: 115 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,124 @@
# Wunderground Station Forwarder

This code is built to be hosted on the free [Google Apps Script](https://developers.google.com/apps-script) platform. It takes in weather station data from [the new Wunderground API](https://www.wunderground.com/member/api-keys) and periodically sends it on to [Windy](https://windy.com/), [PWSWeather](https://pwsweather.com/), [Weathercloud](https://weathercloud.com/), and/or [OpenWeatherMap](https://openweathermap.org/).
This code is built to be hosted on the free [Google Apps Script](https://developers.google.com/apps-script) platform. It takes in weather station data from:

- [Wunderground](https://wunderground.com/member/api-keys)
- [MyAcurite](https://myacurite.com/)
- [Davis WeatherLink](https://weatherlink.com/), or
- [WeatherFlow Tempest](https://tempestwx.com/)

and periodically sends it on to one or more of

- [Wunderground](https://wunderground.com/pws/overview)
- [Windy](https://stations.windy.com/),
- [PWSWeather](https://pwsweather.com/),
- [WeatherCloud](https://weathercloud.com/), and/or
- [OpenWeatherMap](https://openweathermap.org/stations).

## Setup

1. Create a new [Google Apps Script](https://script.google.com/) project and give it a name
2. Copy the code from [`code.gs`](https://raw.githubusercontent.com/leoherzog/WundergroundStationForwarder/master/code.gs) in this repository to your new file
3. Replace the variables in the first few lines of the code
- Retrieve your [Wunderground API key](https://www.wunderground.com/member/api-keys) and copy it to Line 7
- Type in [your Wunderground Station ID](https://www.wunderground.com/member/devices) in Line 8
- If you would like to send data to Windy,
- Set Line 9 to `true`
- Set Line 10 to [your Windy API Key](https://stations.windy.com/stations)
- Set Line 11 to [your Windy Station ID](https://stations.windy.com/stations) (likely "`0`")
- If you would like to send data to PWSWeather,
- Set Line 12 to `true`
- Set Line 13 to [your PWSWeather Station ID](https://www.pwsweather.com/stationlist.php)
- Set Line 14 to your password that you use to log into PWSWeather
- If you would like to send data to Weathercloud,
- Set Line 15 to `true`
- Set Line 16 to [your Weathercloud ID](https://app.weathercloud.net/devices)
- Set Line 17 to [your Weathercloud API Key](https://app.weathercloud.net/devices)
- Set Line 18 to whether or not you pay for Weathercloud Pro or Premium
- If you would like to send data to OpenWeatherMap,
- Set Line 19 to `true`
- Set Line 20 to [your OpenWeatherMap station's `external_id`](https://openweathermap.org/stations#create_station)
- Set Line 21 to [your OpenWeatherMap API Key](https://home.openweathermap.org/api_keys)
4. Run the "Schedule" function with **Run****Run function****Schedule**. You're done!

You can see it running in the Executions menu by going to **View****Executions**. If you ever make changes to the API keys or enabled services, just run the **Schedule** function again.

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 on Line 7 if that happens.
2. Copy the code from [`code.gs`](https://github.com/leoherzog/WundergroundStationForwarder/releases/latest/download/code.gs) from [the latest release](https://github.com/leoherzog/WundergroundStationForwarder/releases/latest) in this repository to your new file
3. Configure the script for you

- Choose your datasource:

<details>
<summary>Wunderground</summary>

Uses the [IBM Wunderground](https://wunderground.com/member/api-keys) API.

<small>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.</small>
- Set the `datasource` to `ibm` on line 10
- Set your `ibmAPIKey` on line 12
- Set your `ibmStationId` on line 13
</details>
<details>
<summary>MyAcurite</summary>
Experimental. Uses the undocumented [MyAcurite](https://myacurite.com/) 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` on line 17
- Set your `acuriteStationName` on line 18
</details>
<details>
<summary>Davis Weatherlink</summary>
Uses the [Davis Weatherlink](https://weatherlink.com/account) 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
</details>
<details>
<summary>Weatherflow Tempest</summary>
Uses a [Weatherflow Tempest Personal Use Token](https://tempestwx.com/settings/tokens).
- Set the `datasource` to `weatherflow` on Line 10
- Set your `weatherflowPUT` on line 24
- Set your `weatherflowSationId` on Line 25
</details>

- and choose one or more your forwarding destinations:

<details>
<summary>Wunderground</summary>

Sends to [Wunderground](https://support.weather.com/s/article/PWS-Upload-Protocol).

- Set `updateWunderground` to `true` on Line 29
- Set your `wundergroundAPIKey` on Line 30
- Set your `wundergroundStationId` on line 31
</details>
<details>
<summary>Windy</summary>

Sends to [Windy.com](https://community.windy.com/topic/8168/report-your-weather-station-data-to-windy).

- Set `updateWindy` to `true` on Line 33
- Set your `windyAPIKey` on Line 34
- Set your `windyStationId` on line 35. It's likely `0`, `1`, `2`, etc
</details>
<details>
<summary>PWSWeather</summary>

Sends to [PWSWeather](https://dashboard.pwsweather.com/).

- Set `updatePWSWeather` to `true` on Line 37
- Set your `pwsWeatherPassword` on line 38
- Set your `pwsWeatherStationID` on Line 39
</details>
<details>
<summary>WeatherCloud</summary>

Sends to [WeatherCloud](https://app.weathercloud.net/).

- Set `updateWeatherCloud` to `true` on Line 41
- Set your `weathercloudStationId` on line 42
- Set your `weathercloudAPIKey` on Line 43
- Set whether or not you have a WeatherCloud Pro or Premium account with `hasWeatherCloudPro` as `true` or `false` on line 44
</details>
<details>
<summary>OpenWeatherMap</summary>

Sends to [OpenWeatherMap](https://openweathermap.org/stations).

- Set `updateOpenWeatherMap` to `true` on Line 46
- Set `openWeatherMapAPIKey` to your [API Key](https://home.openweathermap.org/api_keys) on Line 47
- Set your `openWeatherMapStationId` on line 48 to [your OpenWeatherMap station's `external_id`](https://openweathermap.org/stations#create_station)
</details>

4. 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.

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`](https://github.com/leoherzog/WundergroundStationForwarder/releases/latest/download/code.gs) from [the latest release](https://github.com/leoherzog/WundergroundStationForwarder/releases/latest) in this repository to your `Code.gs` file and `💾 Save`.
2. Make sure your API Keys settings on lines 10 through 48 are correct.
3. Run the "Schedule" function again with the `▷ Run` button in the toolbar.

## License

Expand Down
Loading

0 comments on commit eb1c8fd

Please sign in to comment.