Skip to content

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.

get_device_stats(mac="f4:e2:c6:00:00:02")
ParameterTypeRequiredDefaultDescription
macstringyesMAC address of the device (gateway, AP, or switch).
controllerstringno”default”Name of the UniFi controller to target. Defaults to "default".