Vaskivskyi / ha-asusrouter

Monitor and control your AsusWRT-powered router from Home Assistant
https://asusrouter.vaskivskyi.com
Apache License 2.0
188 stars 17 forks source link

[Bug] Integration constantly being rediscovered on every HA reboot #581

Closed Salvora closed 9 months ago

Salvora commented 1 year ago

The problem

Hello, I already have the integration set up and running but for every reboot of HA it is being rediscovered again. Even if I add it again, it just keeps creating duplicating for the same device.

This issue came up recently. I think it might be related to the new SSDP discovery feature.

image

Your device model

RT-AC5300

Firmware type

Merlin

Firmware version

3.0.0.4.386.7_2

Integration version with the issue

0.22.0

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

Core 2023.3.5

Is there anything useful in the logs?

None

Diagnostics information

config_entry-asusrouter-0c305ec51a5b4297704092fc7234f35b.json.txt config_entry-asusrouter-d89510438acaf785aa229ed9f6b3d602.json.txt

Additional information

No response

groove200 commented 1 year ago

Im seeing the same...thought i saw a note in most recent release about duplicates and thought it was going to fix it. sadly not

Vaskivskyi commented 1 year ago

Hello, @Salvora, @groove200,

I am sorry the issue is still happening to you. Can you please try the following?

Try to remove all of the AsusRouter instances and reboot the HA. After reboot, the device will be discovered automatically. Add it properly and again reboot the HA. Will it find the same device again and suggest adding it?

This is needed to understand, whether the issue is caused by the current integration version or by the legacy parts from before

graywizardx commented 1 year ago

For me following those instructions it does rediscover it.

I removed all entries. Restarted Ignored discovery, removed integration Restarted Installed integration Restarted Performed Discovery steps Restarted Discovererd a new instance and kept doing it through several restarts.

As additional info: I have two AsusRouters in Mesh configuration When I allow it to discover multiple times, each "instance" does not have all devices, it only contains some.

It appears that it only picks up a few entries in each instance, and ignores others.

Vaskivskyi commented 1 year ago

Thanks, @graywizardx!

Salvora commented 1 year ago

I did follow the steps but it still rediscovers the same device multiple times.

groove200 commented 1 year ago

Hey, tested it still the same im afraid

1) deleted configured instance 2) Installed the 'waiting' duplicate instance 3) deleted this instance 4) rebooted 5) configured new instance 6) rebooted 7) another instance was detected

TermiNaderTL commented 1 year ago

Same issue here. I have one router and two nodes. After three reboots of HA, I have four entries.

image image image image image

Hope you figure this one out...it's an excellent integration!!!

havrancek commented 1 year ago

I have the same problem

RosensRauk commented 1 year ago

Also have this problem since installing this.

gschmidl commented 1 year ago

I have a similar problem, but it also happens if I change the router's configuration. This was the first time I ever installed the integration.

Vaskivskyi commented 1 year ago

Hello, everyone,

Is there anyone with RT-AX88U or RT-AC66U to have such a problem? This issue is rather hard to reproduce and it would be nice to find out whether it's model-related, FW-related, or anything else.

P.S. Please, add the models of your devices and the FW version, so I can try to collect some statistics

samoz83 commented 1 year ago

Seems to happen on my RT-AC86U running merlin firmware: 3.0.0.4.386.11_0

superman54 commented 1 year ago

It happens with my AX11000 running 3.0.0.4.388_23285. I have two AX92's and a AC68 in mesh, but those do not get rediscovered.

havrancek commented 1 year ago

I have AX86U on latest Merlin and have this problem

graywizardx commented 1 year ago

Is it possible to get a description of what is happening internally? Is this a lack of some kind of unique identifier to disambiguate, or something else?

The process is pretty incomprehensible from a logs perspective, and I have not had time to dive the code.

On Tue, Jul 18, 2023 at 12:43 PM havrancek @.***> wrote:

I have AX86U on latest Merlin and have this problem

— Reply to this email directly, view it on GitHub https://github.com/Vaskivskyi/ha-asusrouter/issues/581#issuecomment-1640899352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALK5K6BIIEUV25DMEHBTLDXQ3ROFANCNFSM6AAAAAAWBPOFDE . You are receiving this because you were mentioned.Message ID: @.***>

Vaskivskyi commented 1 year ago

Hello. Looks like autodiscovery is going to move from the feature available for everyone to a separate set of experimental features so that users can disable it and it won't be bothering part of the users.

The method of discovery in question is UPnP. The logic is the following:

Unfortunately, I don't see any reason why would it not work. Or actually, why it works for some devices, but not for all.

I will let you know as soon as the feature is moved to experimental. At that point, some additional troubleshooting features will be added for it, so users willing to help with its development, will be able to get additional info from the UPnP and device

modelstudent101 commented 1 year ago

Thanks -- I'm having this issue as well, with an AX-86U in Router Mode, with an AX-82U in AP Mode. Both devices are running Merlin FW.

FWIW, I have UPnP disabled on my router.

Vaskivskyi commented 1 year ago

Hello,

