[Custom component] AsusRouter integration

Something strange happened. I’ve updated/rebooted via HACS a few times over the past several weeks. Earlier today I checked and there were no updates available in HACS. Just now an update from 26.0 to 27.1 was available. Updating and rebooting has partially fixed my issues. The asusrouter services are now listed in Developer Tools.

Removing the device internet block works in Node Red as it has in the past. However, I now get an error when trying to block internet access via Node Red. Here is the JSON and error I get when I do the call service “device_internet_access”.

@automateitall,

The issue is fixed in the new 0.27.2 version. I am sorry for this bug. Unfortunately, I can’t perform tests with NodeRED usage of all the features due to the limited time I have for the development, so all the testing is only done directly in HA


0.27.2 :computer: Client devices improvements

2024-01-03

:octopus: GitHub release ←

:rocket: Features

  • Added device connections to allow:
    • device_tracker entity merge into the created device
    • merge device with the existing instances from other integrations

:bug: Bug fixes

  • Fixed issue with calling device_internet_access from NodeRED without device name (report #C706)

:coffee: Support AsusRouter

Monetary support:

Non-monetary support:

By the way, you might also be interested in:

1 Like

Thank you for all your hard work on this. You’ve tried to make it easier for us all to use your awesome integration with the new switches, so that is the route I’ve taken and it works great. Still using Node Red, but my call service is a simple switch toggle now.

Thanks again!

1 Like

Hi guys. I am not able to install integration. All what I can reach is "unknown error:
image
Credentials are OK, not using SSL.

2024-01-04 20:14:12.919 ERROR (MainThread) [custom_components.asusrouter.config_flow] Unknown error of type ‘<class ‘asusrouter.error.AsusRouterConnectionError’>’ during connection to 192.168.1.1: (‘Cannot connect to 192.168.1.1. Failed in _send_request’, None)

Anybody notice that devices seem to periodically go to away then back home pretty frequently since the last update. I use this a presence sensor and just updated this morning to 0.27.2. My device keeps saying I’m away then home and then away again. Wasn’t doing that before the update.

what ip number did you type in ?

both 192.168.1.1 and http://router.asus.com as well

with the same result

I have the same issue since I updated the integration today: Unknown error of type ‘<class ‘asusrouter.error.AsusRouterConnectionError’>’ during connection to 192.168.8.1: (‘Cannot connect to 192.168.8.1. Failed in _send_request’, None). No matter what I input same result.

@kajmaj, please, check your device settings. Make sure, access is allowed from the IP address of your Home Assistant instance. Check the Administration - System tab all the way to the bottom

The Enable Access Restrictions should be either set to No, or the HA IP be in the list of allowed

You can also try HTTPS access, which in general works better and allows concurrent connections (if connected via HTTP in Web UI already, the integration might not be able to connect because of it

Also, the device log might tell you if there are any errors and why.

1 reboot of the device also shows to help with at least 50% of the issues.

If nothing helps solving the problem, please, open an issue on GitHub and include the info about your device (model, FW version)


@smitius, which version did work fine for you before the update? There were no changes to the sign-in functionality for a long time. Please, try connecting both with and without SSL.

Please, also try a single reboot of your device (and then integration reload).

In case the issue stays, please open an issue on GitHub (link above).


@bh56,

From which version did you update? Lately, the client state functionality was adjusted for the cases when devices are getting stuck forever.

In case your devices seem to “blink” please make sure you are setting reasonable (or using the default) values for updating connected devices in the integration (Configure - Connected devices - Device update). The default is 30 s for update and 45 s to consider the device home (so, 2 times the client should report offline to actually change device_tracker to offline).

In case you are using the default values already, please try to check whether this happens to some specific devices or all of them.

hmmm, can’t really say, im on latest version, but didn’t had any issues when updated, so i never had to go through that “sequence”
I do however have some web-socket errors on http, could be related to latest Core update 2024.1.0 , no mention of asusrouter or issues connecting… and everything seems to work here thou

I believe I just took the defaults. On the Configure>Connected devices>Device Update? Is that Devices/AiMesh update* or Wait time(force update → check) seconds*. If it’s the 1st one, is the default 5 seconds for Wait time(force update → check) seconds*? And version, I usually keep things pretty current. So, would be the last 1 or 2 releases.

Some further details I’m seeing.
I only have/monitor my 2 Samsung S22 phones connecting to the network. Even thought they show/seem connected in my Asus RT-AX88U Pro, it seems like if I lock the phone, that shortly it shows up in HA as away. Then I unlock the screen, then it shows as Home. I don’t believe this was happening before. I believe I kept the default device configurations when I installed it. I’ll keep monitoring and see if I can see a trend any further of what might be causing this.

The problem started right after updating the component yesterday. I was on previous release for a while since May '23 I think. Did full reboots of everything, still the same issue. SSL/plaintext change make no difference, settings in router are ok - there was no change on router/fw/conf side. I made sure HA instance can curl the router endpoint web - so all works fine. I’m on merlin fw and RT-AC68U if that matters.

Thanks, it seems that ‘https’ solved the issue :+1:t2:

1 Like

@bh56, @smitius, please open new issues, so that we can troubleshoot everything properly.


@kajmaj :+1:

I have the beta 9.0.0.6.102 firmware on my GT-AX6000. I have no experience with the ASUSWRT integration prior to today. Unless I’m missing something, I am completely unable to log in to set up the integration.

Hello, @dl3

This topic is a discussion of AsusRouter custom integration. Make sure this is the one you are looking for, since there is an in-built ASUSWRT integration in Home Assistant

image

If so (or even not, but now you’d like to try AsusRouter), let’s continue

  1. Make sure AsusRouter is installed (as a custom integration it’s available through HACS)

  2. You need to provide hostname / IP address of your device

image

If it fails here, check that your HA can access your router. Make sure, the router does not have IP block for accessing it. In the router Web UI → Administration - System and all way to the bottom. Enable Access Restrictions option should be set to No or the HA IP be in the list of allowed

  1. Provide credentials. They are the same as the ones you use to access Web UI of the router.

image

I highly suggest keeping the SSL option on. This setting should be also enabled in the router settings (just above the setting discussed in 1)

  1. If you got here

image

just select Router (default) or any other mode of the integration you wish (this will define which sensors and controls will be available for Home Assistant)

  1. Set or ignore all other options. If you decide to ignore them - just click Save and finish (the bottom option)

image


This is the fast version of how to. In order to help with any exact problem, you’d need to give a bit more details on what exactly fails and at which step.

Feel free to ask. Your device and FW is fully compatible with the integration, so the only issue might be in the configs and that should be easy to fix

1 Like

0.28.0 :control_knobs: Control, choose, filter

2024-01-06

:octopus: GitHub release ←

:rocket: Features

  • Added option to filter connected devices (clients) (disabled by default)
    • No filter - all the devices are monitored. Device trackers are created (if enabled) + events are fired.
    • Include only - only the selected clients are monitored. Note, that in this mode, event asusrouter_device_connected cannot work to notify about new devices.
    • Exclude devices - all the devices are monitored, except the selected ones.
  • Added option to create HA device when user enables corresponding device_tracker entity (disabled by default) (report #48)
  • Added automatic device removal when no entity is left for the device (or when device_tracker is disabled)
  • Added option to remove devices attribute from the connected_devices sensor (disabled by default). This will help users with 100s of clients to avoid HA errors (report #628)
  • Removed the blank line in the configuration flow (report #752)

:open_book: Translations

  • Updated Ukrainian translation for the new configuration options

:open_book: How to and examples

Let’s imagine we have the following setting with the new version

This means:

  1. I decided to create a Home Assistant device when I enabled any device_tracker. Like this:

As soon as I disable this device tracker (actually, integration should reload as well, which is not automatic when disabling trackers), the device will be removed automatically (so that we don’t keep orphaned devices)

  1. It’s selected to store the clients list in the attribute - this is the default state and everything will be as before. If you wish, you can disable this one and save some storage in your database (if you record the sensor)

  2. The filter is set to include only. This would result in only 2 (as selected in the list) device trackers created.

image

This option does not interfere connected_devices sensor. But it blocks all the events the same way as device trackers.

  1. The list of the devices contains ALL the known to your router clients (not only connected, but ALL stored in the memory). So you can easily adjust the selection regardless of having some devices at home. Please, note that the list shows device names as defined here.

:coffee: Support AsusRouter

Monetary support:

Non-monetary support:

By the way, you might also be interested in:

Just and update. What fixed it for me was enabling 443 on router and SSL in the integration - then it worked. Plain http not.

1 Like

Hey folks, in the previous 0.27.x as well as latest 0.28 - the integration won’t show my OpenVPN status and toggle button anymore. I control on/off states and previously the integration loaded my VPN client names nicely. Anything specific I have to configure for it? I might have missed something.
UPDATE: OVPN entities were disables and once enabled and couple minutes passed , I got the status.

Thank you very much for the detailed reply. I was using the wrong integration. Unfortunately, I still have the same problem with the asus router integration. I believe I’ve traced it back to my IoT VLAN (where Home Assistant resides) not allowing access to the router config. This is probably not the place for networking questions but is there any way to allow that access without reconfiguring my whole network?