set_radio_channel
set_radio_channel
Section titled “set_radio_channel”Set the channel and/or channel width of one radio on an AP.
Side effects:
- The radio retunes immediately; wireless clients on that band briefly disconnect and re-associate.
- On 5GHz, DFS channels (52-144) may add a radar-scan delay before the radio starts serving clients.
- Only the targeted radio changes; everything else on the device is read first and written back unchanged.
- Mutates controller state. Use dry_run=True to preview the change (including the current value) without applying.
Read first: call get_device_radios to see the current channel
and width.
Example
Section titled “Example”set_radio_channel(device_mac="aa:bb:cc:00:00:02", band="5g", channel="36", width_mhz=80)Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
device_mac | string | yes | — | AP MAC address (from list_devices). |
band | string | yes | — | "2g", "5g", or "6g" (raw UniFi ids ng, na, 6e also accepted). |
channel | string | no | "" | "auto" or a channel number as a string (e.g. "36"). Empty (default) leaves the channel unchanged. |
width_mhz | integer | no | 0 | Channel width: 20, 40, 80, 160, 240, or 320. 0 (default) leaves the width unchanged. |
controller | string | no | ”default” | Name of the UniFi controller to target. Defaults to "default". |
dry_run | boolean | no | false | Preview the change without applying it. Returns the predicted change set. |