If any of you have already updated to the new beta 0.23.0b1, please turn on debug logging and check the HA log.

Example log ``` 2023-10-30 07:24:27.401 DEBUG (MainThread) [custom_components.asusrouter.config_flow] Discovered SSDP device with serial number: M6IMHP****** 2023-10-30 07:24:27.401 DEBUG (MainThread) [custom_components.asusrouter.config_flow] Discovered SSDP device: SsdpServiceInfo(ssdp_usn='uuid:3ddcd1d3-2380-45f5-b069-************', ssdp_st='uuid:3ddcd1d3-2380-45f5-b069-************', upnp={'deviceType': 'urn:schemas-upnp-org:device:InternetGatewayDevice:1', 'friendlyName': 'RT-AX88U', 'manufacturer': 'ASUSTeK Computer Inc.', 'manufacturerURL': 'http://www.asus.com/', 'modelDescription': 'ASUS Wireless Router', 'modelName': 'RT-AX88U', 'modelNumber': '388.4', 'modelURL': 'http://www.asus.com/', 'serialNumber': 'M6IMHP******', 'UDN': 'uuid:3ddcd1d3-2380-45f5-b069-7c10c9036d90', 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:Layer3Forwarding:1', 'serviceId': 'urn:upnp-org:serviceId:L3Forwarding1', 'SCPDURL': '/L3F.xml', 'controlURL': '/ctl/L3F', 'eventSubURL': '/evt/L3F'}}, 'deviceList': {'device': {'deviceType': 'urn:schemas-upnp-org:device:WANDevice:1', 'friendlyName': 'WANDevice', 'manufacturer': 'MiniUPnP', 'manufacturerURL': 'http://miniupnp.free.fr/', 'modelDescription': 'WAN Device', 'modelName': 'WAN Device', 'modelNumber': '20230821', 'modelURL': 'http://miniupnp.free.fr/', 'serialNumber': 'M6IMHP******', 'UDN': 'uuid:3ddcd1d3-2380-45f5-b069-************', 'UPC': '000000000000', 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1', 'serviceId': 'urn:upnp-org:serviceId:WANCommonIFC1', 'SCPDURL': '/WANCfg.xml', 'controlURL': '/ctl/CmnIfCfg', 'eventSubURL': '/evt/CmnIfCfg'}}, 'deviceList': {'device': {'deviceType': 'urn:schemas-upnp-org:device:WANConnectionDevice:1', 'friendlyName': 'WANConnectionDevice', 'manufacturer': 'MiniUPnP', 'manufacturerURL': 'http://miniupnp.free.fr/', 'modelDescription': 'MiniUPnP daemon', 'modelName': 'MiniUPnPd', 'modelNumber': '20230821', 'modelURL': 'http://miniupnp.free.fr/', 'serialNumber': 'M6IMHP******', 'UDN': 'uuid:3ddcd1d3-2380-45f5-b069-************', 'UPC': '000000000000', 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:WANIPConnection:1', 'serviceId': 'urn:upnp-org:serviceId:WANIPConn1', 'SCPDURL': '/WANIPCn.xml', 'controlURL': '/ctl/IPConn', 'eventSubURL': '/evt/IPConn'}}}}}}, 'presentationURL': 'http://192.168.***.***:80/'}, ssdp_location='http://192.168.***.***:60583/rootDesc.xml', ssdp_nt=None, ssdp_udn='uuid:3ddcd1d3-2380-45f5-b069-************', ssdp_ext='', ssdp_server='AsusWRT/4.1.51 UPnP/1.1 MiniUPnPd/2.3.3', ssdp_headers={'CACHE-CONTROL': 'max-age=120', 'ST': 'uuid:3ddcd1d3-2380-45f5-b069-************', 'USN': 'uuid:3ddcd1d3-2380-45f5-b069-************', 'EXT': '', 'SERVER': 'AsusWRT/4.1.51 UPnP/1.1 MiniUPnPd/2.3.3', 'LOCATION': 'http://192.168.***.***:60583/rootDesc.xml', 'OPT': '"http://schemas.upnp.org/upnp/1/0/"; ns=01', '01-NLS': '1525496722', 'BOOTID.UPNP.ORG': '1525496722', 'CONFIGID.UPNP.ORG': '1337', '_host': '192.168.***.', '_udn': 'uuid:3ddcd1d3-2380-45f5-b069-************', '_location_original': 'http://192.168.***.***:60583/rootDesc.xml', 'location': 'http://192.168.***.***:60583/rootDesc.xml', '_timestamp': datetime.datetime(2023, 10, 30, 7, 24, 25, 851793), '_remote_addr': ('192.168.***.***', 1900), '_port': 1900, '_local_addr': ('0.0.0.0', 0), '_source': }, x_homeassistant_matching_domains={'asusrouter'}) ```

How it is supposed to work:

So, please, check if you get a single set per a device which is already set up. Or you get many messages for the same device or anything else not listed here.

Thanks!

Vaskivskyi commented 9 months ago

Autodiscovery is removed in 0.29.0, so the issue is closed now