Skip to content
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

AsusRouter Integration doesn't reload automatically upon HA reboot [Bug] #841

Open
bfish2 opened this issue Jun 19, 2024 · 6 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@bfish2
Copy link

bfish2 commented Jun 19, 2024

The problem

For the past several months, when I have restarted HA, I have had to manually press reload on the entries for each AP in the integration in order to get it to fully load. More recently (past few weeks), I have had to press reload many times (up to 10 or more) on each entry in order to get them to fully load. Once loaded, the integration seems to be working OK.

Your device model

RT-AX92U

Firmware type

Stock

Firmware version

3.0.0.4.388_23630

Integration version with the issue

0.32.1

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

Core 20242.6.3

Is there anything useful in the logs?

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 8:17:01 AM (12 occurrences)
Last logged: 8:24:22 AM

Error setting up entry 192.168.86.1 for asusrouter
Error setting up entry 192.168.86.249 for asusrouter
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/asusrouter/__init__.py", line 27, in async_setup_entry
    await router.setup()
  File "/config/custom_components/asusrouter/router.py", line 363, in setup
    device_registry.async_remove_device(device_entry.id)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 947, in async_remove_device
    device = self.devices.pop(device_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen _collections_abc>", line 951, in pop
  File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 62, in __delitem__
    self._unindex_entry(key)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 543, in _unindex_entry
    super()._unindex_entry(key, replacement_entry)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 484, in _unindex_entry
    del self._identifiers[identifier]
        ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: ('asusrouter', '04:42:1a:6a:2d:20')

Diagnostics information

syslog.txt

Additional information

No response

@bfish2 bfish2 added the bug Something isn't working label Jun 19, 2024
@Vaskivskyi
Copy link
Owner

Hello, @bfish2. Thanks for your feedback and sorry for the issues you are experiencing. I will check this

@yuejon
Copy link

yuejon commented Jun 27, 2024

I also have this issue and my workaround has been to use an automation which loops and reloads the config until the integration is back online, whenever HA is restarted. Definitely would prefer a permanent fix in the integration itself, but this workaround at least lets me not have to constantly reload it manually after a restart.

alias: "Network: Reload AsusRouter integration on start"
description: ""
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - alias: Reload Asus ZenWiFi Router Config
    repeat:
      sequence:
        - service: homeassistant.reload_config_entry
          data: {}
          target:
            entity_id: sensor.asus_zenwifi_boot_time
        - delay:
            hours: 0
            minutes: 0
            seconds: 30
            milliseconds: 0
      while:
        - condition: and
          conditions:
            - condition: state
              entity_id: sensor.asus_zenwifi_boot_time
              state: unavailable
mode: single

@matt0020190
Copy link

Hi, just to report I have exactly the same issue. Eventually the integration reloads but it takes several attempts. Any update?

@bitlisz1
Copy link

bitlisz1 commented Sep 5, 2024

Same issue here with 2 pcs of RT-AX92U, and mesh router unavaiable, always need to reload integration.

@micdesa
Copy link

micdesa commented Sep 8, 2024

Same here

@bitlisz1
Copy link

Same issue here with 2 pcs of RT-AX92U, and mesh router unavaiable, always need to reload integration.

Sometimes Main router:

Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: 10:38:17 AM (1 occurrences)
Last logged: 10:38:17 AM

Error setting up entry 192.168.1.1 for asusrouter
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/asusrouter/__init__.py", line 27, in async_setup_entry
    await router.setup()
  File "/config/custom_components/asusrouter/router.py", line 370, in setup
    device_registry.async_remove_device(device_entry.id)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 1141, in async_remove_device
    device = self.devices.pop(device_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen _collections_abc>", line 951, in pop
  File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 62, in __delitem__
    self._unindex_entry(key)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 613, in _unindex_entry
    super()._unindex_entry(key, replacement_entry)
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 554, in _unindex_entry
    del self._identifiers[identifier]
        ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: ('asusrouter', None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Incoming
Development

No branches or pull requests

6 participants