A low cost solution for automating alerting tree stewards to water their nearby unestablished trees (less than two years old) and gardens during periods of low rainfall. This application uses forecasted and recent historical weather data to determine if watering is needed. This solutions uses tomorrow.io and weatherapi.com for weather data and mailchimp for emailing alerts.
Guide for watering unestablished trees.
Copy the config-template.yaml
into a new file config.yaml
, and update the following fields:
tomorrowioApiKey
: After creating a free tomorrow.io account, find theSecret Key
here.weatherApiKey
: After creating a free weatherapi.com account, find the API Key here.mailchimp.apiKey
: After creating a free mailchimp account, create an API key here.mailchimp.templateId
: Create a template to use for alerting tree stewards to water. This is the template used in NYC you can use as a starting point.mailchimp.listId
: Use this guide to find the list/audience ID.lat
,lng
: The coordinates of where to run. You can use Google Maps to find coordinates, formatlat, lng
.
To test without sending emails, use the -test
flag while running.
The binary will need to be in the same directory as config.yaml
to run.
The application should be scheduled to run once a week to decide if an alert goes out. It is recommended to run on Fridays so tree stewards can water over the weekends. The cron for this would be 0 16 * 4-10 FRI cd /path/to && ./waterduty 1>>waterduty.log 2>&1
. Note that the application should only be run during times of the year when trees are not dormant, from early spring to early fall.
To setup automatic scheduling on a server, for macOS and linux use cron. For Windows use Task Scheduler.