Network UPS Tools (NUT) smart home integration, free and open source

Monitor the status, load and battery runtime of the UPS devices on your NUT servers.
The Network UPS Tools (NUT) integration lets Gladys retrieve values and states from UPS devices exposed by a reachable NUT upsd server on the local network.
This integration is designed for monitoring. It does not send shutdown, restart, or configuration commands to UPS devices.
Prerequisites
Your UPS must already work in NUT. From the machine hosting Gladys, the NUT server should answer the following command, after replacing the placeholders with your own values:
upsc <ups-name>@<server-address>
By default, upsd listens on TCP port 3493. Ensure that both network rules and NUT ACLs allow access from Gladys.
Credentials travel in clear text
The integration does not use TLS (STARTTLS): the NUT username and password, and every reading, cross the network in clear text. Keep it on a trusted network:
- make
upsdlisten only on the interface Gladys reaches (LISTENinupsd.conf), and filter port 3493 so that only the Gladys host can connect; - create a dedicated user in
upsd.usersfor Gladys, with noactionsnorinstcmds: the integration only reads, so it never needs them; - never reuse that password elsewhere.
Configuration
- Open Integrations, then Network UPS Tools (NUT).
- In the Configuration tab, enter the first
upsdserver; its host is required. - Add up to four additional servers in the optional slots when needed.
- For each server, keep port
3493unless your installation uses another port. Enter NUT credentials when authentication is required. - Choose a refresh interval. The default value of 300 seconds is appropriate for most installations. Gladys polls devices once a minute at most: a longer interval is applied on the closest polling tick.
- Click Save configuration, then use Test NUT connections.
Choosing the refresh interval
Every published value is kept in the Gladys history, and a UPS exposes up to twelve values. A short interval therefore grows the database quickly: at 60 seconds, a single UPS writes around 17,000 rows per day, against around 3,500 with the default interval of 300 seconds.
To reduce that volume further, the integration only publishes the values that changed since the previous reading; a value that stayed stable is republished at least once an hour so it is never displayed as stale. Go down to 60 seconds only when you need fine-grained monitoring — the remaining runtime during an outage, for instance — and raise the interval up to 86,400 seconds when you would rather spare the database.
Once the connection succeeds, Gladys discovers every UPS returned by the NUT server. Each UPS appears under Discovered devices as a distinct Gladys device. In the Discover tab, click Add to Gladys for every UPS you want to integrate: you can add several devices independently. The list is rebuilt on each scan (Scan) from the NUT LIST UPS command.
Available information
NUT drivers do not all report the same variables, so the integration only creates sensors for information actually provided by each UPS.
| Domain | Possible values |
|---|---|
| Battery | Charge, runtime, voltage, and temperature |
| Power | Input/output voltage and current |
| Load | Load percentage, real power, and apparent power |
| UPS | Temperature, status, and alarms |
Values are published only when they are numeric and actually reported by the driver. NUT text statuses are read during communication but are not published as Gladys features, keeping the discovery payload compatible with Core versions that do not yet recognize the text category.
Widget, scenes and actions (Gladys 5.1)
The integration requires Gladys 5.1 or later.
"UPS" widget
In Dashboard → Edit → New widget, in the Integration widgets section, choose UPS, then the UPS to show. The widget displays:
- the battery charge (gauge) and the remaining runtime;
- the UPS load and the input voltage;
- a 24 h chart (battery charge and load);
- the state (on mains, on battery, low battery…), the NUT alarms, the power and the server;
- a Refresh button, which reads the UPS right away. It never sends a command to the UPS.
The widget shows the last reading the integration made (3 minutes old at most). When the UPS is slow to answer, it shows "Reading the UPS…" and updates a few seconds later.
Scene triggers
In a scene, Add trigger → Integrations:
| Trigger | When |
|---|---|
| UPS: power failure, on battery | the UPS switches to battery (OB) |
| UPS: power restored | the UPS is back on mains (OL) |
| UPS: battery low | NUT reports a low battery (LB) |
| UPS: battery to replace | NUT asks for a replacement (RB) |
- Leave the UPS field empty to react to every UPS.
- The state is checked every minute, whatever the refresh interval: a power cut is seen within a minute.
- Variables available in the scene:
ups_name,status,battery_charge(%),battery_runtime(min),load(%). - When the integration starts, the first reading is the reference: no event is sent for a UPS already on battery.
"Read a UPS status" scene action
In a scene, New action → Integrations. It reads the chosen UPS and returns to the following actions: ups_name, status (online, on_battery, low_battery, forced_shutdown, off, bypass, unknown), on_battery, low_battery, replace_battery, battery_charge, battery_runtime (min), load, input_voltage. A reading the UPS does not report is left out.
Example: every morning, read the UPS status then send a message with the remaining runtime.
Troubleshooting
| Symptom | Recommended checks |
|---|---|
| No UPS is found | Check every host, port, firewall, and that at least one UPS is configured in each ups.conf. |
| Access or authentication error | Check the ACLs in upsd.conf and credentials defined in upsd.users. |
| Some values are missing | Run upsc <ups>@<server>; Gladys can only create variables exposed by your NUT driver. |
| Stale data | A stable value is only rewritten once an hour, which is expected. Beyond that, verify that the NUT driver still communicates with the hardware and inspect the upsd logs. |
| The Gladys database grows too fast | Raise the refresh interval: the amount of history is directly proportional to it. Every UPS you add writes its own history. |
| Adding a UPS fails with "incomplete or invalid device" | Update the integration. That rejection (HTTP 422) came from features published without their min and max bounds, which are now always declared. |
| Values never change after adding the device | Update the integration: devices are now published with periodic polling enabled. |
| Some features are displayed without a name or an icon | Update the integration, then add the UPS again from the Discover tab so its existing features are updated: the load and the apparent power were published on a category/type pair the Gladys front-end does not know how to draw. |
| The connection status says "Connected, but 1 of 2 NUT servers do not answer" | The UPS of the other servers are still read. Check the named server (host, port, firewall, upsd running); the status goes back to plain "connected" at its next answer. |
| A UPS stopped updating after a server was removed from the configuration | Its server is no longer queried, which the logs say once. Add the server back, or delete the device in Gladys. |
| The UPS load is displayed as "Unknown" | Update the integration, then add the UPS again from the Discover tab: the load (ups.load) is now published on a category that lets Gladys show its name, "Load". |
For detailed errors, open the integration's Logs tab in Gladys. You can also set LOG_LEVEL=debug for more detailed logs.
Resources
The official NUT network protocol specification details the discovery and read commands used by this integration.
Configuration settings
These are the settings Network UPS Tools (NUT) asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| NUT servers | section | No | Configure one or more reachable upsd servers. Every UPS exposed by every configured server is discovered as a separate Gladys device. |
| Server 1 host | string | Yes | IP address or DNS name of the first NUT upsd server. |
| Server 1 port | number | No | The default NUT TCP port is 3493. |
| Server 1 username (optional) | string | No | |
| Server 1 password (optional) | secret | No | Required when a username is configured. |
| Server 2 host (optional) | string | No | |
| Server 2 port | number | No | |
| Server 2 username | string | No | |
| Server 2 password | secret | No | |
| Server 3 host (optional) | string | No | |
| Server 3 port | number | No | |
| Server 3 username | string | No | |
| Server 3 password | secret | No | |
| Server 4 host (optional) | string | No | |
| Server 4 port | number | No | |
| Server 4 username | string | No | |
| Server 4 password | secret | No | |
| Server 5 host (optional) | string | No | |
| Server 5 port | number | No | |
| Server 5 username | string | No | |
| Server 5 password | secret | No | |
| Refresh interval (s) | number | No | How often the readings are written to the Gladys history. Each one is a row in the database: keep 300 s unless you need finer measurements. The UPS status is still checked every minute for the scenes. |
How to install Network UPS Tools (NUT) in Gladys
- In Gladys, open Integrations: Network UPS Tools (NUT) appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/prohand/gladys-nut:2.3.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/prohand/gladys-nut.
Network UPS Tools (NUT) requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
Network UPS Tools (NUT) is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by prohand, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation