leoherzog / WundergroundStationForwarder

🌦️ Google Apps Script code to send your weather station data to Wunderground, Windy, PWSWeather, Weathercloud, OpenWeatherMap, WindGuru, and/or CWOP
42 stars 6 forks source link

ibm (wunderground) API keys #24

Open aolfish opened 2 days ago

aolfish commented 2 days ago

Weather Underground has changed they API key settings. API keys are now limited to 1500 calls per day and 30 calls per minute.

That equals 1440 Calls per day for device. I have 2 stations reporting so my daily call is 2880, which is over the limit .
Weather Underground suspends my key and starts failing. I regenerate new key and it will work for couple days then repeats.

Any way to change calling from 1 minute to 2 minutes ?

leoherzog commented 2 days ago

Classic. Ugh.

Apps Script only lets you choose every one or five minutes :(

If you change Line 107 in the code from:

if (updateWunderground) ScriptApp.newTrigger('updateWunderground_').timeBased().everyMinutes(1).create();

to:

if (updateWunderground) ScriptApp.newTrigger('updateWunderground_').timeBased().everyMinutes(5).create();
// options are every 1, 5, 10, 15 or 30 minutes
// https://developers.google.com/apps-script/reference/script/clock-trigger-builder#everyMinutes(Integer)

Minutes-based triggers dropdown options in the menu

leoherzog commented 2 days ago

There are alternative ways to schedule it every 2 minutes with a watcher function that sets exact every-two-minutes triggers, but it'd add a lot of complication to the code. Sorry 'bout that.

aolfish commented 2 days ago

Thanks Leo. May try directly from Acurite since you've updated since we first started. That would cutdown half of my daily call.

karss79 commented 4 hours ago

@aolfish: Instead of having two devices under one wunderground account, why don't you use separate WU account for each device. By this way, you may be able to overcome the WU API call limits.