[Custom component] AsusRouter integration

@michel130, @contrasenda,

Can you please check the new version 0.11.3? Unfortunately, there were a couple of bugs in 0.11.2, which are device-dependent and which I was not able to track with my only device.


Please, welcome the new release. It includes fixes for the version module (which resulted in wrong update entity values for some users of older devices and crashes of the whole integration for some other devices). Moreover, a problem with reaching connection timeout with some requests should be fixed now.

Release 0.11.3 :bug: Bug fixes Ā· Vaskivskyi/ha-asusrouter (github.com)

2 Likes

Itā€™s working perfectly now! Thank you so much!

Hi, Iā€™ve been using this integration for a few months and it works great :slight_smile: A few days ago I updated to Merlinā€™s latest alpha release of firmware for my AX88U. Ever since then the following two sensors no longer work in the integration:

sensor.rt_ax88u_temperature_2_4_ghz
sensor.rt_ax88u_temperature_5_ghz

They both have the error ā€œThis entity is no longer being provided by the asusrouter integration. If the entity is no longer in use, delete it in the settingsā€.

Appreciate the Merlin firmware is an alpha release, but I thought Iā€™d mention it as he may have changed something that needs to be reflected in this integration going forward. If youā€™ve got any ideas on how I could go about fixing it, that would be great. Worst case Iā€™ll roll back to the latest build firmware, and hopefully that will sort the issue.

Thanks for the great work!

1 Like

I donā€™t think it has to do with merlinā€™s alpha release specifically, but the fact that Asus changed/updated things on their official firmware, which is what the new merlin alpha firmware is based on. So even if you update to the newest official Asus firmware, the issue will be there.

@GHC88UK,

Thanks for your info! As @moto2000 has noticed, the new alpha is based on 3.0.0.4.388.x firmware from Asus - and I can check the official one against changes in temperature sensors. If it is Asus-related, it will be fixed as soon as possible.

Unfortunately, I cannot guarantee the work of integration with the alpha releases of Merlin. But as soon as Merlin will release a stable version, I can fix Merlin-only bugs.


Support of different firmware and bug fixing (for all the users interested)

I would like to explain, how exactly are the bug fixes released for the integration.

  • Any change in the backend library (the link between the integration and your device) is tested against RT-AX88U with both official Asus FW and with the latest available stable Merlin release. So by the time of the actual release of a new integration version, there should not be any problems with most of the devices.
  • If any problem is reported and all the required data is provided by the user with an issue (and the problem can be fixed), it will be fixed as soon as possible.

Now about the limitations:

  • I cannot test changes in code against all the possible devices (since I have only one) - so some device-specific problems might appear.
  • I cannot test changes against anything except for official Asus FW versions or stable Merlin versions - the next section will be about this.
  • I cannot fix a bug if no (or not enough) details on the issue are provided.
  • Yes, there might be some problems which I cannot fix (mostly connected to some specific device or FW version).

About the latest issue fixed in 0.11.3

The crash of integration for some devices was connected to the problems with the FW version for the Gnuton releases of Merlin. To be more exact, the fact of making the FW version longer than expected via adding -gnuton.

As I have already mentioned, the only testing device is RT-AX88U. Gnuton fork of Merlin is released for less than 10 models and not for this one.

So, as soon as all the required data was collected (thanks to this bug report), the problem was fixed.

1 Like

You are managing this very professionally way and Iā€™m impressed on what you have done with all those limitations.

I would be happy to help more with tests using the devices I have on my hands. I have a couple of brand-new AX-8 in production, but my RT-AC88U still sitting on my desk, and I will be happy to use it in a testing environment.

But I also think you should add your ā€œBuy a coffee to Vaskivskyiā€ link to your signature and I will be also happy to invite people here to visit that link from time to time. :wink:
I would love if you buy a router just like mine, so I will have a better integration for myself. Itā€™s too expensive for one person to buy this to you, but itā€™s not that expensive if half of those 500 users can give a bit.

1 Like

@Vaskivskyi Vaskivskyi

Thanks with 0.11.3 It works perfectly.

1 Like

@Vaskivskyi, for your info, the GT series have now a new ā€œVPN Fusionā€, where you can create up to 16 VPN client profiles and associate devices to each profile. The UI to setup this is quite different from the RT series and this integration you developed didnā€™t support that (at least isnā€™t working on my tests).

Iā€™m not requesting priority to this, as I rarely control the VPN clients from HA, but I think you would like to know about this.

For more info: [Wireless Router] How to configure multiple VPN connections on ASUS Router (VPN Fusion)? | Official Support | ASUS Global

And couple of screenshots:


1 Like

Is it 3.0.0.4.388.xxx firmware? Yes, unfortunately, they have rebuilt all the VPN functionality, so for these new 388 versions (which are already available for some devices), it should be implemented into integration from scratch :hammer_and_wrench:

1 Like

