AsusRouter is an API wrapper for communication with ASUSWRT-powered routers using HTTP(S) protocols. The library supports both the stock AsusWRT firmware and AsusWRT-Merlin.
Up till now, it is mostly used for the custom AsusRouter Home Assistant integration and from recently by the core Home Assistant AsusWRT integration. But I am always open to making it suitable for any other use.
AsusRouter requires Python 3.11 or newer. Installation of the latest release is available from PyPI:
pip install asusrouter
Once installed, you can import the AsusRouter class and connect to your device. The example below uses the async context manager, which connects on entry and cleans up on exit. Only hostname, username and password are required.
import asyncio
from asusrouter import AsusRouter
from asusrouter.modules.system_status import ARSystemStatusSourceUniversal
async def main() -> None:
router = AsusRouter(
hostname="router.my.address", # required, both IP and URL supported
username="admin", # required
password="password", # required
use_ssl=True, # optional
)
# Connects on enter, disconnects and closes the session on exit
async with router:
# Fetch data from the device
data = await router.async_fetch_data(ARSystemStatusSourceUniversal)
print(data)
asyncio.run(main())Each data domain (system status, clients, network, WiFi, ...) exposes its own source object under asusrouter.modules.*. Pass one - or a list of them - to async_fetch_data.
To change something on the device, build the matching action object and pass it to async_run_action. For example, to turn the LED off:
from asusrouter.modules.led import ARLedAction
async with router:
await router.async_run_action(ARLedAction(state=False))See the documentation for the full list of sources and actions.
AsusRouter supports virtually every AsusWRT-powered device. Each model links to its page; the find it links point to Amazon1.
Tip
Version 388.10 of AsusWRT-Merlin firmware is officially NOT supported due to the issues with HTTP daemon crashes. Use versions >=388.10_2 or <=388.9_2.
WiFi 7 | 802.11be — 13 devices
💚 Confirmed: GT-BE19000 (find it), GT-BE98 (find it), RT-BE58U (find it), ZenWiFi BT10 (find it)
💛 Expected to work: GT-BE98 Pro (find it), RT-BE88U (find it), RT-BE92U (find it), RT-BE96U (find it), TUF-BE3600 (find it), TUF-BE6500 (find it), ZenWiFi BD4 (find it), ZenWiFi BQ16 (find it), ZenWiFi BQ16 Pro (find it)
WiFi 6e | 802.11axe — 6 devices
💚 Confirmed: GT-AXE16000 (find it), RT-AXE7800 (find it), ZenWiFi ET8 (find it), ZenWiFi Pro ET12 (find it)
💛 Expected to work: GT-AXE11000 (find it), ZenWiFi ET9 (find it)
WiFi 6 | 802.11ax — 40 devices
💚 Confirmed: DSL-AX82U (find it), GT-AX11000 (find it), GT-AX11000 Pro (find it), RP-AX56 (find it), RT-AX53U (find it), RT-AX55 (find it), RT-AX56U (find it), RT-AX58U (find it), RT-AX68U (find it), RT-AX82U (find it), RT-AX86S (find it), RT-AX86U (find it), RT-AX86U Pro (find it), RT-AX88U (find it), RT-AX88U Pro (find it), RT-AX89X (find it), RT-AX92U (find it), TUF-AX3000 V2 (find it), TUF-AX5400 (find it), TUF-AX6000 (find it), ZenWiFi AX (XT8) (find it), ZenWiFi AX Mini (XD4) (find it), ZenWiFi Pro XT12 (find it), ZenWiFi XD5 (find it), ZenWiFi XD6 (find it), ZenWiFi XD6S (find it), ZenWiFi XT9 (find it)
💛 Expected to work: GT-AX6000 (find it), GT6 (find it), RT-AX3000P (find it), RT-AX52 (find it), RT-AX5400 (find it), RT-AX57 (find it), RT-AX57 Go (find it), RT-AX57M (find it), RT-AX59U (find it), TUF-AX4200 (find it), ZenWiFi AX Hybrid (XP4) (find it), ZenWiFi XD4 Plus (find it), ZenWiFi XD4S (find it)
WiFi 5 | 802.11ac — 17 devices
💚 Confirmed: 4G-AC55U (find it), BRT-AC828 (find it), DSL-AC68U (find it), RT-AC51U (find it), RT-AC52U B1 (find it), RT-AC5300 (find it), RT-AC57U V3 (find it), RT-AC58U (find it), RT-AC66U (find it), RT-AC66U B1 (find it), RT-AC68U (find it), RT-AC85P (find it), RT-AC86U (find it), RT-AC87U (find it), RT-AC88U (find it), RT-ACRH17 (find it)
💛 Expected to work: ZenWiFi AC Mini(CD6) (find it)
If you have found an issue working with the library or just want to ask for a new feature, please fill in a new issue.
You are also welcome to submit pull requests to the repository!
Testing the library with different devices would help a lot in the development process. Unfortunately, currently, I have only one device available, so your help would be much appreciated.
This library is a free-time project. If you like it, you can support me by buying a coffee.
Footnotes
-
As an Amazon Associate I earn from qualifying purchases. Not like I ever got anything yet (: ↩
