[Custom component] AsusRouter integration

In regards to the ha database I would think that the users who have large numbers of devices would have their recorder optimized to exclude and include specific entities.
I have mine on maríadb in another container.
I only include specific sensors I want to track and purge them every 90 days.
On proxmox I keep an eye on the size easily.

Do you mean to suggest AsusRouter instead of AsusWRT for Home Assistant Core?

I doubt, my integration can “replace” the in-built AsusWRT. There are several problems I see:

  • AsusWRT is used by at least 2213 people (via Analytics). Removing it and adding AsusRouter will break something for these 2k+ people.
  • AsusWRT uses different communication protocols - SSH or telnet by the time, so users cannot just ‘move’ automatically, even though the manual switch is easy and straightforward.
  • AsusWRT already has a PR to add support for HTTP protocol usage (link) created by one of the code owners (maintainers) of AsusWRT itself. Hanging there for almost half a year.

On the other hand, another of the two code owners has already mentioned (link), that he has moved on away from HA.

I would like for AsusRouter to be a part of HA Core and I can (or at least I have such a will) add it to the Core, if possible. But I don’t want to try it for nothing (since fulfilling all the requirements is not super easy). As well as don’t want to neglect the work of the AsusWRT authors.

So, in general, if you would like for AsusRouter to become a part of HA Core (become a built-in integration), you can create a thread in the Latest Feature Requests topics - Home Assistant Community (home-assistant.io). If it gets upvoted and the HA team is not against 2 different Asus integration being in Core, I think AsusRouter and AsusWRT could coexist.

If you would like to suggest the replacement of AsusWRT with AsusRouter eventually, the AsusWRT authors and HA team should be not against this. So, I would still suggest creating a ‘feature request’ for HA.

3 Likes

Also expected in 0.11.0

Spoiler #3

image

6 Likes

It looks like 0.11.0 is the new largest release. It would be hard to fit all the release notes in the HACS update window, so the full feature list will be here:

New entities

  • :girl: Full support for Guest WLANs (either switch or binary_sensor entities depending on your integration configurations).
  • :globe_with_meridians: OpenVPN Server support (switch / binary_sensor entities) with client_list attribute.
  • :point_up: New platform Button is added with 4 entities - Reboot, Restart HTTP Daemon, Restart Firewall and Restart Wireless. Probably, it is easy to guess, what they do.
  • :question: New platform Update is added, which will show whether your device can be updated to a newer firmware version.

Events and services

  • :bookmark_tabs: New service asusrouter_adjust_wlan, which can set settings of usual WLAN and Guest WLAN networks.
  • :exclamation: New events added - asusrouter_device_disconnected and asusrouter_device_reconnected. Their default state is off. Please use the Configure menu if you would like these events to be raised.
  • :vertical_traffic_light: All the events from now on are optional each has a switch in the Configure menu.

Other improvements

  • :open_book: The list of connected devices is now force-updated before it is polled from the device. This way the list will always be accurate (important for some older and some FW-limited devices)
  • :bulb: (Merlin) LED state is now recovered on device reboot and when some services (e.g. restart_wireless) are called from HA. This will prevent LEDs from turning on by themself, keeping the light entity in the wrong state. This problem is related to Merlin using its own way of LED control and ignoring native Asus services.

Deprecation warning

  • :scissors: With the implementation of button.reboot, the previously used service asusrouter.service_reboot is becoming deprecated. Buttons are easier for users to understand (and find) and can be implemented in all the same kinds of automation. If you are using asusrouter.service_reboot in your automations, please replace it with button.reboot. The service will be removed from the integration with version 0.12.0.

AsusRouter achievements

  • AsusRouter does support at least 26 different device models (as reported by users).
  • AsusRouter is used by at least 528 HA installations (as per HA Analytics, so only those who share data). In comparison, in-built AsusWRT is used by at least 2223 users. So, we have ~23.75 % of users in comparison to the integration which you don’t need to search for (and install from HACS). Sounds quite good.

Seems like that is it

:hammer_and_pick: More features are still in progress - I am trying to implement them as soon as possible, but you should consider that this integration is just my free-time project.


Version 0.11.0 of AsusRouter is already available in the HACS.

Release 0.11.0 :gift: More features than can fit in a single release note · Vaskivskyi/ha-asusrouter (github.com)

10 Likes

Any idea why the device Hostname won’t show?

ASUS Router Integration - Hostname Unavailable

Thank you. Works great.
Actually had to reboot my Asus today and your entity did the trick just perfectly!
Good job👍

