It seems, that one of the API endpoints (the one reporting LAN/WAN ports status) is not responding. That happens with some devices. You can try rebooting your router and then reloading integration - it should work again
Of course, this is not a fix, but a shortcut. I will fix the code producing the error and it will be released in the next integration update (sometime this weekend)
The latest features are amazing, the port forwarding service call is exactly what I have been looking for. I have tried it out and adding port forwarding rules works well, I even have a template value that will add the external port of my phone as it changes. One question though, I cant seem to get the remove service call to work. Are there specific values it requires, I tried using the exact same values in the “action: set” and just changed it to remove, I also tried just using the port forward name but the rule still remains. Any guidance would be appreciate.
→ this will remove all the rules for the selected IP.
P.S. The name value is not checked, since it is not actually required and is not a unique parameter of the port forwarding settings.
If it still does not work, please check the log for errors/warnings after calling the service. If needed, please open an issue on GitHub with the info about your device and the log
Thanks this worked a treat. I did find however there must be some rate limit as calling multiple changes through an automation would create problems. I just added a few second wait between service calls.
Today is the first Birthday of the AsusRouter Python library. The first release was published on 12.02.2022. This was a long and quite productive journey and I hope that AsusRouter will continue growing further.
By the way, the AsusRouter library was downloaded more than 17K times in the last month! AsusRouter integration is currently installed in 754 HA instances reporting to Analytics.
Sensors lan_speed and wan_speed are deprecated. They will be removed in version 0.22.0. Please, use the new sensors port_status_lan and port_status_wan
Features
Added new Port status sensors (LAN - port_status_lan, USB - port_status_usb, WAN - port_status_wan), reporting more information on the physical ports connections. The feature is fully supported by FW version 388.x. With older versions, new sensors might reflect fewer data (mimicking deprecated lan_speed and wan_speed sensors with the new format). More details on the new features
Bug fixes
Fixed bug in the backend library causing errors when device API stops reporting some information (report #C471)
Thinking of buying a new Asus router to use with AsusRouter integration? Check the compatibility list in our Docs. If you will use any of the Amazon Associate links, I might get a small (1-3%) bonus from Amazon (usage of the associate links does not change the price of the items for you)
Know a person with an Asus device using Home Assistant but not AsusRouter? Let them know, AsusRouter is cool and has lots of useful features
Our progress on the way to HA Core
We have already received 90 votes. Add your one. More votes we get, the more chance that HA developers will notice it and give a review to the PR in the HA Core repository, which is required to add AsusRouter into Core.
Congratulation(HBD) from Northern Europe, and huge thanks for your great work
EDIT: And cool to see the Lan-Ports, and USB-Port, thou as it’s states of a value in a list in attributes, im lost … i have no idea how to get there, ive’ tried with various attributes-cards … thou seems like one have to use a template-sensor, for showing those states … would be great if you have any good ideas/card tips for that
In version 17.4, that worked.
Any version later than 17.4, I got this on screen:
Fail to call service asusrouter.device_internet_access. Unknown error.
and this in log:
This error originated from a custom integration.
Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/asusrouter/bridge.py:808
Integration: AsusRouter (documentation, issues)
First occurred: 11:33:25 AM (1 occurrences)
Last logged: 11:33:25 AM
websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 684, in _async_call_service_step
await service_task
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/core.py", line 1787, in async_call
task.result()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/core.py", line 1824, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/home/homeassistant/.homeassistant/custom_components/asusrouter/router.py", line 923, in async_service_device_internet_access
await self.bridge.async_parental_control(raw=service.data)
File "/home/homeassistant/.homeassistant/custom_components/asusrouter/bridge.py", line 808, in async_parental_control
return await self.api.async_set_parental_control_rules(
File "/srv/homeassistant/lib/python3.10/site-packages/asusrouter/asusrouter.py", line 1351, in async_set_parental_control_rules
return await self.async_apply_parental_control_rules(current_rules)
File "/srv/homeassistant/lib/python3.10/site-packages/asusrouter/asusrouter.py", line 1297, in async_apply_parental_control_rules
request = compilers.parental_control(rules)
File "/srv/homeassistant/lib/python3.10/site-packages/asusrouter/util/compilers.py", line 144, in parental_control
timemaps += f"{data[rule].timemap.replace('<', '<')}>"
AttributeError: 'NoneType' object has no attribute 'replace'
If I downgrade back to 17.4, service works with no error.
Any help would be appreciated.
Sorry, I haven’t seen that you have updated your post with a question. I am only getting notifications on “new posts”. But I am glad, you found a solution
Sorry to hear that you are experiencing this issue. From the log, it seems like there is a problem in the backend library. Please allow me some time to localize and fix it.
I didn’t wanted you to bother bout this, on the 1st Birthday celebration … id figured you eventually would see it, but yes i found a perfect “solution” , am about to build a new overview/splash page of my network, where obvious The AsusRouter will have the main role
@Vaskivskyi Hi, and thank you for great integration!
Is there any way to determine the secondary WAN (USB modem) operation after failover?
I can try with IP, but I thought you might have some dedicated switch I was unable to find.
@SuperMaximus, do you mean whether the USB modem started providing an internet connection after the primary WAN failed? Or something else? Please, give an example of how / when you would like to use it, so it would be easier for me to help
Yes, absolutely.
I need to send a HA notification when failover triggers and the USB modem from Secondary WAN becomes an active internet provider (turns from Cold Standby to “Connected”)
Thanks for this awesome integration. Have been using it for a month or so and it is much better than the default integration, both in terms of stability and feature set.
I have given my vote for this to become part of HA core.
Just wondering if anyone is getting this behaviour where this integration picks up devices and entities from other integrations. See screenshots below. I had the same issue with the default ASUS integration as well. Not sure what this would point to.
To be clear, this doesn’t create any errors but just weird to see the UI like this.
This is the default Home Assistant behaviour and does not depend on AsusRouter.
AsusRouter creates device_tracker entities for all the connected devices. When the MAC address of the connected device is known to HA (such a device exists in another integration), the device tracker is automatically attached to a device and it starts showing in both integrations.
Fixed bug with port forwarding settings, when some of the parameters are not provided (report #538)
Fixed bug in parental control service (report #C479)
Breaking
This release is removing direct migration from versions before 0.17.0. If you are still on an older version, please firstly update to any between 0.17.0 and 0.20.0 and only after that update to 0.21.0. The migration guidline for different versions is updated in the documentation
Thinking of buying a new Asus router to use with AsusRouter integration? Check the compatibility list in our Docs. If you will use any of the Amazon Associate links, I might get a small (1-3%) bonus from Amazon (usage of the associate links does not change the price of the items for you)
Know a person with an Asus device using Home Assistant but not AsusRouter? Let them know, AsusRouter is cool and has lots of useful features
Our progress on the way to HA Core
We have already received 99 votes. Add your one. More votes we get, the more chance that HA developers will notice it and give a review to the PR in the HA Core repository, which is required to add AsusRouter into Core.
After this install (0.21.0) the discovery keeps finding the router after HA restart.
Even when you finished the first discovery and everything was all set