esphome / esphome/feature-requests

Generic UPS monitoring - NUT implementation

Open
#1,785 32 comments 38 reactions 0 assignees View on GitHub
Type: Power Meter
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**
[Network UPS Tools](https://networkupstools.org/) is a respected project with great experience in handling various power devices, such as uninterruptible power supplies, power distribution units, solar controllers and servers power supply units.

The whole project is written in C. Best part is that it supports a plethora of UPS types connected via [GPIO (contact closure)](https://networkupstools.org/docs/man/nutupsdrv.html) or [RS232 serial (most of them)](https://networkupstools.org/docs/man/nutupsdrv.html). This is all perfect to be used with microcontrollers supported by ESPHome.

NUT is mostly written to run on a Linux OS with the concept of various processes handled as standard separate Linux "daemons" which can trigger various "scripts" based on event information gathered from the UPS device.

My suggestion is in order to avoid reinventing the wheel, to cherry-pick from the "driver" part of it (which is actually not a real driver, just a message parser) the models/protocols which can be usable in ESPHome and implement them as sensors (mostly input/output voltage/current, power, load percentage, battery percentage, charging status etc).
Some UPSes allow to be controlled (typically turning OFF/ON loads, trigger battery checks etc.) these could be just implemented as switches/buttons.
Since NUT is written in C, it's very likely that code porting could be feasible.

We don't need the rest of NUT (like CGI web GUI; monitoring daemons etc), as ESPHome already has powerful automation features which can be used with sensors/switches, and more advanced stuff can be done the usual way via HA system.

We only need the sensors/switches based on [protocols](https://networkupstools.org/ups-protocols.html) seen in NUT drivers section.

**Please describe your use case for this integration and alternatives you've tried:**
N/A

**Additional context**
For example APC:
https://networkupstools.org/protocols/apcsmart.html
https://kirbah.github.io/apc-ups/Smart-protocol/

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the Network UPS Tools driver section and the linked UPS protocols, including the APC Smart protocol examples. Define a limited set of protocols and supported measurements or controls before implementation; done would mean those protocols expose the requested sensors or switches in ESPHome without the NUT daemons or web interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.