[BETA] [RELEASE] APC SmartUPS Status Driver v0.3.6.25
Author: @MHedish
Category: Device Drivers → Power / UPS
Complete UPS telemetry in under five seconds — no timeouts, no race conditions, stateless, and built for reliability.
This is the next driver in what's becoming my abandonware or legacy series. ![]()
Similar to what I did with @xtreme22886’s UniFi Presence (abandonware), I decided I'd take the idea behind the APC SmartUPS driver that I've been using and address some of the issues I've seen, modernize the approach, and add a bunch of features/attributes.
That driver certainly isn't abandoned, but I did start over and took a different approach to data collection and session management so I could eliminate the race condition
it has while pulling in about twice as many attributes.
Yes, I'm well aware of NUT, but I wanted to keep the control and reporting within the Hubitat environment. I even thought about integrating this with NUT server polling.
If you really need 2 second polling, that's the way to go. This driver is designed for the more "casual" (home office) user that wants to monitor and control the UPS but isn't looking for real-time data.
This driver will, as an option, automatically shut down the Habitat hub when the battery is low and you can easily write Rule Machine or WebCoRE routines to take actions based on the UPS status.
At a Glance
- Runtime: <5 seconds per telemetry cycle
- Attributes: 70+ including full NMC telemetry
- Lifecycle: Connect → Query → Parse → Finalize → Disconnect
- Telnet Management: Deterministic transient session (no idle timeout) w/watchdog
- Automation: Fully RM / WebCoRE compatible
- Control: 30-min safety enable window for power actions via GUI or RM/WC
Feature Snapshot
| Deterministic, transient Telnet lifecycle — no timeouts, no leaks | Over 2× more attributes than previous drivers, including full NMC data | Safe control model with 30-minute enable timer for critical commands | Fully compatible with Rule Machine, WebCoRE, and dashboards |
| Stateless transient context (no persistent session data) | Fast — complete telemetry cycle in under 5 seconds | Reboot, self-test, alarm, calibration | Adjustable interval & offset scheduling |
| Self-healing lifecycle — auto-recovers from closed streams | Clean session teardown prevents “telnet input stream closed” warnings and possible conflicts with Hubitat's telnet sessions when polling multiple devices | Control automatically disables after 30 min | Low hub load, no blocking waits. -80% I/O overhead |
Overview
The APC SmartUPS Status Driver provides full monitoring and control for APC Smart-UPS devices equipped with Network Management Cards (NMC) — directly from your Hubitat hub.
This production release introduces a deterministic transient Telnet session model that collects full UPS and NMC telemetry in under five seconds and then closes cleanly — eliminating the “telnet input stream closed” warnings that appear when idle Telnet sessions time out after three minutes.
All events and attributes are fully Rule Machine and webCoRE compatible, supporting reliable automations with minimal hub load.
Design Comparison & Evolution
Earlier community drivers laid the foundation for APC UPS monitoring on Hubitat — this project builds on that work with a modern, deterministic session model designed for reliability, efficiency, and clean lifecycle control.
| Aspect | Earlier Continuous Telnet Models | APC SmartUPS Status (This Driver) |
|---|---|---|
| Session Model | Persistent Telnet connection between polls | Transient, deterministic connection (connect → query → close) |
| Timeout Handling | Relies on 3-minute UPS timeout → causes “telnet input stream closed” warnings | Sessions explicitly closed after each cycle — no timeouts, no warnings |
| Race Conditions | Possible during overlapping polls or commands | Prevented — single-threaded, deterministic execution per session |
| State Management | Uses persistent state.* for temporary session data |
Uses transient in-memory context automatically cleared after each session |
| Recovery | Reconnects after error, may retain partial state | Self-healing teardown guarantees clean reconnect each cycle |
| Data Scope | Core UPS telemetry only | Expanded telemetry, including NMC identity, firmware, uptime, and OS/application info |
| Resource Load | Continuous socket overhead, serialized writes | Stateless, low I/O, <5-second runtime, zero idle sockets |
| Automation Readiness | Compatible | Fully deterministic, RM/webCoRE safe, dashboard optimized |
In short, this driver replaces passive persistence with active determinism —
each poll is a fresh, self-contained transaction with guaranteed session closure.
Key Features
Deterministic Telnet Lifecycle — connect, query, and disconnect cleanly every run
Transient Context Engine — eliminates unnecessary persistent state for faster I/O and reliability
Comprehensive Telemetry — more than twice the number of attributes of earlier implementations, including full NMC data (AOS, MAC Address, Serial Number, etc.)
No race conditions or timeout warnings — lifecycle fully event-driven and predictable
Battery, runtime, voltage, frequency, and load metrics
Automated telemetry scheduling with adjustable interval and offset
Safe control model — reboot, self-test, alarm, and calibration behind a 30-minute enable timer
RTC check — Warns when NMC and Hubitat clocks are > 5 minutes out of sync
Self-healing lifecycle — automatic recovery from Telnet or network interruptions
Detailed logging — info, warning, error, and debug tiers for full traceability
Fully compatible with Rule Machine, WebCoRE, Node-RED, and dashboards
Installation
Option 1: Hubitat Package Manager (Recommended)
- Open Hubitat Package Manager (HPM) from your Hubitat Apps list.
- Choose Install → Search by Keyword.
- Enter
UPSorSmartUPSin the search box. - Select APC SmartUPS Status from the results and install.
- Once installed, open the new device’s Preferences, configure your UPS IP, port, username, and password, then click Save Preferences.
Option 2: Manual Import and Installation
- In Hubitat, go to Drivers Code → + New Driver.
- Click Import, then paste this URL:
https://raw.githubusercontent.com/MHedish/Hubitat/refs/heads/main/Drivers/APC-SmartUPS/APC-SmartUPS-Status.groovy
- Click Import, then Save.
- Go to Devices → Add Device → Virtual, then:
- Name your device (e.g., APC SmartUPS).
- Under Type, select APC SmartUPS Status.
- Click Save Device.
- Enter your UPS IP address, Telnet port (default 23), Username, and Password under Preferences, then click Save Preferences.
Additional Documentation
Full driver documentation — including detailed architecture overview, feature explanations, attribute reference tables, and configuration parameters — is available in the project’s GitHub repository:
README.md — Detailed overview and configuration guide
CHANGELOG.md — Complete version history and release notes
These files provide deeper insight into the driver’s deterministic Telnet design, transient context engine, and self-healing lifecycle improvements over traditional persistent models.
Known Issues
My test UPS units do not report battery type or anticipated replacement date, so those attributes are currently excluded.
If you have a model that provides them and are willing to test, I’ll gladly add and verify these fields in a future update.I had been working with another user here that was testing for me but he's been busy with his day job so I haven't had a lot of feedback. Specifically, he was testing the Outlet Groups for the Symmetra line.
As with the battery type, if you have a Symmetra give this a try and let me know what's working or not.
Versioning
| Version | Status | Summary |
|---|---|---|
| 1.0.0.0 | Initial stable release; validated under sustained load and reboot recovery. | |
| 0.3.x | RC Series | Transient context development, telemetry optimization, session finalization refinements. |
Feedback
This driver has been validated against multiple APC Smart-UPS and NMC firmware versions.
Additional testers — especially those with extended attribute support (battery type, replacement date) — are welcome.
Please report feedback or findings in this thread to help continue improving the integration and I can promote this from RC to Production. ![]()
GitHub Repository:
APC SmartUPS Status (Hubitat Driver)
License: Apache License, Version 2.0
Author: @MHedish
Acknowledgments: Thanks to the Hubitat community developers whose earlier work made APC UPS integration possible.
This release builds on that foundation with a modern, deterministic architecture focused on precision, speed, and reliability.