I’m experience the same issue about event.data.name is always empty. It looks like a bug.
@Vaskivskyi, should we record this as an issue on GitHub or you prefer to concentrate the discussions here at the forum? I’m asking not only about now, but also for when we find issues in the future.

By the way, it would be also nice to have the MAC vendor name for new devices event (it won’t add value for reconnections and disconnections). I know this will require Internet connection, but maybe you should just return “unknown” when the request to the external API is not available.
There are public APIs for this: Api V2 Documentation | MAC Address Lookup (this one doesn’t require any authentication).

I’m not 100% sure about this feature request… It would be nice to have, but at the same time it would include external dependencies just to try fixing something that is not trivial in another way on Home Assistant…
Any thoughts?

@SpicyLimes, @EdwardTFN,

Anything special about the device(s) with an empty hostname? Wired, wireless? Or does it happen to all the devices connected?

@EdwardTFN,

It does not really matter, whether the discussion will be here or on GitHub.

I also don’t know about MAC lookup right away, but let me think about it.

All the devices…
I’ve just replaced my router by a new one, removed the integration and then added it again (now to the new router) and suddenly my automation was triggered for each one for the 70s devices connected… None if those have name.

I’ve also tried to add a device to the manual dhcp list including a hostname. Even in that case, the event returned none for the name. And I can see the proper name on the device list.

Just my two cents on the MAC vendor name suggestion:

A quick search found this MAC vendor list: https://gist.github.com/aallan/b4bb86db86079509e6159810ae9bd3e4

Wouldn’t it be better to include something like that instead of using external calls? For instance an option in component’s settings to download that list into HA database. The list above is less than 700 kB.

1 Like

@EdwardTFN,

Oh, sorry. I know about this, but I don’t know a way to avoid this. When you set up the integration for the first time (so, just add it), all the devices will be new devices and will trigger the event.

I’ll check why this might happen to the device names. I’ve managed to find only one on my network with an empty name in events.

I’m fine with that… I believe 99% of people will install the integration before creating the automation based on that integration, so they will never see this… :wink:

Seems like the issue is found. The fix will be released later today (CET) in 0.11.1

1 Like

:boom: 0.11.1 is already available via HACS

Including a fix for device names as well as a fix for the update entity.

@EdwardTFN, @SpicyLimes, please check whether with the new version all the devices are reported correctly in the events.


Full release log:
Release 0.11.1 :bug: Bug fix and updated translation​:open_book: · Vaskivskyi/ha-asusrouter (github.com)


Update

And the fastest bug fix release is going to 0.11.2. Important mostly for older devices.
Release 0.11.2 :bug: Bug fix · Vaskivskyi/ha-asusrouter (github.com)


Small ad

From time to time (not too regularly), I’ll be reminding, that you can support the development using the Buy Me A Coffee service. :coffee: It’s not obligatory, but adds lots of motivation :croissant:

Thanks a lot to anonymous (not really) and non-anonymous supporters from this thread! :beers:

2 Likes

Yes - thank you! The device name is now showing up on “Persistent” Notifications as well as “Notify” Notifications on my iPhone.

ASUS Router Notification

1 Like

It’s working like a charm…

Thanks again!!

1 Like

Hello there,

:books: I am planning to work on the new documentation for AsusRouter integration, so new (and existing) users will have more details on sensors, switches and events, as well as how to use them in automation. And won’t need to search for it everywhere around.

:mag: If you have ideas of what exactly would be nice to include or mention, let me know.

:bookmark_tabs: Also, if you have a device which is not yet included in the compatible devices list (currently 24 Asus devices and 2 Netgear using Merlin) and it works with the integration, I would appreciate this info.

Thanks for your attention! :beers:


P.S.s:

  • As usual reminding, you can always suggest new features for the integration or report any issues either here or on GitHub (link in the first post).
  • The list of features in work and consideration is also available on GitHub.
  • Unfortunately, some features cannot yet be implemented (including AiMesh support and Aura RGB controls) - for all of them I need a compatible device. As soon as I find (or will be able to buy) one for testing - these features will be implemented.
3 Likes

I don’t get it.

I want to login from my homeassistant on the Asus router.

image

and getting this error:

ERROR (MainThread) [custom_components.asusrouter.config_flow] Unknown error of type '<class 'homeassistant.exceptions.ConfigEntryNotReady'>' during connection to 192.168.2.250: 'NoneType' object is not subscriptable

The login does not work and I don’t know why.

I’m having exactly the same error on a RT-AX92U with Merlin.