UniFi Network source #55

Closed
opened 2026-11-13 18:44:49 +00:00 by jfro · 0 comments
Owner

A source for UniFi Network on a UniFi OS console (UDM, UDR, UCG, Cloud Key Gen2+). It opens problems for devices that are offline or waiting to be adopted. During a diagnosis it tells the AI which access point or switch a host is connected to, so a "host down" report can be traced to the network.

Setup

  • Settings:
    • console URL
    • API key, stored the same way as other source secrets
    • site, defaulting to the first one
    • TLS fingerprint, since consoles use self-signed certificates (same as Proxmox)
  • Uses the official Network Integration API at /proxy/network/integration/v1/... with the X-API-KEY header. This needs Network 9.3 or later.
  • Setup guide: create a key under Network → Settings → Control Plane → Integrations. A key has the same rights as the admin who creates it, so suggest a view-only admin.
  • validate_settings calls GET /v1/info and GET /v1/sites.

Problems (GET /v1/sites/{site}/devices, plus /v1/pending-devices)

  • A device is offline, with its name, model and MAC address.
  • A device has been waiting to be adopted for longer than open_after.
  • Optional: a firmware update is available, as a warning. Only if the device fields include it (see open questions).
  • Per-device severity rules use the same search picker as Proxmox guests, e.g. a garage access point is a warning while the core switch is critical. Untagged devices default to critical.

Context queries

  • devices: every device with its state, model, IP address and uptime.
  • device: one device's details plus statistics/latest (CPU, memory, uptime, uplink transfer rates, radios).
  • client: find a client by IP address, MAC address or name, and return its type, when it connected, and its uplink device (uplinkDeviceId resolved to the device's name).
  • context_summary: number of devices online and offline, and number of clients.

Out of scope for now (the official API doesn't expose these)

  • WAN/ISP health
  • Alarms and events
  • Per-port counters
  • Which switch port a wired client is on

These are only in the legacy API, which needs a username and password login, so they're left out.

Open questions

  • Whether the device fields give a firmware update flag, and exactly which state values exist. Check the OpenAPI spec for 9.3 and 10.x before building.
  • Whether self-hosted Network Application (no UniFi OS) is supported. It probably doesn't have the Integration API, so the plan is to say "UniFi OS consoles only".
  • Later issue: approved actions like restarting a device or power-cycling a PoE port. The API has both, but they'd need write permission and the approved-actions design.

Done when

  • Problems open and resolve for offline and unadopted devices, with per-device severity.
  • The diagnosis and chat tools can look up a client and its uplink.
  • There's a setup guide.
  • Tests run against a Req.Test fake console.
  • There are no new dependencies.
A source for UniFi Network on a UniFi OS console (UDM, UDR, UCG, Cloud Key Gen2+). It opens problems for devices that are offline or waiting to be adopted. During a diagnosis it tells the AI which access point or switch a host is connected to, so a "host down" report can be traced to the network. **Setup** - Settings: - console URL - API key, stored the same way as other source secrets - site, defaulting to the first one - TLS fingerprint, since consoles use self-signed certificates (same as Proxmox) - Uses the official Network Integration API at `/proxy/network/integration/v1/...` with the `X-API-KEY` header. This needs Network 9.3 or later. - Setup guide: create a key under Network → Settings → Control Plane → Integrations. A key has the same rights as the admin who creates it, so suggest a view-only admin. - `validate_settings` calls `GET /v1/info` and `GET /v1/sites`. **Problems** (`GET /v1/sites/{site}/devices`, plus `/v1/pending-devices`) - A device is offline, with its name, model and MAC address. - A device has been waiting to be adopted for longer than `open_after`. - Optional: a firmware update is available, as a warning. Only if the device fields include it (see open questions). - Per-device severity rules use the same search picker as Proxmox guests, e.g. a garage access point is a warning while the core switch is critical. Untagged devices default to critical. **Context queries** - `devices`: every device with its state, model, IP address and uptime. - `device`: one device's details plus `statistics/latest` (CPU, memory, uptime, uplink transfer rates, radios). - `client`: find a client by IP address, MAC address or name, and return its type, when it connected, and its uplink device (`uplinkDeviceId` resolved to the device's name). - `context_summary`: number of devices online and offline, and number of clients. **Out of scope for now** (the official API doesn't expose these) - WAN/ISP health - Alarms and events - Per-port counters - Which switch port a wired client is on These are only in the legacy API, which needs a username and password login, so they're left out. **Open questions** - Whether the device fields give a firmware update flag, and exactly which `state` values exist. Check the OpenAPI spec for 9.3 and 10.x before building. - Whether self-hosted Network Application (no UniFi OS) is supported. It probably doesn't have the Integration API, so the plan is to say "UniFi OS consoles only". - Later issue: approved actions like restarting a device or power-cycling a PoE port. The API has both, but they'd need write permission and the approved-actions design. **Done when** - Problems open and resolve for offline and unadopted devices, with per-device severity. - The diagnosis and chat tools can look up a client and its uplink. - There's a setup guide. - Tests run against a `Req.Test` fake console. - There are no new dependencies.
jfro added this to the v1.2 milestone 2026-11-13 18:44:49 +00:00
jfro closed this issue 2026-11-14 15:08:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/lamplighter#55
No description provided.