Skip to content

nullvoid10/fire-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fire Notifier

Introduction

This is a simple python script that sends a notification to your phone when a fire is reported to TxtFire Philippines. This uses the Pushover API to send notifications to your phone.

Requirements

  • Python 3.6+
  • A Pushover account. You can get a free account here. After creating an account, you will need to the user key and create an application to get an API token.
  • Setup your device to receive notifications from Pushover. You can download the app from the App Store or Google Play.
  • Docker (optional)

Installation

  1. Just clone this repository.

To run the script

  1. Create an virtual environment and activate it.
python -m venv venv
source venv/bin/activate
  1. Install the required packages
pip install -r requirements.txt
  1. Create a .env file in the root directory of the project and add the following environment variables.
DELAY=30
SEARCH_TERM=Quezon City
PUSHOVER_TOKEN=your_pushover_api_token
PUSHOVER_USER=your_pushover_user_key
  1. Run the script
python fire_notifier.py

To run as a docker container

  1. Build the docker image
docker build -t fire_notifier .
  1. Create a .env file in the root directory follow step 2 above.
  2. Run the docker container
docker run --name fire-notifier --env-file .env fire_notifier

To keep running even if your system restarts

docker run -d --name fire-notifier --env-file .env --restart always fire_notifier

To have persistent data

docker run -d --name fire-notifier --env-file .env --restart always -v fire_notifier_data:/app/db fire_notifier

Environment Variables

  • DELAY - The delay in seconds between each check for new fires. Default is 30 seconds.
  • SEARCH_TERM - The search term to use to filter the fire data. Example: Holy Spirit, Quezon City, Manila, etc... The default is empty string meaning it will send notification if it's a dangerous alert type regardless of the location. The value can also be a list of search terms separated by commas. Example: Quezon City,Makati,Pasig.
  • PUSHOVER_TOKEN - Your Pushover API token.
  • PUSHOVER_USER - Your Pushover user key.
  • PUSHOVER_DEVICE - The device name to send the notification to. Default is empty string which means it will send to all devices.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published