Skip to content

Commit

Permalink
Add Support for Weathercloud Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
leoherzog authored Mar 29, 2022
1 parent c3d6bb8 commit 8c5f21f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ This code is built to be hosted on the free [Google Apps Script](https://develop
- 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 18 to `true`
- Set Line 19 to [your OpenWeatherMap station's `external_id`](https://openweathermap.org/stations#create_station)
- Set Line 20 to [your OpenWeatherMap API Key](https://home.openweathermap.org/api_keys)
- 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.
Expand Down
3 changes: 2 additions & 1 deletion code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const pwsWeatherPassword = 'XXXXXXXXXXX';
const updateWeathercloud = true;
const weathercloudID = 'xxxxxxxxxxxxxxxx';
const weathercloudAPIKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const hasWeatherCloudPro = false;
const updateOpenWeatherMap = true;
const openWeatherMapStationID = 'xxxxxxxxxxxxxxxx';
const openWeatherMapAPIKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
Expand All @@ -29,7 +30,7 @@ function Schedule() {
ScriptApp.newTrigger('refreshConditions_').timeBased().everyMinutes(1).create();
if (updateWindy) ScriptApp.newTrigger('updateWindy_').timeBased().everyMinutes(5).create();
if (updatePWSWeather) ScriptApp.newTrigger('updatePWSWeather_').timeBased().everyMinutes(5).create();
if (updateWeathercloud) ScriptApp.newTrigger('updateWeathercloud_').timeBased().everyMinutes(10).create();
if (updateWeathercloud) ScriptApp.newTrigger('updateWeathercloud_').timeBased().everyMinutes(hasWeatherCloudPro ? 1 : 10).create();
if (updateOpenWeatherMap) ScriptApp.newTrigger('updateOpenWeatherMap_').timeBased().everyMinutes(1).create();
console.log('Scheduled! Check Executions ☰▶ tab for status.');
checkGithubReleaseVersion_();
Expand Down

0 comments on commit 8c5f21f

Please sign in to comment.