What you’ll see
UniFi Network
- Details: each site’s internet. A site is red when none of its WANs is connected or its gateway is offline, and its line names the ISP, which WAN is up and the latency now. A second WAN that isn’t connected is said in words and isn’t a problem for the page, so a spare left unplugged stays quiet. A site still called Default takes its gateway’s name.
- Internet: the ISP and which WAN is up, the last speed test (download, upload, ping and how long ago), and the gateway’s firmware, CPU and memory. With several sites, it says how many are connected.
- Network: clients (and how many are on Wi-Fi), devices (and how many are offline or have a firmware update waiting), and the Network version.
- Latency: the last 24 hours. The console keeps no history, so Legato keeps a reading every 5 minutes while it runs, and the chart starts the day you add the page. It shows for a console with one site.
- Devices: every device as a dot, under Gateway, Switches and Access points. Red when it’s offline, orange when its connection is interrupted, grey while it’s updating or being adopted. A device waiting for firmware stays green, and says so when you point at it. When two devices share a name, each gets the end of its MAC address added. Each dot opens the device’s page. 24 show at once, offline ones first, with Show N more. Past 60, the card keeps the ones that need a look and says how many there are. The page reads up to 4 sites and 200 devices a site, and uptime, CPU and memory for the first 40 devices; past that, a note says the counts cover part of them.
Device
One page for each device, titled with its name.
- Details: whether it’s online, and for how long.
- Facts: uptime, firmware (and whether an update is waiting), its uplink’s speed now, model and address. Restart is in the corner while it’s online, and asks first. The device shows offline for a minute or two while it restarts. On the gateway, the question says the internet drops until it’s back.
- Last 24 hours: whether it was online through the day, from the readings Legato keeps.
- CPU and Memory: the last 24 hours, side by side.
- Ports (a switch or gateway): each port, up or down, its speed and whether it’s powering a device. Or Radios (an access point): each band, its channel, width and retries.
Status
- Watches each site’s internet and every device on the console.
- Red when a device is offline, when a site has no WAN connected or its gateway is offline, or when the console stops answering.
- Orange when a device’s connection is interrupted.
- Grey while a device is updating or adopting, or when the console’s health answer stops coming.
- A spare WAN that isn’t connected and a firmware update waiting don’t count as a problem.
- Notifies you when it turns orange or red.
How it connects
The pages read the console at https://<console IP>, with an API key in an X-API-KEY header. Everything under /proxy/network/integration/v1 is Ubiquiti’s documented Network API.
Requests it makes on its own 6
GET …/integration/v1/infoand…/sitesThe Network version and the console’s sites.
UniFi NetworkEvery 2 minutes
GET …/sites/{site}/devices?limit=200, once a siteEvery device and its state.
UniFi NetworkThe same
GET …/sites/{site}/clients?limit=1, once a site, and again for Wi-Fi onlyHow many clients, and how many on Wi-Fi.
UniFi NetworkThe same
GET …/sites/{site}/devices/{device}/statistics/latest, once a deviceEach device’s uptime, CPU and memory, kept for its page.
UniFi NetworkThe same
- GET
/proxy/network/api/stat/sitesEach site’s internet: ISP, WANs, latency, the last speed test and the gateway.
UniFi NetworkEvery 2 minutes, on its own
GET …/sites/{site}/devices/{device}and…/statistics/latestThe device’s ports or radios, firmware, uplink and uptime.
DeviceEvery minute
Requests it makes when you act 1
- POST
…/sites/{site}/devices/{device}/actionsRestarts it.
DeviceWhen you press Restart
The internet rows come from a route Ubiquiti doesn’t document. Other dashboards use it too, but a Network update could change it. It’s read on its own, so if it stops answering, only the Internet cards go grey and the devices keep working.
Ubiquiti’s Network API docs have the rest. Sources and buttons explains each part of a page.
Set it up
- Make a key. On your console, open UniFi Network and go to Settings → Control Plane → Integrations (the menu moves a little between versions), then create an API key. UniFi shows it only once, so copy it then. It’s an admin key: there’s no read-only kind, and it can change your network as well as read it. Keep it in Legato’s Secrets or 1Password, and nowhere else.
- Use the console’s IP address. The console answers on port 443 with a certificate it made for itself. Legato can trust one at an IP address or a
.localname, so usehttps://192.0.2.1with your console’s own address, not a name from your router. - Save it in Legato. In Settings → Secrets, save the key under
unifi-network, bound to that address. You can also link a 1Password reference. - Add the pages. Paste the prompt into your agent, or download the two pages, put your console’s address in place of
https://192.0.2.1, and run/Applications/Legato.app/Contents/Helpers/legato set unifi-network-device unifi-network-device.json, thenlegato set unifi-network unifi-network.json. Keep the IDunifi-network-device: every device opens it with its own ID. - Trust the certificate. The first time the page reads the console, Legato asks you to check its certificate. Trust it in Settings → Certificates.
The cards fill within two minutes. A wrong or deleted key is the usual reason they don’t: the console answers 401, and the page notes that it turned the key down. A key made at unifi.ui.com is a different kind, for the cloud, and the console refuses it the same way.
Prompt for your agent
Add 2 Legato pages for UniFi Network (local), starting from https://legatobar.com/examples/unifi-network.json, https://legatobar.com/examples/unifi-network-device.json. Use the page IDs unifi-network, unifi-network-device if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are, keeping their page IDs, with my console's address in place of https://192.0.2.1 on every source. I’ll save my console's API key as unifi-network in Settings → Secrets and trust its certificate myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.Download the pages
Questions
Why does it say a WAN isn’t connected?
UniFi reports each WAN port, including a second one kept for failover. When one has no link, the site’s line says so, and the page counts it as a problem only when no WAN at all is connected.
Why is the latency chart empty?
The console doesn’t keep latency over time, so Legato records it every 5 minutes while it runs, and the chart fills over the first day. With more than one site on the console, the chart isn’t drawn; each site’s line in Details has its latency now.
Can I restart the gateway?
Yes, from its page. Your internet, and this console’s pages, drop while it restarts, usually a few minutes, and the question says so before anything is sent.
Why do CPU and memory stop after 40 devices?
Each device’s statistics are a request of their own, and a page sends at most 64 requests each time it reads. The first 40 devices have them; the rest still show as dots with their state.