Skip to content

Generate a Divera24/7 alert using a RaspberryPi3 and a digital pager

License

Notifications You must be signed in to change notification settings

jan4401/divera-pi_alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry PI to Divera 24/7 alert Project

This project has the following functionalities:

  1. Read GPIO to check for alert on DME station
  2. Request Divera24/7 WebAPI

GPIO Functionality

Reads GPIO that is specified in config file as input. If GPIO changes from low to high, an alert will be triggered at DIVERA24/7.

DIVERA24/7 API

A HTTPS GET request is sent to the DIVERA24/7 Web API to trigger an alert. I used the python3 requests bib (installation: pip3 install requests).

Config file

The config file is located in the static directory

  • hardware: Reading GPIO Port
  • webapi: DIVERA24/7 API Key
  • request: HTTP GET

The path of the config file is hard coded into the Python script: /opt/divera-pi_alert/static/config.json

Hardware Specification

This project is using a Raspberry PI3 that is connected with an Oelmann LX4 home station. One GPIO has to be in reading mode and is connected to the relay output of the LX4 home station. If the relay is closed by an alert, the GPIO state changes from LOW to high and a request to DIVERA24/7 Web API is triggered. The reading/input GPIO must be connected to a pull down resistor (e.g. 100kOhm) that connects the GPIO to the Raspberry PI Ground. The GPIO Pin is configured in the config file.

Installation

  1. Git clone Repository into /opt directory
  2. Execute /opt/divera-pi_alert/static/setup.sh with sudo
  3. Check SystemD service: systemctl status pialert service
  4. Change config file and add Auth Token: /opt/divera-pi_alert/static/config.json
  5. Service restart: systemctl restart pialert

Autostart and SystemD service management

SystemD is used to manage the pialert service. The script setup.sh enables the service to start automatically after booting (systemctl enable pialert).

  • Service stop: systemctl stop pialert
  • Service start: systemctl start pialert
  • Service restart: systemctl restart pialert

Log File

A log file should be generated in /opt/divera-pi_alert/pialert.log.

Other Information

  • After calling the Web API a 120 seconds sleep is implemented
  • Alert Type is not set by the API if you use the free version (you have to configure in web GUI)

External Information/Documentation

About

Generate a Divera24/7 alert using a RaspberryPi3 and a digital pager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published