Max length of state is 255 chars. Not enough for my whitelist. Other ideas?

You can always put it into an attribute

template:
  - binary_sensor:
      - name: AsusRouter/Allowlist
        unique_id: asusrouter_allowlist
        state: True
        attributes:
          list: >
            {{ ["00:aa:00:aa:00:aa", "00:ab:00:ab:00:ab", "00:ac:00:ac:00:ac"] }}

I am a bit lazy to copy-paste more MACs, so letā€™s say, 1782 MACs in the list is enough for an allow list :slightly_smiling_face:

1 Like

Hello there,

The initial version of the new AsusRouter documentation is already available here:

https://asusrouter.vaskivskyi.com

:open_book: Currently, it includes:

  • Installation process
  • Description of different integration options
  • Available features (including entities and their attributes, services and events) by groups
  • FAQ with one question and answer regarding firmware versions

:watch: Expected soon:

  • Examples of automations
  • More answers for FAQ
  • Supported devices and their features
  • Examples of dashboards

Ideas and suggestions are welcome!


Update 1: More answers are already in FAQ with even more coming soon.

4 Likes

Heya!

I configured this addon using my router DNS name instead of itā€™s IP.

However, I see that in Adguard (DNS provider for my home network) I see a lot of requests from HA to have the IP of my router DNS name.

Iā€™m almost sure itā€™s this addon that causes these high requests.

Is there a way to reduce them? In the install process, I added 0 in the sync options in order to avoid sync (I donā€™t need the CPU/ram stuff yet), however I keep seeing 2 different requests every 10sec.

Thanks!

Just my curiosity playing hereā€¦
I believe you have a static IP for your router, is that right?
If that is the case, what is the point of using DNS name instead of the IP address? That will cause unnecessary DNS queries anyways, no?

Hello,

If you set up the integration to use the hostname, it will use it for all the connections. That is the point of giving choice between IP / hostname. This, of course, means that each time your local DNS will be asked for the correct IP for connection - this is the way how DNS works and there is nothing to do with it.

The IP is asked from the DNS depending on the settings of your HA host device. E.g. most of the devices are querying DNS once per 5-10 seconds, which is also the case for you. Two queries are probably because of asking for both A and AAAA records.

There are 3 options if you donā€™t want integration to ask DNS about the router IP:

  • Configure the integration again using IP - this will avoid any DNS requests.
  • Add your router hostname/IP to the hosts file of your HA host device - no DNS requests will be made.

And the one possible, but better not be using:

  • Change the frequency of querying DNS from your HA host device - this will influence ALL the DNS queries.

@EdwardTFN,

Yes, usage of hostname instead of IP will always create DNS queries. Except for specifying hostname/IP bind in hosts, as discussed above.

The general thoughts about hostnames and local DNS.

pros:

  • You donā€™t care about device IP when configuring any endpoint device (integration in this case).
  • When migrating between networks, there is no need to reconfigure endpoint devices. Just DNS - once.
  • Can work with dynamically assigned hosts with a proper DNS configuration.

cons:

  • Need to configure your DNS records.
  • Creating some network traffic for DNS queries.

So, from the integration point of view, the advantage would be - you are migrating your network to use another IP pool or something similar - you donā€™t need to reconfigure integration.

For example, I am using local DNS and am completely happy with it.

  • The amount of network traffic is neglectable.
  • There is no noticeable usage of resources of the DNS host device in comparison to all other smart home software running there.

Obviously, in the case of a router, the chance of IP change is quite low for an average user :slightly_smiling_face: But some people are changing their networks significantly from time to time.

But in general, hostnames are quite cool and useful :slightly_smiling_face:

1 Like

Possible to include information about what network a device connects to in the events? Like if itā€™s a guest network and if itā€™s 2,4 GHz or 5 GHz. For consistency the same data should perhaps be added to the connected_devices sensor as well.

Yes, it is possible - for both events and connected devices sensor. What is the use case you want it to use?

Iā€™ve set up an automation that notifies me when devices reconnect/connect thatā€™s not in my whitelist. It would be nice to know if the device connecting was actually using my guest network. And if it wasnā€™t I could tell the person to connect to my guest network instead.

If you do add this Iā€™m sure someone would like data about what ESSID a device is connected to as well. :stuck_out_tongue:

1 Like

@Vaskivskyi, any clue about what could be causing this intermittent error?

This error originated from a custom integration.

Logger: custom_components.asusrouter.router
Source: helpers/update_coordinator.py:151 
Integration: ASUS Router (documentation, issues) 
First occurred: 10:37:50 (12 occurrences) 
Last logged: 23:30:10

Error fetching cpu data: None
Error fetching gwlan data: None
Error fetching vpn data: None
Error fetching wlan data: None
Error fetching wan data: None

Hey,

Sorry to hear, there are some issues appearing.

Did you notice any obvious reason why / when or how regularly it happens? Do the sensors recover afterwards or does integration stuck?