The outlet watts on the topology page were wrong, and the cause is upstream. UniFi's stat/device keeps serving one frozen set of USP PDU Pro outlet readings, while the unit's total (outlet_ac_power_consumption) stays live:
Every outlet reports 120.661 V, and the watts are identical to three decimals all session.
Those frozen outlets add up to about 321 W, against a live total of 593 W.
The UPS 2U Pro's outlets are live.
The integration v1 and v2 device APIs have no per-outlet power to use instead.
Gandalf now stops presenting frozen numbers as if they were live.
What changes
monitor.py:LinkStatsCollector._mark_stale_outlets fingerprints each power unit's metered outlet readings (watts and amps) on every poll. If they haven't changed for 15 minutes and at least one outlet draws power, it marks every metered outlet stale and sets outlets_stale_since on the device. Units whose outlets all read 0 and unmetered units (the USP Strip) are never flagged.
topology.py: passes stale through on each outlet and in power_in, and adds stale_since per source.
Topology page:
outlet rows say "stale" instead of watts
the ⚡ badge says "fed" instead of a number
feed lines say "(watts stale)"
a "to look at" chip reads "RPDU outlet watts frozen since HH:MM; its total is live"
Device page: the outlet table puts a "stale" badge on each reading and adds a note above it. The faceplate hover text says "(stale reading)".
USP Strip (UP6) faceplate:
traced from the render in Ubiquiti's datasheet and sized from its 229.5 x 111.5 mm footprint
three facing pairs of US outlets (1/2, 3/4, 5/6), four USB-C ports (UniFi outlet 7, "USB Outlets"), the U logo, the status LED and the cord
used on the topology card and on the strip's device page
Tests
Results: 479 passed; flake8 and bandit are clean; eslint is unchanged at the 21-warning baseline.
New TestStaleOutletReadings:
frozen readings past the limit are marked stale
moving readings stay live
idle zero readings are never stale
the unmetered strip is left alone
A new topology test checks that stale flags are passed through.
Screenshots (anonymised preview data, RPDU readings simulated as stale)
## Why
The outlet watts on the topology page were wrong, and the cause is upstream. UniFi's `stat/device` keeps serving one frozen set of USP PDU Pro outlet readings, while the unit's total (`outlet_ac_power_consumption`) stays live:
- Every outlet reports 120.661 V, and the watts are identical to three decimals all session.
- Those frozen outlets add up to about 321 W, against a live total of 593 W.
- The UPS 2U Pro's outlets are live.
- The integration v1 and v2 device APIs have no per-outlet power to use instead.
Gandalf now stops presenting frozen numbers as if they were live.
## What changes
- **monitor.py:** `LinkStatsCollector._mark_stale_outlets` fingerprints each power unit's metered outlet readings (watts and amps) on every poll. If they haven't changed for 15 minutes and at least one outlet draws power, it marks every metered outlet `stale` and sets `outlets_stale_since` on the device. Units whose outlets all read 0 and unmetered units (the USP Strip) are never flagged.
- **topology.py:** passes `stale` through on each outlet and in `power_in`, and adds `stale_since` per source.
- **Topology page:**
- outlet rows say "stale" instead of watts
- the ⚡ badge says "fed" instead of a number
- feed lines say "(watts stale)"
- a "to look at" chip reads "RPDU outlet watts frozen since HH:MM; its total is live"
- **Device page:** the outlet table puts a "stale" badge on each reading and adds a note above it. The faceplate hover text says "(stale reading)".
- **USP Strip (UP6) faceplate:**
- traced from the render in Ubiquiti's datasheet and sized from its 229.5 x 111.5 mm footprint
- three facing pairs of US outlets (1/2, 3/4, 5/6), four USB-C ports (UniFi outlet 7, "USB Outlets"), the U logo, the status LED and the cord
- used on the topology card and on the strip's device page
## Tests
- Results: 479 passed; flake8 and bandit are clean; eslint is unchanged at the 21-warning baseline.
- New `TestStaleOutletReadings`:
- frozen readings past the limit are marked stale
- moving readings stay live
- idle zero readings are never stale
- the unmetered strip is left alone
- A new topology test checks that stale flags are passed through.
## Screenshots (anonymised preview data, RPDU readings simulated as stale)
| | |
|---|---|
| Summary chip  | RPDU outlet rows  |
| SmartPower Strip  | |
🤖 Generated with [Claude Code](https://claude.com/claude-code)
UniFi can keep serving one frozen set of USP PDU Pro outlet readings for hours
while the unit's total stays live (seen on prod: every outlet at 120.661 V with
the same watts all session, summing to 321 W of a live 593 W total). The monitor
now notices when a power unit's loaded outlet readings have not changed for 15
minutes and marks them stale. The topology page shows "stale" instead of watts,
the power badge says "fed", and a "to look at" chip says since when; the device
page marks the readings too.
Adds a UP6 (USP-Strip) faceplate traced from Ubiquiti's datasheet render: three
facing pairs of US outlets, four USB-C ports (outlet 7), the LED and the cord.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared
scheduled this pull request to auto merge when all checks succeed 2026-11-15 00:24:21 -05:00
jared
merged commit 3a1371e8b7 into main2026-11-15 00:24:23 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
The outlet watts on the topology page were wrong, and the cause is upstream. UniFi's
stat/devicekeeps serving one frozen set of USP PDU Pro outlet readings, while the unit's total (outlet_ac_power_consumption) stays live:Gandalf now stops presenting frozen numbers as if they were live.
What changes
LinkStatsCollector._mark_stale_outletsfingerprints each power unit's metered outlet readings (watts and amps) on every poll. If they haven't changed for 15 minutes and at least one outlet draws power, it marks every metered outletstaleand setsoutlets_stale_sinceon the device. Units whose outlets all read 0 and unmetered units (the USP Strip) are never flagged.stalethrough on each outlet and inpower_in, and addsstale_sinceper source.Tests
TestStaleOutletReadings:Screenshots (anonymised preview data, RPDU readings simulated as stale)
🤖 Generated with Claude Code