unifi devices
About 981 words
List, inspect and operate gateways, switches and access points.
Aliases: device
Commands
unifi devices adopt: Adopt a device that is waiting for adoptionunifi devices describe: Show everything known about one deviceunifi devices forget: Remove a device from the siteunifi devices get: List devices, or show oneunifi devices locate: Blink the LED of devices to find themunifi devices restart: Restart one or more devicesunifi devices upgrade: Update the firmware of devices, or of every device with --all
unifi devices adopt
Adopt a device that is waiting for adoption.
Usage
unifi devices adopt <device> [flags]Adopt a new device into the site. Devices waiting for adoption are listed by unifi devices get --pending.
Examples
unifi devices get --pending
unifi devices adopt "USW Flex Mini"
unifi devices adopt 02:15:6d:00:01:20Flags
| Flag | Description |
|---|---|
-y, --yes | do not ask for confirmation |
unifi devices describe
Show everything known about one device.
Usage
unifi devices describe <device> [flags]Show a device's identity, firmware, load and uplink.
Switches and gateways add their faceplate and the power their ports deliver; access points add their radios.
Examples
unifi devices describe "Core Switch"
unifi devices describe "AP Living Room"
unifi devices describe 192.168.1.1 --output jsonunifi devices forget
Remove a device from the site.
Usage
unifi devices forget <device> [flags]Remove a device from the site. The device is reset to its factory defaults and has to be adopted again before it can be used, so the command always asks for confirmation.
Examples
unifi devices forget "AP Garden"
unifi devices forget "AP Garden" --yesFlags
| Flag | Description |
|---|---|
-y, --yes | do not ask for confirmation |
unifi devices get
List devices, or show one.
Usage
unifi devices get [device] [flags]Aliases: list, ls
List the gateways, switches and access points of the site.
A device whose firmware can be updated carries an arrow next to its version; --output wide shows the version the update installs.
Narrow the list with the shortcut flags or with --filter, which takes a filter expression such as type == "switch" && cpuPercent > 50. Fields:
clients cpuPercent id ip legacyId
mac memoryPercent model name ports
radios rxBytes rxRateBps state txBytes
txRateBps type upgradable upgradeVersion uplink
uptime uptimeSeconds versionuptime takes a duration, as in uptime < 7d; uptimeSeconds is the same in plain seconds, as JSON and YAML output carry it.
Examples
unifi devices get
unifi devices get --type switch --output wide
unifi devices get --offline
unifi devices get --upgradable
unifi devices get --sort cpu --limit 3
unifi devices get --filter 'clients > 10'
unifi devices get --filter 'state == "ONLINE" && uptime < 7d'
unifi devices get "Core Switch" --output yamlFlags
| Flag | Description |
|---|---|
--filter <string> | filter expression, such as 'type == "switch" && cpuPercent > 50' |
--limit <int> | show at most this many devices |
--offline | only devices that are offline |
--pending | only devices waiting for adoption |
--reverse | reverse the sort order |
--sort <string> | sort key: name, type, ip, model, state, clients, uptime, cpu, memory, traffic |
--type <string> | only devices of this type: gateway, switch, ap |
--upgradable | only devices with a firmware update available |
unifi devices locate
Blink the LED of devices to find them.
Usage
unifi devices locate <device>... [flags]Blink the LED of devices so that you can find them in a rack or on a ceiling. The LED keeps blinking until you pass --off.
Examples
unifi devices locate "Office Switch"
unifi devices locate "Office Switch" "Core Switch"
unifi devices locate "Office Switch" --offFlags
| Flag | Description |
|---|---|
--off | stop blinking |
-y, --yes | do not ask for confirmation |
unifi devices restart
Restart one or more devices.
Usage
unifi devices restart <device>... [flags]Restart devices. Everything connected through a device loses its connection until the device is back, which usually takes one to three minutes, so restarting a device that is online asks for confirmation. A device that is offline cannot be restarted from here.
Examples
unifi devices restart "AP Living Room"
unifi devices restart "AP Living Room" "AP Office" --yesFlags
| Flag | Description |
|---|---|
-y, --yes | do not ask for confirmation |
unifi devices upgrade
Update the firmware of devices, or of every device with --all.
Usage
unifi devices upgrade [device]... [flags]Install the firmware update that is available for the named devices. A device restarts while it updates, so everything connected through it goes offline for a few minutes; updating a device that is online asks for confirmation.
With --all every device that has an update is updated; the devices are listed before you confirm. See what is waiting with unifi devices get --upgradable.
Several devices are updated from the edge of the network inwards: access points and the switches furthest from the gateway first, the gateway last, so that no device loses its uplink in the middle of its own update. A device that fails does not stop the others; the command reports every device and exits with an error if one failed.
Examples
unifi devices get --upgradable
unifi devices upgrade "Office Switch"
unifi devices upgrade "Office Switch" "AP Office" --yes
unifi devices upgrade --all
unifi devices upgrade --all --yesFlags
| Flag | Description |
|---|---|
--all | update every device that has an update available |
-y, --yes | do not ask for confirmation |
Global flags
These flags are accepted by every command.
| Flag | Description |
|---|---|
--color-scheme <string> | color scheme: auto, dark or light |
--context <string> | context to use instead of the current one |
--no-cache | ask the controller for everything instead of using cached answers |
-o, --output <string> | output format: text, wide, json, yaml (table is another name for text) |
-s, --site <string> | site to act on instead of the context's default site |
--theme <string> | theme to render with instead of the configured one |
