Commit Graph
4 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 a5d4fc3156 Restart modem: pause Smart Power auto power-cycle until the modem is back
Lint / JS (eslint) (push) Successful in 14s
Lint / Python (flake8) (push) Successful in 1m5s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 1m13s
Lint / Python (flake8) (pull_request) Successful in 1m14s
Test / Python Tests (pytest) (push) Successful in 1m51s
Security / Python Security (bandit) (pull_request) Successful in 1m25s
Lint / JS (eslint) (pull_request) Successful in 19s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Test / Python Tests (pytest) (pull_request) Successful in 1m32s
UniFi Smart Power on the RPDU's modem outlet saw the internet down while
the modem rebooted and cut its power mid-boot: once during the 11-20
restart and twice after the 11-24 AT&T-app reboot. UniFi only exposes
auto power-cycle as on or off, so the button now turns it off for every
outlet that has it on, and the monitor turns it back on when the restart
ends (back, or after 30 minutes).

- UnifiClient.auto_power_cycle_outlets / set_auto_power_cycle: sends the
  device's outlet_overrides back with only cycle_enabled changed, then
  reads them again to confirm. The only UniFi setting Gandalf changes.
- A failed pause doesn't stop the restart; a failed restart turns it back
  on. A failed restore is retried every cycle and shown as broken in
  Needs attention until it works.
- The panel note and confirm text mention the pause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 00:13:46 -05:00
jaredandClaude Opus 5.5 de75f71bf8 Modem access code: NAT sessions, and a ping from the modem when slow
Lint / JS (eslint) (push) Successful in 1m11s
Lint / Python (flake8) (push) Successful in 1m55s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 54s
Lint / Python (flake8) (pull_request) Successful in 53s
Test / Python Tests (pytest) (push) Successful in 1m5s
Lint / JS (eslint) (pull_request) Successful in 11s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 55s
Test / Python Tests (pytest) (pull_request) Successful in 1m3s
With modem.access_code in config.json, the monitor logs in to the
BGW320 (md5 of code + nonce, as its own page does) for two read-only
checks, stored in monitor_state.modem_checks:

- NAT sessions in use every 30 minutes; Needs attention warns at 80%.
- While UniFi says the internet is slow, a ping from the modem itself
  to 1.1.1.1 (at most every 10 minutes). Compared with UniFi's latency
  through the modem, it says whether the delay is past the modem (the
  provider), in the modem, or gone. The Internet line in Needs
  attention and the WAN / Fiber panel show the result.

A refused code is reported and not retried for 30 minutes; other
failures pause the checks for 10. The unauthenticated status polling
is unchanged. Tested against the real gateway and a fake one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:31 -05:00
jaredandClaude Opus 5.5 6a717af3f2 Internet health from UniFi: Needs attention line and a 24 hour strip
Lint / JS (eslint) (push) Successful in 1m10s
Lint / Python (flake8) (push) Successful in 2m31s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 1m26s
Lint / Python (flake8) (pull_request) Successful in 1m4s
Test / Python Tests (pytest) (push) Successful in 1m13s
Lint / JS (eslint) (pull_request) Successful in 7s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 1m0s
Test / Python Tests (pytest) (pull_request) Successful in 1m3s
UniFi already rates the WAN every 5 minutes (fine, high latency, packet
loss, down), the same timeline its Network app charts. The monitor now
reads the last day of it from the dashboard API each cycle, read only,
instead of Gandalf pinging on its own.

- modem.wan_quality() turns the dashboard data into periods, drops and
  current service latencies; stored as monitor_state.wan_quality.
- Needs attention: "Internet: packet loss in N of the last 12 five-minute
  periods" (2+ lossy periods, red), "high latency" (3+ bad periods,
  amber), and drops in the last hour. Stale copies are ignored.
- WAN / Fiber panel: a 24 hour strip with a legend and latency now,
  also shown while the modem itself can't be read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:38:39 -05:00
jaredandClaude Opus 5.5 c535bfd9fb Dashboard: one Needs attention list from every page; say what GANDALF stands for
attention.build gathers alerts, power faults, cutsheet mismatches, UniFi port names,
undocumented links, labels to print and rack overlaps into Broken now and Tidy up,
each linking to where it is fixed. /api/attention serves it; the dashboard renders it
and refreshes it with everything else. The header, help dialog, footer and page
description spell out Global Advanced Network Detection And Link Facilitator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:56:13 -05:00