get_device_stats
get_device_stats
Section titled “get_device_stats”Report per-device stats for one UniFi device by MAC.
Side effects: None (read-only).
Returns a record with name, model, type, state,
uptime (seconds), cpu_pct, mem_pct, satisfaction,
num_sta, tx_bytes/rx_bytes, and (for access points)
tx_retries/tx_packets/rx_packets. Returns a NOT_FOUND
error envelope if no adopted device matches mac.
Example
Section titled “Example”get_device_stats(mac="f4:e2:c6:00:00:02")Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mac | string | yes | — | MAC address of the device (gateway, AP, or switch). |
controller | string | no | ”default” | Name of the UniFi controller to target. Defaults to "default". |