Skip to content

Plugin ups adj

Martin Pihrt edited this page Oct 13, 2026 · 1 revision

UPS Monitor

Monitors mains power and can notify, shut down OSPy and switch off a UPS after a sustained outage.

At a glance

Item Value
Version 1.0.5
Category Hardware, displays and outputs
Author Martin Pihrt
License GPL-3.0
OSPy 3.0.211 or newer
Python 3.8 or newer
Permissions files, gpio, email, system
Hardware platforms: raspberry_pi; interfaces: gpio
Dependencies Database Connector (optional)
Python/OS packages RPi.GPIO / python3-rpi.gpio (required)
Interfaces Mobile API v1
Source Open the plug-in directory

What it is for

Monitors mains power and can notify, shut down OSPy and switch off a UPS after a sustained outage.

How it works and how to configure it

Tested in Python 3+

The plug-in includes a plugin.json manifest and reports its worker, power-line input, automatic shutdown setting, countdown and delay, latest check and errors through the OSPy system health interface. The UPS shutdown output is returned low when the plug-in stops.

UPS Uninterruptible Power Supply (Source) This plugin checked power line for system. If a power-line fault lasts for the configured time, the plug-in can send an E-mail and automatically shut down the system and UPS.

Plugin setup

  • Check Use UPS: If checked use UPS plugin is enabled.

  • Check Send email with error: If checked send email with error e-mail notification plugin sends e-mail with error. For this function required e-mail notification plugin with all setup in plugin.

  • Automatic system shutdown: Enabled by default to preserve the existing plug-in behaviour. Disable it to continue monitoring, logging and sending E-mail notifications without shutting down OSPy and without sending the UPS shutdown pulse.

  • Max time for shutdown countdown: Type maximum certain time to shutdown system and UPS. Maximum time is 999 minutes.

  • Power line state: Actual state on the Power line.

  • Status: Status window from the plugin.

  • Enable local logging: Enable logging and graphing.

  • Check Enable SQL logging: If checked enabled logging save measure value to SQL database. This option requires the Database Connector extension to be installed and configured. The button will delete the upsmonitor table from the database, thus deleting all saved data from this extension! This promotion is non-refundable!

  • Graph history Use quick ranges (Today, 24 h, 7 days, 30 days, All) or set a custom From/To range. The graph refreshes without reloading the settings page.

Power line is connected via optocoupler between GPIO 23 - pin 16 and ground. When automatic shutdown is enabled, the output pulse on GPIO 24 - pin 18 (via optocoupler open collector and ground) shuts down the UPS battery.

The hardware should be connected as follows:

Recommend using optocoupler between GPIO and UPS. Visit Martin Pihrt's blog. for more information.

In-app help and settings notes

The following notes are generated from the help page shipped with this plug-in. Field names are also explained directly in the OSPy settings page.

This plugin checked power line for system. UPS (uninterrupted power supply).

When a power-line fault lasts for the configured time, the plug-in can send an E-mail and automatically shut down OSPy and the UPS.

Disable Automatic system shutdown to keep monitoring, logging and E-mail notifications active without shutting down OSPy or sending the UPS shutdown pulse.

When automatic shutdown is enabled, GPIO 24 - pin 18 provides the UPS battery shutdown pulse through an optocoupler open collector and ground.

If logging is enabled, a graph with measured data will be displayed at the bottom of the screen

Voltage input is connected to Raspberry Pi header

On the main OSPy board by pihrt.com is already installed connector for this input probe and output pulse.

Related links and diagrams

schematics

Support

Check OSPy → Diagnostics first and remove passwords, tokens, private addresses and other secrets before sharing logs. Report reproducible plug-in problems in the OSPy-plugins issue tracker.

Back to the plug-in catalog

Clone this wiki locally