/unifi-network-ops:tuning-unifi-wifi-rffrom unifi-network-ops
Use when diagnosing or fixing UniFi WiFi performance - slow wireless, high channel utilization or airtime, co-channel interference, sticky clients stuck on a distant AP at poor dBm, DFS/radar channel questions, transmit power and min-RSSI decisions, or 2.4GHz minimum data rate. Also use before claiming a UniFi RF metric shows a problem.
Ships in unifi-network-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Most UniFi RF problems are self-inflicted: overlapping channels, mismatched transmit power, and settings that fight each other. The fix is usually a deliberate manual plan, not more automation.
Core principle: measure before and after with multiple samples, because every headline RF metric on this platform is instantaneous and swings hard. A single before/after pair will tell you whatever you want to hear.
REQUIRED FIRST: capturing-a-unifi-baseline (you need stat/device and stat/sta).
REQUIRED BEFORE WRITING: applying-unifi-changes.
Four traps, each of which has produced a confident, wrong, publicly-retracted claim.
stat/rogueap is rolling history, not a live scanIt accumulates every BSSID ever heard. Raw counts are meaningless — most entries are at the noise floor and months stale. Reading it raw produced a "73 competing BSSIDs on channel 6, your neighborhood is congested" claim on a site whose true live picture was five signals above −70 dBm, all of them one device.
Always filter on both recency and signal:
jq --argjson cutoff "$(( $(date +%s) - 3600 ))" '
[.data[] | select(.last_seen > $cutoff and .signal > -70)]
| group_by(.channel)[] | {channel: .[0].channel, count: length}' raw/stat_rogueap.json
Run against a live site while writing this skill: 136 BSSIDs in the rolling table, 4 actually present above −70 dBm in the last hour. Quoting the raw count would have overstated the interference by 34×.
cu_total (channel utilization / airtime) is instantaneousObserved swinging 69% → 90% on the same radio hours apart with no config change, and
82% → 43% → 18% → 23% across one evening. Never judge a change on one before/after
pair. Use scripts/unifi-sample-rf.sh to take 6+ samples and compare medians at the
same time of day.
After a successful fix, retry percentage often rises while the network gets dramatically better. Retry % is retries ÷ total transmissions, and a fix collapses the denominator. Worse, relieving congestion makes rate adaptation ambitious: clients that crawled at reliable 1–2 Mbps now attempt 72 Mbps+ and occasionally miss.
Weight it by utilization before concluding anything. Real six-sample medians from a five-AP site before and after a channel/power plan:
| Radio | Before (util × retry) | Lost | After | Lost | Verdict |
|---|---|---|---|---|---|
| AP-1 2.4 | 90% × 5.4% | 4.86 | 27% × 12.6% | 3.40 | better |
| AP-2 2.4 | 82% × 10.0% | 8.20 | 15% × 25.0% | 3.75 | better |
| AP-5 2.4 | 12% × 7.7% | 0.92 | 12.5% × 20.8% | 2.60 | worse |
| Total | 21.30 | 12.40 | −42% |
Retry % rose on every radio, and on AP-2 it went up 2.5× — while the airtime it actually loses to retransmission more than halved. Reading the percentage alone would have condemned a change that cut total retry airtime by 42%.
The same arithmetic also finds the one genuine regression: AP-5's airtime barely moved but its retries tripled, so its absolute cost nearly tripled too. Weighting is what separates the real problem from the four false alarms.
Rough 2.4 GHz thresholds: <10% quiet · 10–20% normal · 20–30% investigate ·
30% sustained is real.
tx_rate is the last frame's rate, not the client's capabilityA device showing tx_rate: 1000 is usually not a legacy 802.11b device — it is very
often a modern client whose last transmission was a low-rate management frame. Check
radio_proto (ng/na/ac/ax) and rx_rate before calling anything legacy.
On one site this trap nearly triggered an unnecessary migration of a dozen "legacy" devices. The actual protocol audit found zero 802.11b/g-only clients.
Device display names come from DHCP/mDNS and can differ between polls on the same MAC. A claim built on names ("an iMac is parked on 2.4 GHz") did not survive re-verification. Identify clients by MAC before acting.
Only three non-overlapping channels exist. With four corner APs, the two APs that share a channel must be the two that are physically farthest apart:
NW ─────────── NE NW and SE share ch1
ch1 ch11 NE and SW share ch11
center center takes ch6
ch11 ch1
SW ─────────── SE
Co-channel with another WiFi transmitter degrades gracefully — 1/6/11 don't partially overlap, so they share airtime through CSMA/CA. Adjacent-channel overlap (e.g. 3 vs 6) is strictly worse because the frames corrupt rather than defer. Never "split the difference" onto channel 3 or 9.
Some IoT devices (alarm panels, thermostats, cameras) keep a pairing hotspot running
forever, on a BSSID one off from their client MAC. That hotspot is single-radio: it sits on
the channel of whichever AP the device's client side is associated to. It will read in
stat/rogueap as a fixed neighbor on one channel for as long as the client stays put, and
then jump the moment the client roams — typically after an outage, when it re-associates to
whichever AP answered first.
One site planned around "channel 6 is permanently occupied" for six weeks, with a sacrificial AP on ch6 to absorb it. After a power outage the client re-associated to a different AP and the hotspot appeared on ch11 at −53 dBm, co-channel with the one radio the plan most needed clean. Three snapshots matched the client's AP channel every time.
Check consecutive MACs (…:2f client, …:30 BSSID) before treating a rogue as external.
If it is one of yours, pin the client to the AP whose channel you want the interferer
on, and treat it as a standing watch item rather than a fixed feature of the RF plan.
At 80 MHz width, a channel number implies a whole block. Two APs on "different channels" 149 and 153 occupy the identical 149–161 block — a full collision that reads as two distinct channels in the UI.
US (country code 840) usable 80 MHz blocks — exactly five:
| Block | Channels | DFS | Notes |
|---|---|---|---|
| 36–48 | 36/40/44/48 | no | give to a busy radio |
| 52–64 | 52/56/60/64 | yes | verified usable |
| 100–112 | 100/104/108/112 | yes | |
| 132–144 | 132/136/140/144 | yes | |
| 149–161 | 149/153/157/161 | no | give to a busy radio |
⚠️ The 116–128 block is NOT usable in the US. It spans 5570–5650 MHz, overlapping the TDWR weather radar band (5600–5650 MHz). UniFi generally does not offer 120/124/128 under country 840. Assigning it is a common and confident mistake.
Five blocks for five APs means zero slack. A sixth AP has to share, at 40 MHz or with an accepted co-channel hit.
radio_table gives has_dfs and has_fccdfs but never enumerates permitted channels.
Verify a new channel empirically: set it, then read back
radio_table_stats[].channel and confirm state == "RUN" rather than a silent fallback
to the previous channel.
Moving to a DFS channel triggers a Channel Availability Check. Measured: ~100 s from
PUT to state=RUN, about 77 s of it CAC. The radio does not transmit at all during CAC —
its clients are offline for the whole duration, not the ~30 s a non-DFS change costs.
Non-DFS radio change: ~30 s. DFS: ~100 s. Budget accordingly and tell the owner.
{"radio_table": [{"radio": "na", "tx_power_mode": "custom", "tx_power": 23}]}
The named modes (low / medium / high / auto) ignore any tx_power value you
send alongside them. Setting "tx_power_mode": "high", "tx_power": 23 silently gives
you "high", not 23 dBm.
A radio with tx_power_mode unset/null typically runs at hardware maximum.
min_txpower / max_txpower in radio_table are per-radio and differ by model. Typical:
2.4 GHz caps at 22 dBm on mid-tier APs and 26 on long-range models; 5 GHz at 26–27. Floor
is usually 6 dBm. A value outside the range is rejected or silently clamped.
Mismatched power is what creates sticky clients. One site had a 2.4 GHz radio pinned at 6 dBm (4 mW) while neighbors ran 26 dBm — a 100× deficit. It held one client because nothing could hear it, yet showed 45% utilization because it could hear everyone else without being able to compete.
The instinct to reduce a "too loud" AP is often wrong. Cutting a long-range AP's 2.4 GHz power 26 → 17 dBm to fix a sticky client measurably broke the thing that AP existed for: an outdoor camera went −72 → −82 dBm, exactly tracking the 9 dB cut. It had to be reverted.
A long-range AP holds distant clients through high-gain receive sensitivity, not transmit reach. Cutting TX power does not stop it attracting distant clients; it just degrades the ones that legitimately depend on it. Ask what the AP covers before touching it.
This is the single most misunderstood control on the platform. min-RSSI kicks a client below the threshold. The client then rescans and is free to pick the same AP again.
A client sitting just under the threshold enters a loop: evicted → rescans → re-picks the same bad AP → evicted. Observed exactly this at −81 dBm against a −80 threshold.
Set min-RSSI to remove genuinely broken associations, and only on radios where a better AP actually exists. Around −80 on 5 GHz is a reasonable start.
Do not set min-RSSI on a radio serving devices that have nowhere else to go — outdoor cameras, remote sensors, hard-to-re-pair IoT. Evicting a device with no alternative is self-inflicted damage.
// PUT /api/s/<site>/rest/user/<user_id>
{
"fixed_ap_enabled": true,
"fixed_ap_mac": "aa:bb:cc:dd:ee:ff" // the AP you want it on
}
Field names matter and are easy to get wrong. fixed_ap_enabled + fixed_ap_mac are
correct. ap_mac_fixed is not a real field — it appears in plenty of forum posts and
is absent from every real record. Read an already-pinned client on the site and copy its
field names rather than guessing.
Follow the write with POST cmd/stamgr {"cmd":"kick-sta","mac":"<client>"} to force
reassociation.
Result on a real device: −91 dBm on an AP ~80 ft away → −38 dBm on the AP 6 ft away, ~11× throughput. min-RSSI alone had failed to fix it twice, and a power cycle fixed it only until the next night.
Tradeoff to state explicitly to the owner: a pinned client will not fail over if its AP goes down.
kick-sta is the surgical tool for redistributing clientsAfter an outage or a reprovision, 2.4 GHz IoT devices latch onto whichever AP answered first and roam poorly afterward. Compare each client's current AP and signal to baseline by MAC, then kick only the ones that are demonstrably worse off.
Note: a tx_power change alone does not drop clients, so it is not a usable way to
bounce a radio.
// PUT /api/s/<site>/rest/wlanconf/<id>
{
"minrate_ng_data_rate_kbps": 6000,
"minrate_setting_preference": "manual" // REQUIRED — without it the rate is ignored
}
While minrate_setting_preference is "auto", UniFi manages the rate and silently
ignores minrate_ng_data_rate_kbps. The PUT returns rc: ok and nothing changes.
Choose 6 Mbps, not 12. 6 Mbps preserves every OFDM rate and full range for distant 802.11n clients. A frame at 1 Mbps consumes ~50× the airtime of the same frame at 54 Mbps, so 1 → 6 is where nearly all the benefit is.
Before raising it, audit radio_proto across clients for genuine 802.11b/g-only devices.
Do not use tx_rate for this (see Part 1).
RF AI optimizes per-radio with no floor-plan awareness. On a site with mostly-pinned channels it has nothing to work with, and where it is free it can pick a channel that collides with a manually pinned neighbor — one observed case had auto pick 149 directly into a manually pinned 153.
Commit to one or the other. Half-auto/half-manual is the worst configuration.
| Symptom | Likely cause | Check |
|---|---|---|
| High airtime, few clients | Co-channel with a neighbor AP | radio_table_stats[].channel across all APs |
| Two APs "on different channels" still colliding | Same 80 MHz block | Map channel → block |
| Client at −90 dBm on a distant AP | Sticky client + power asymmetry | stat/sta signal vs AP tx_power |
| min-RSSI set, client keeps coming back | Client sits just under threshold | Pin it instead |
| Min-rate PUT returns ok, nothing changes | minrate_setting_preference: auto | has("minrate_setting_preference") |
| Channel set, AP still on the old one | Silent fallback or wedged provisioning | radio_table_stats[].state == "RUN" |
| Retries up after a fix | Denominator collapsed | Weight by utilization |
./scripts/unifi-sample-rf.sh --samples 6 --interval 420 before.txt # pre-change
# ... apply changes ...
./scripts/unifi-sample-rf.sh --samples 6 --interval 420 after.txt # SAME time of day
AP reboots reset counters, so a sample taken minutes after a reprovision is not comparable to one taken before it. Wait for the network to settle — several hours is not excessive.
Don't sample faster than the controller updates. Radio counters refresh on the controller's own cycle (minutes, not seconds). Two pulls seconds apart return byte-identical numbers that look like two independent samples and will make a volatile radio appear perfectly stable. Use an interval of 300 s or more; the script warns below 120 s.
| Mistake | Reality |
|---|---|
| Judging a change on one before/after sample | Airtime swings 4× on its own. Take 6. |
Reading stat/rogueap counts raw | Rolling history. Filter last_seen + signal. |
| "Retries went up, the change failed" | Weight by utilization first. |
| Assigning 116–128 in the US | TDWR radar band. Not available. |
| Cutting power on a long-range AP to fix stickiness | Breaks its actual coverage job. Pin the client. |
| Expecting min-RSSI to steer | It evicts. Only pinning relocates. |
| Trusting the config read-back | Verify radio_table_stats, not stored config. |
Calling a device legacy from tx_rate | Check radio_proto and rx_rate. |
Five-AP site, before → after a manual channel/power plan built on these rules. Figures are six-sample medians taken in the same evening window as the baseline:
A note on these numbers. The first write-up of this work was based on single samples taken about an hour after the change, and published total airtime 98% and retry reduction −51%. The six-sample run revised both: airtime was actually better (80.5%) and the retry reduction worse (−42%) than the single sample suggested — errors in opposite directions, from the same data source, one day apart.
That is the whole argument for multi-sampling. If you publish a single-sample number, say so, and go back and correct it.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
4 skills in this plugin
/applying-unifi-changesUse before writing any configuration to a UniFi controller - PUT/POST/DELETE against wlanconf, networkconf, rest/device, radio settings, firewall, or IPS. Covers merge-not-replace PUT semantics, verifying runtime state rather than stored config, provisioning and DFS outage windows, referential integrity on deletes, and the shell traps that have silently corrupted payloads./capturing-a-unifi-baselineUse when connecting to a UniFi controller (UDM/UDM Pro/UDM SE/Cloud Key) for the first time, auditing a UniFi site, or before making any UniFi configuration change - covers which API surface to use, what an API key can and cannot read, capturing a restorable snapshot, and which captured files contain cleartext credentials./npx claudepluginhub devondragon/unifi-network-ops --plugin unifi-network-ops