Frequently checks the weather and sends a notification to your favourite services (using Apprise) when it's about to start raining.
☔ This project requires a Pirate Weather developer account.
- Personally, I have this running on a Raspberry Pi (any model should do)
- Create a python3 virtual environment and install the project's requirements:
$ python3 -m venv rain_notifier_venv
$ source rain_notifier_venv/bin/activate
(rain_notifier_venv) $ pip install -r requirements.txt
- Open settings.py and enter your:
- Your Pirate Weather API key
- Latitude
- Longitude
- Preferred units of measurement
Units of measurement options, from the old Dark Sky docs:
auto: automatically select units based on geographic location
ca: same as si, except that windSpeed is in kilometers per hour
uk2: same as si, except that nearestStormDistance and visibility are in miles and windSpeed is in miles per hour
us: Imperial units (the default)
si: SI units
- Also in settings.py, enter where you want your notifications to be sent. See Apprise's github page for examples. An example for Telegram and Discord would look something like this:
# The list of services to notify
apprise_services = [
"tgram://bottoken/ChatID",
"discord://webhook_id/webhook_token",
]
- You should now be able to start the program:
(rain_notifier_venv) $ python main.py
By default, the program checks for rain every 10 minutes. If rain is predicted to start in the next 10-12 minutes, a notification is sent to the list of Apprise services.
It'll look something like this:
Rain starting in 11 minutes
Duration: 8 minutes
Probability: 27% chance