Asus Router Management
Manage Asus routers via the asusrouter Python library. Works with any Asus router running stock AsusWRT or Merlin firmware.
Setup
1. Install dependencies
CODEBLOCK0
2. Create config file
Copy
config.example.yaml to
config.yaml and fill in your router details:
CODEBLOCK1
Edit config.yaml with your router's IP, username, and password.
3. Verify connection
CODEBLOCK2
Supported Routers
Any Asus router with the AsusWRT web interface:
- - ZenWiFi (XT8, XT12, XD6, etc.) — full AiMesh support
- RT-AX series (RT-AX86U, RT-AX88U, etc.)
- GT-AX gaming series
- Merlin firmware variants
- AiMesh nodes (RP-AX56, RP-AX58, etc.)
Commands
All commands use router.py. Activate your venv first if using one.
Quick Status
CODEBLOCK3
List Connected Devices
CODEBLOCK4
Who's Home (Presence Detection)
python3 router.py who
Checks for known devices defined in
config.yaml to determine who's home.
WAN Details
CODEBLOCK6
AiMesh Topology
CODEBLOCK7
Find a Device
CODEBLOCK8
Network Latency Check
python3 router.py ping
Pings targets defined in
config.yaml (default: gateway + Cloudflare + Google).
Reboot Router
python3 router.py reboot --confirm
⚠️ Requires
--confirm flag. Causes 2-3 min downtime.
Common Tasks
"Is the internet down?"
- 1.
status — check WAN link state - INLINECODE9 — check latency to external IPs
- INLINECODE10 — check DHCP lease and DNS
"What's using bandwidth?"
clients --online --json — check
rx_speed/
tx_speed fields
"Who's home?"
who — checks for devices listed in
config.yaml under INLINECODE16
"Why is WiFi slow?"
- 1.
mesh — check client distribution across nodes - INLINECODE18 — check CPU/RAM (high CPU = overloaded)
- INLINECODE19 — check signal strength (rssi)
Configuration
All settings live in config.yaml. See config.example.yaml for the full template.
Key settings:
- -
router.host — Router IP address - INLINECODE23 — Admin username
- INLINECODE24 — Admin password
- INLINECODE25 — Use HTTPS (default: false)
- INLINECODE26 — Devices for presence detection
- INLINECODE27 — Custom ping targets for latency checks
JSON Output
Add
--json to any command for machine-readable output. Useful for cron jobs, heartbeat checks, and alerting.
Integration with Home Assistant
For persistent monitoring, also install
ha-asusrouter via HACS:
https://github.com/Vaskivskyi/ha-asusrouter
Asus路由器管理
通过asusrouter Python库管理Asus路由器。适用于运行官方AsusWRT或Merlin固件的任何Asus路由器。
设置
1. 安装依赖
bash
pip install asusrouter aiohttp
2. 创建配置文件
将config.example.yaml复制为config.yaml并填写路由器详细信息:
bash
cp skills/asus-router/config.example.yaml skills/asus-router/config.yaml
编辑config.yaml,填入路由器的IP地址、用户名和密码。
3. 验证连接
bash
python3 skills/asus-router/router.py status
支持的路由器
任何具有AsusWRT网页界面的Asus路由器:
- - ZenWiFi系列(XT8、XT12、XD6等)— 完整AiMesh支持
- RT-AX系列(RT-AX86U、RT-AX88U等)
- GT-AX游戏系列
- Merlin固件变体
- AiMesh节点(RP-AX56、RP-AX58等)
命令
所有命令均使用router.py。如果使用虚拟环境,请先激活。
快速状态
bash
python3 router.py status # WAN、CPU、RAM、Mesh节点、客户端数量
python3 router.py status --json # 机器可读输出
列出已连接设备
bash
python3 router.py clients # 所有设备
python3 router.py clients --online # 仅在线设备
python3 router.py clients --filter iphone # 按名称/IP/MAC搜索
python3 router.py clients --json # JSON输出
谁在家(存在检测)
bash
python3 router.py who
检查config.yaml中定义的已知设备,判断谁在家。
WAN详情
bash
python3 router.py wan # IP、网关、DNS、租约、双WAN
python3 router.py wan --json
AiMesh拓扑
bash
python3 router.py mesh # 哪些客户端连接到哪个节点
python3 router.py mesh --json
查找设备
bash
python3 router.py find samsung
python3 router.py find 192.168.1.100
python3 router.py find AA:BB:CC:DD:EE:FF
网络延迟检测
bash
python3 router.py ping
Pingconfig.yaml中定义的目标(默认:网关 + Cloudflare + Google)。
重启路由器
bash
python3 router.py reboot --confirm
⚠️ 需要--confirm标志。会导致2-3分钟断网。
常见任务
网络断了吗?
- 1. status — 检查WAN链路状态
- ping — 检查到外部IP的延迟
- wan — 检查DHCP租约和DNS
谁在占用带宽?
clients --online --json — 检查rx
speed/txspeed字段
谁在家?
who — 检查config.yaml中known_devices下列出的设备
为什么WiFi慢?
- 1. mesh — 检查客户端在各节点间的分布
- status — 检查CPU/RAM(高CPU=过载)
- find — 检查信号强度(rssi)
配置
所有设置均在config.yaml中。完整模板请参考config.example.yaml。
关键设置:
- - router.host — 路由器IP地址
- router.username — 管理员用户名
- router.password — 管理员密码
- router.ssl — 使用HTTPS(默认:false)
- knowndevices — 用于存在检测的设备
- pingtargets — 用于延迟检测的自定义Ping目标
JSON输出
在任何命令后添加--json即可获得机器可读输出。适用于定时任务、心跳检测和告警。
与Home Assistant集成
如需持久监控,可通过HACS安装ha-asusrouter:
https://github.com/Vaskivskyi/ha-asusrouter