Skip to main content

API wrapper for communication with ASUSWRT-powered routers

Project description

GitHub Release License
Downloads Commit activityBuy Me A Coffee

AsusRouter

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 only used for the custom AsusRouter Home Assistant integrartion. But I am always open to making it suitable for any other use.

Installation

Installation of the latest release is available from PyPI:

pip install asusrouter

Usage

Once installed, you can import the AsusRouter class from the module. Example shows the default parameters except for host, username and password.

from asusrouter import AsusRouter

router = AsusRouter(host = "router.my.address",         #required - both IP and URL supported
                    username = "admin",                 #required
                    password = "password",              #required
                    port = None,                        #optional - default port would be selected based on use_ssl parameter
                    use_ssl = False,                    #optional
                    cert_check = True,                  #optional
                    cert_path = "",                     #optional
                    cache_time = 5,                     #optional
                    enable_monitor = True,              #optional
                    enable_control = False)             #optional

The module has the initialization method to load all the known data (all the monitors and methods from the next section, require enable_monitor to be True):

router.async_initialize()

Monitors and additional methods

Most of the values, obtained from the router are grouped in several monitor methods to decrease the amount of data sent between the library and the device. All of them require the enable_monitor parameter of AsusRouter to be set to True.

async_monitor_main()
async_monitor_nvram()
async_monitor_misc()
async_monitor_devices()

A detailed description of monitors and monitoring methods is available here (in work).

Commands

AsusRouter class supports sending commands to the device using the async_command method. Sending commands requires the enable_command parameter of AsusRrouter to be set to True.

For example, to reboot the device:

# This command will REBOOT your device if connected!
router.async_command(commands = {"rc_service": "reboot"}, action_mode = "apply")

Commands to the method should be sent as a dict of command: value. Please, refer to the Command List (in work) for a detailed explanation of the available commands.

Supported devices

This list provides only the models tested by me or other users.

GroupDevicesFirmwareLimitation
Full support

802.11ax:
DSL-AX82U (link*)
GT-AX11000 (link)
RT-AX55 (link)
RT-AX58U (link)
RT-AX68U (link)
RT-AX82U (link)
RT-AX86U (link)
RT-AX86S (reported as RT-AX86U) (link)
RT-AX88U (link)
RT-AX89X (link)
RT-AX92U (link)
TUF-AX5400 (link)
ZenWiFi AX (XT8) (link)
ZenWiFi AX Mini (XD4) (link)

802.11ac:
4G-AC55U
DSL-AC68U (link)
RT-AC5300
RT-AC86U (link)
RT-AC88U (link)
RT-ACRH13

Stock: Any
Merlin: Any
Limited support

802.11ac:
RT-AC51U (link)
RT-AC66U (link)
RT-ACRH17 (reported as RT-AC82U)

802.11n:
RT-N66U

Stock: Latest available
Merlin
: 380.70+
no LED control
Non-Asus devices

Netgear:
R6300V2,
R7000

Merlin: 380.70+
Not supported

DSL-AC68VG (non-compatible FW)

* As an Amazon Associate I earn from qualifying purchases. Not like I ever got anything yet (:

Support the library

Issues and Pull requests

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!

Check it with your device

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.

Other support

This library is a free-time project. If you like it, you can support me by buying a coffee.

Buy Me A Coffee

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asusrouter-0.14.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asusrouter-0.14.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file asusrouter-0.14.0.tar.gz.

File metadata

  • Download URL: asusrouter-0.14.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for asusrouter-0.14.0.tar.gz
Algorithm Hash digest
SHA256 a29880c2c531bcf391dbc65c71e75ead3af427ae197b7e8e1416ec673d56f1b9
MD5 06953e170753506b631064ccd26f5dc9
BLAKE2b-256 4f5a35194d337c31cec43d535f36d7ad9646946ce54edad208ecdb3c6a57576c

See more details on using hashes here.

File details

Details for the file asusrouter-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: asusrouter-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for asusrouter-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1821f67ef2c6afd61b7410520554db8a2e7e09511e5a4f866f5feeb96d27c22c
MD5 77f9f9a6526272048a5c49ec114c7dbb
BLAKE2b-256 d24d12f6a4237ae8cf716e82f51630646ec36a6489cd61d0a798a4a754aaa4bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page