-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Asus Router integration #86084
Add Asus Router integration #86084
Conversation
085a3ca
to
0f44ed4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am definitely no expert - but I wanted to give reading someone elses PR a try, looking through I didn't see anything that stuck out to me and my limited experience. I just had one note!
As well, it may be helpful to link the changelog for the asusrouter package in your PR description
Thanks for your review and your comments! I have added the changelog for the dependency bump between the initial commit of this PR and the last one. Unfortunately, I cannot add the whole changelog for the library from the beginning of its existence, since it is just a couple of weeks before the 1-year anniversary. That would be a long log. |
Any reason why there should be two Asus integrations on Home Assistant? Why not open this pull request to update the existing integration? |
Hey, @RenierM26. Thanks for your comments. I have made changes to the code to implement the suggestions. As for why there should be 2 Asus integrations, I have described it in detail in the Feature request mentioned in the PR. Please, check it out |
Hey, @vpathuis, Yes, both the entities - CPU and RAM usage are created as disabled. But after the user enabled them, they should be working Do you mind checking whether there are any errors/warnings in the log? If not, maybe you can also check, whether debug log is showing everything as expected: Example debug log
Thanks in advance! |
A question. After Translation files removed from Core repository, do I update PR immediately or do I wait for a proper review? It's not obvious and I don't want to change something in case a review is already in progress accidentally In any case, other than that, the PR is ready for review |
The PR is updated to fulfil the recent HA changes (manifest sorting, removal of translations and EntityCategory move) and is again ready for review |
Hi @Vaskivskyi, In general, the hass team avoids multiple integrations. (Difficult to maintain and support) They will most likely ask you to rebase on the existing integration. I know it's effort but it's possible to make it work with both the HTTP API as well as SSL (for legacy devices - don't know if it's worth keeping for a hand full of old devices though.). Just my 2c. |
Tbh I wouldn't agree with such an approach at all. The extra effort would be pure waste, especially since you end up cleaning up the old stuff anyway. I'd rather see a clean and fast path forward to the API version without any legacy to hold you back. I think the Z-wave JS approach was exacly that, and with good reason. |
🏇🏻 Meanwhile, the feature request to add Asus Router to HA has received 100 votes on the HA Community forum |
The latest commits:
|
Let me just make some consideration on this PR and all the others that involve AsusWRT integration on which I'm code owner. On May 2022 I created PR #71899 with the scope to extend the AsusWRT integration with the new HTTP protocol. This integration was ignored for many months by HA teams (I was thinking because it's to big), so I put that PR in draft and create the new PR #84152 with the scope to partially implement the previous one to give the ability to integrate new libraries in the original integration. In the meantime I also created a custom integration that is a copy of the first PR and that I'm using from months without any issue. Honestly I don't really like the idea to have 2 integrations for the same device, this will probably create a lot of confusion to the users. And the old integration cannot be simply removed, because old routers that do not implement HTTP API still need that version. But I really think that have new HTTP protocol available for new Asus routers is important, a well working device tracker is one of the most important part of Home Automation. So I hope that HA Teams will take one of this PRs in charge to better support one of te most used router. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asus Router integration
First I'd like to say that I used the HACS version of this integration and I really liked it. The config flow is one of the most complex I've seen and it provided a lot of helpful information from my router about my network. I can't speak for this core implementation, but I had some serious performance issues with the custom component. I ended up running the profiler service in HA and it was clear it was this integration that was causing the issues, and even more clear running the profiler after disabling this integration. I haven't had time to write up a detailed report, but I'd be happy to send over the profiler information. Otherwise, I'd be cautious of the performance impact of this integration as it's the only integration I've ever had to disable due to performance reasons. |
Having two integrations for the same device brand in core is not a good idea. Users shouldn't have to decide which integration is better. |
Yes, it will use both old SSH library (for compatibility with old router / firmware) and HTTP for new router / firmware. I just put PR #71899 in draft because I didn't receive any feedback for long time and I completed development as custom component here, but I can reopen and complete that PR based on custom component if you think that this approach is the right one. |
I tested both custom integrations... and both work well and offer similar features. Asus Router creates more entities but the config flow is not user friendly. Hard to say which integration is better. @ollo69 I think that splitting this change into smaller steps is much better approach. I will look at the first step #84152 this week. |
Yes, that's correct. Actually it works with all the versions of Asus FW since the implementation of the native API (so, released in the last 12 or so years). This includes some of the 380.xx versions, even though not all of them The same way I agree that having 2 integrations is not the best solution, I would like to point a problem of having a single integration with which user can have completely different set of sensors and controls depending on what they selected as a connection interface |
@ScottG489, as I have asked you on the Community forum, it would be nice to get from you at least some information about the device you are using (model and FW version), as well as some other details about the device settings. AsusWRT firmware has some problems which might provide performance issue on the integration side - e.g. with hanging the connection sessions instead of closing or reporting them. In order to help with your issue (and any other issue with AsusRouter custom integration), I need to be able to diagnose and troubleshoot which exactly part is not working properly |
Fine, I will rebase #84152 shortly.
That's the scope of PR #84152. We could work together on next PRs and base library to obtain the best results. |
@Vaskivskyi I appreciate your hard work on this integration and I understand your frustrations if this PR is not merged, probably users who use it as a custom one won't be happy either. |
We definitely can try that. And then we'll see how it goes |
It is possible to have two integrations for the same brand. When adding a config entry for Ikea, the user will be asked to decide which integration to add: @Vaskivskyi Is it possible to detect which communication protocol should be used? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevertheless, if you want to add the https communication as own integration, please rebase and fix the merge requests.
After that, I can start with a review.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
@Vaskivskyi If I understood it correctly, only #95720 should be merged, which combines both protocols, correct? |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Proposed change
Hello,
I would like to suggest implementing a new integration
Asus Router
(domainasus_router
), providing the possibility to control Asus wireless devices (including routers, access points and mesh nodes) using the native Asus HTTP(S) API. This is the way the Web UI for the devices work as well as the official Android and iOS apps. As a result, if implemented, the integration potentially can support all the features supported by devices.Currently, HA Core already has ASUSWRT integration for Asus devices, which allows control using SSH/Telnet protocols. But both these ways are not working well with the newer device models.
The proposed integration is based on the custom
AsusRouter
integration already been used by HA users for almost one year. Recently I posted a Feature request on the Community Forum with the idea to implement it into HA Core. Since it got some popularity and I did not find anything against the proposal, here is the first PR.This PR contains the base for the integration to be useful for users with support of the
Sensor
platform and 2 sensors (CPU and RAM usage). If accepted, the plan for the next PRs is to add other platforms as well as more actual sensors for theSensor
platform. Also, currently, only tests for the configuration flow are provided (as required), but I would like to implement other tests as well.I am looking forward to your comments and suggestions on the code to make it better and more suitable for HA Core.
Also, there is a bit more on why the integration should be separate from the currently existing ASUSWRT in the abovementioned feature request.
Sincerely,
Yevhenii
Update 1: Added link to the PR for documentation
Update 2: Changelog for the dependency bump between the initial and the last commit: Vaskivskyi/asusrouter@0.18.1...0.18.2
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: