A mini project for observing and logging the input voltage for the APC-BR1500G ups installed.
The project's script.py
however, works with any NUT compliant
device.
The project is designed with a linux system in mind (and has been deployed to a raspberry pi device). The system published collected metrics to the thingspeak channel.
There are systemd
example units with the project, to setup the
automated activity monitor. The units require defining certain
environment values before they can be used effectively.
There is a .service
and a .timer
unit defined.
THINGSPEAK_CHANNEL_ID
: Channel id as given by thingspeak.com.THINGSPEAK_API_KEY
: Your channel generated api key with write permissions.NUT_UPS_NAME
: Name of the NUT compliant device. The device should have ainput.voltage
property.
The python file script.py
talks to the NUT server to fetch provided
device's input.voltage
variable and then forwards the same to the
thingspeak channel (field1
).
You can use ThingHTTP service to trigger an HTTP call whenever there's a powercut or low voltage, or line fluctuations etc. and send it over to a lambda function. This lambda can then send a message over to slack channel informing about the same.
SLACK_TOKEN
: The token generated for your slack bot. Generally of the formatxoxb-*
SLACK_CHANNEL
: Slack channel id where the message should be published.
Keep in mind that the message has not been configured to act as an embed. You can modify the message sent as per your requirements.