Vaskivskyi / ha-asusrouter

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

[Bug] Device trackers are stuck #570

Closed Vaskivskyi closed 7 months ago

Vaskivskyi commented 1 year ago

The problem

Some devices are experiencing problems with device trackers. The symptoms are the following:

If you are experiencing a similar problem, please add your device MODEL and FIRMWARE VERSION in the comments. Also, add AsusRouter version you are using

If you see any errors or warnings in the HA log from AsusRouter, please add them as well.

Please, don't post "the same error" without any details about your device. This does not help. In order to find and fix the issue, information is needed.

P.S. All other issues with the same problem will be closed. Please, report this problem here and only

Your device model

RT-AX88U

Firmware type

Merlin

Firmware version

3.0.0.4.388.1

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.0

Is there anything useful in the logs?

No response

Diagnostics information

No response

Additional information

No response

Vaskivskyi commented 1 year ago

So, this is the data collected from the other issues. I would kindly ask all the tagged users to check whether the issue with device trackers still persists with the latest version 0.22.0. And then we will try to solve it


From #562 (@pejannl):


From #550 (@alhemicar86):


From #485 (@5a5cha):


From #465 (@ejpenney):

pejannl commented 1 year ago

What can I say to help you? Running Asus rc-ac88u, Firmware Version:[3.0.0.4.386], standard firmware Home Assistant core 2023.01.1 Asusrouter integration 0.22.0

I don’t use the wireless on the router, but use a home deco mesh system. I have ping to my iphone (in dhcp fixed ip) installed and also use the deco integration to detect presence of my iphone. I just switched my iphone to airplane mode. Within 2 minutes the ping and deco integrations report I am not home. I waited 15 minutes, but the Asusrouter integration never reports me away. I am aware there some sort of technical log in HA, but don’t know where to find it. If you need to know more then direct me where to look.

alhemicar86 commented 1 year ago

Updated to 0.22.0, will keep an eye on extension.

alhemicar86 commented 1 year ago

State updates still get stuck after several hours.

alhemicar86 commented 1 year ago

0.22.0 actually made it worse in a way that now trackers don't update even after integration is reloaded.

khaffner commented 1 year ago

Your device model RT-AC3200

Firmware type ? Stock Asus firmware

Firmware version 3.0.0.4.382_52651-g22bb56a, is up to date

Integration version with the issue I've used 0.21.0 and 0.22.0, same issue in both

Method of the integration installation HACS

What version and type of Home Assistant installation do you use Container 2023.3.1

Is there anything useful in the logs? No, looked at the debug logs.

Diagnostics information No response

Additional information No response

alhemicar86 commented 1 year ago

Somehow it decided at random to work now, and I made no changes to it. Will follow up tomorrow if it kept working after nightly router reboot.

Vaskivskyi commented 1 year ago

For now, I am trying to collect as much data as possible on the issue. The main problem is, that exactly the same device models with the same FW version work for one user, but not another.

This makes the bug quite hard to locate and troubleshoot

alhemicar86 commented 1 year ago

If it is any help, my installation is HA OS, on https://www.gigabyte.com/Mini-PcBarebone/GB-BMPD-6005-rev-10#kf

pejannl commented 1 year ago

Ack. I am also running HA OS (on a Raspberry PI 4).

I was away from home 4 times today, 2 times more than 2 hours. Asusrouter did not report me ‘away’ at all.

nickaggie commented 1 year ago

Im seeing the same issue, trackers haven't updated for a while.

Your device model RT-AX88U

Firmware type Merlin

Firmware version 388.1

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 Home Assistant 2023.3.1 Supervisor 2023.01.1 Operating System 9.5 Frontend 20230302.0 - latest

5a5cha commented 1 year ago

Looks like a really strange behave, so far.

While my S22 is tracked nice when turning of the wifi and change to mobile data the raspberry pi on the other hand is still online after poweroff and unplug from power cable.

The frontend (AiMesh overview) of the router shows the pi online when online and is not listed when offline.

On the other hand i have three 3D printers with mainsail OS running and all three of them are powerless but two of them are listet as online and only one is offline.

Tracking with laptop is still ongoing because of work :-)

Your device model GT-AX11000

Firmware type Merlin

Firmware version 388.1

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 Home Assistant 2023.2.5 Supervisor 2023.01.1 Operating System 9.5 Frontend 20230202.0

Is there anything useful in the logs? No response

Diagnostics information No response

Additional information No response

alhemicar86 commented 1 year ago

Found this in logs today. It has also some reference to Python 3.10, preceding the error itself.

2023-03-07 09:06:41.385 ERROR (MainThread) [custom_components.asusrouter.router] Error connecting to '192.168.###.###' for device update: None

It was preceded by (I do have 2 esp32 boards unpowered and disconnected from network ar the moment, and 3 connected):

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 537, in send_message_await_response_complex await fut asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 536, in send_message_await_response_complex async with async_timeout.timeout(timeout): File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 320, in _keep_alive_loop await self._ping() File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 645, in _ping await self.send_message_await_response(PingRequest(), PingResponse) File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 554, in send_message_await_response res = await self.send_message_await_response_complex( File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 539, in send_message_await_response_complex raise TimeoutAPIError(

khaffner commented 1 year ago

Knock on wood, but the device tracking seems to work fine for me the last 5 days

edit a week later: Jinxed it. Trackers get stuck

ante-maric commented 1 year ago

I didn't update the integration for a while and was using version 0.8.0. It all worked fine. Then I updated to 0.22.0 (not directly, but went through versions as described in documentation) and now it doesn't switch to away. I am tracking my two phones. I managed to figure out one thing. If I turn off my wifi on the phone, within 30s it will show away. But if I just go out of range it will never show as away.

Home Assistant 2023.3.4 Supervisor 2023.03.1 Operating System 9.5 Frontend 20230309.0 - latest

contrasenda commented 1 year ago

Same problem here.

RT-AX92U / Stock 3.0.0.4.388_22525 Two aimesh nodes: RT-AC68U / Stock 3.0.0.4.386_51255

Asusrouter 0.22, Home Assistant 2023.3.4

Device tracking works ok for some hours, and then stops updating. I checked the router network map and devices are not connected, but the state is not update in HA. Reloading the integration makes it work again for some time. No errors in logs, except for unique ids one.

One strange thing I noticed that happens most of the times (but not always), is that the device is reported not home / home / not home withing minutes after leaving, and by that moment phone is quite far, it's impossible to be connected to home wifi.

image

pepe59 commented 1 year ago

Same problem here, Router Asus RT-AC68U version fw 3.0.0.4.386_51255 AiMesh RT-AC66UB1

marceloaf commented 1 year ago

Same problem. GT-AX6000. Merlin 388.1

run1fast commented 1 year ago

Same issue. My status is always home, even when I leave and my phone is not connected. Home Assistant 2023.3.5 Supervisor 2023.03.1 Operating System 9.5 Frontend 20230309.1 - latest

Asus Router: ZenWiFi_XT8. Firmware Version:[3.0.0.4.388_22525]

khaffner commented 1 year ago

A reboot of the router seems to work for me. I have automatic reboot once a week, trackers work fine the first few days after. Will try to monitor this pattern.

marceloaf commented 1 year ago

I hope I’m not celebrating too early… Today I updated my router firmware to ASUS Merlin 388.2 Beta 1 and the device that was not showing away, now is showing as expected… Maybe someone else with the issue and the same firmware could confirm (or not).

run1fast commented 1 year ago

A reboot of the router seems to work for me. I have automatic reboot once a week, trackers work fine the first few days after. Will try to monitor this pattern.

Rebooted the router, seems to be working again. I should have known, The IT Crowd, have you tired turning it off and on again?

nickaggie commented 1 year ago

After a reboot of my router it seems to have been working for the past few days.

Vaskivskyi commented 1 year ago

Hello, guys.

I am sorry for not replying - there were some matters not allowing me to work on AsusRouter lately. But from now on the work will continue as before.

Thanks for all the reports you have already posted. Even the small details might help with the whole picture of the problem core.

@contrasenda, that's an interesting fact. Actually, all the time testing I was only directly disconnecting the device and never tried going out of range. Maybe, the device FW is processing this differently. I will try to check

nchieffo commented 1 year ago

RT-AX86S Firmware Version:3.0.0.4.388_22525 Asus Router HACS 0.22.0 Home Assistant OS 2023.3.6

searching for asus in the logs I see only this

Logger: homeassistant.helpers.entity Source: helpers/entity.py:559 First occurred: March 29, 2023 at 05:04:34 (2 occurrences) Last logged: March 31, 2023 at 03:32:11

Updating state for device_tracker.pixel_6a_nc (<class 'custom_components.asusrouter.device_tracker.ARDeviceEntity'>) took 0.695 seconds. Please report it to the custom integration author. Updating state for device_tracker.sm_r860_4 (<class 'custom_components.asusrouter.device_tracker.ARDeviceEntity'>) took 0.758 seconds. Please report it to the custom integration author.

alhemicar86 commented 1 year ago

That might be a good clue. Asus routers have under "professional" setting an option to automatically disconnect clients below certain signal power. It is intended for Ai Mesh clients to faster roam between the nodes. It might be indeed an issue, since it might intentionally disconnect the client and don't report it disconnected, as it awaits it to reconnect? Can we confirm if everyone with an issue has Ai Nodes? (Though this setting might be actually enabled on the single router as well to allow swapping between 5 and 2.4 networks?)

pejannl commented 1 year ago

I hope I am not spoiling the joy when I write that all my devices are considered ‘wired’ connections. I have a Deco mesh wifi system in use and all tracked devices connect to the wifi through the Deco system. The Asus router doesn’t have any wifi connected devices.

the Deco’s recognize when a device is offline (‘not home’) within minutes after departure (or switching off). I am in fact using the Deco integration for home detection (but have the Asusrouter integration installed to help analyzing the problems).

Vaskivskyi commented 1 year ago

@pejannl,

So all of your devices are not connected over WiFi to the Asus device? Do they show in the Asus Web UI as wired as well or only in AsusRouter?

pejannl commented 1 year ago

The router i/f shows them as wired. I have only my Harmony Hub directly connected to the router and it sows only that device as wireless. I don’t know how to see how Asusrouter shows the difference between wired and wireless.

IMG_3557

pejannl commented 1 year ago

Then I noticed (see picture above) that Asusrouter reported one of us as absent (iphone.bella). I opened the history and she is away since approx 30 minutes, confirmed by the Deco integration.

So I put my own phone in flight mode and waited a few minutes...

The top panel shows the status as per Deco integration (connected to the Person), the bottom shows the Asusrouter...

IMG_3558

pejannl commented 1 year ago

Uh... The mystery continues... Actually, Asusrouter reports Bella as absent for less than 30 minutes while the Deco reports her absent for 2 hours! Note that I have not done any reboots, restarts or configuration changes today. "Unavailable" might have happened because I logged on to the router from the web interface.

Deco log:

Scherm­afbeelding 2023-04-02 om 11 24 08

Asusrouter log:

Scherm­afbeelding 2023-04-02 om 11 23 06
ejpenney commented 1 year ago

Hi,

Just chiming in here that with the RT-AC66U I'm not seeing a lot of issues. I have noticed that immediately after rebooting the Home Assistant offline devices go "Unavailable" instead of "away" until they return. Looks like between boots the integration maybe forgets about previously tracked devices?

In any event, no major complaints from me right now.

pejannl commented 1 year ago

Any news from development?

TeddyLafrite commented 1 year ago

Hi @Vaskivskyi

Same problem here with model RT-AX55 with firmware 3.0.0.4.386_51598

AsusRouter 0.22.0

Since few weeks some devices stuck home

Same problem for 2 HA systems with exactly same routeur, firmware and Assurouter version

Thanks,

auanasgheps commented 1 year ago

I have an issue with device tracker, but I'm not sure is related to this one. I see the entities but they're disabled. #592

khaffner commented 1 year ago

A reboot of the router seems to work for me. I have automatic reboot once a week, trackers work fine the first few days after. Will try to monitor this pattern.

It was in the end not a reliable solution. I've since changed to the nmap integration, that suits my needs and is rock solid.

TeddyLafrite commented 1 year ago

A reboot of the router seems to work for me. I have automatic reboot once a week, trackers work fine the first few days after. Will try to monitor this pattern.

It was in the end not a reliable solution. I've since changed to the nmap integration, that suits my needs and is rock solid.

Its seems that rebooting integration solves temporarely the problem

pepe59 commented 1 year ago

I'm also thinking about another device tracker because the AsusRouter is unusable today.

TeddyLafrite commented 1 year ago

I'm also thinking about another device tracker because the AsusRouter is unusable today.

Hi Same here...

Maybe it's another bug but phone's status is buggy : image

home/not-home every 5 minutes all night long..

TeddyLafrite commented 1 year ago

NB : same as #593

DaveStLou commented 1 year ago

Model: RT-AX88U Firmware: Merlin 388.2_2 Integration: 0.22.0 Home Assistant: 2023.5.4 Supervisor 2023.04.1 Operating System 10.1 Frontend 20230503.3 - latest

I have been devices that are stuck on home for some time. Reloading the integration corrects the status temporarily.

Only entries in the Home Assistant Log:

This error originated from a custom integration.

Logger: custom_components.asusrouter.router Source: custom_components/asusrouter/router.py:711 Integration: AsusRouter (documentation, issues) First occurred: May 24, 2023 at 12:37:36 AM (2 occurrences) Last logged: 3:21:13 AM

Error connecting to '10.42.8.5' for device update: None

TeddyLafrite commented 1 year ago

Some news here ?

run1fast commented 1 year ago

I tried doing some digging on this.....

I have an Asus AX XT8 router and 1 airmesh node. I dug into my router info (http://router.asus.com/index.asp) and I noticed that one of the devices I was tracking that kept getting stuck in a state was not always showing up in the router device list. I know for 100% sure my phone was connected to wifi, but not in the router device list therefore probably not sending the updated state to this Integration.

I found some Asus threads where others also had issues with devices not showing up in the device list eventhough they were connected. The fix was to create a guest wireless connection (feel free to hide it) for your router. You dont have to connect anything to the guest ssid, but just create it. Then the bug of not all devices showing in Asus device list is fixed. Now that all my devices are showing in the router list, the state is being passed to this Integration correctly (and no daily reboots or reloading of the integration are needed).

So if you are having this device stuck state, check within the Asus app or config page (http://router.asus.com/index.asp) and see if your device is actually in the list there. This solved my problem so far. Been stable and working for about 1 week now.

pejannl commented 1 year ago

I found some Asus threads where others also had issues with devices not showing up in the device list eventhough they were connected. The fix was to create a guest wireless connection (feel free to hide it) for your router. You dont have to connect anything to the guest ssid, but just create it. Then the bug of not all devices showing in Asus device list is fixed. Now that all my devices are showing in the router list, the state is being passed to this Integration correctly (and no daily reboots or reloading of the integration are needed).

I tried this. I created a guest wifi network. Then I rebooted the router. Now, three days later, my Deco integration reports that one person is home and three are not. (Two Iphones and one Android, if that matters). The Asusrouter "integration" reports all four at home.

The add-on is unusable, so I am removing it and will rely on the perfectly working Deco integration.

Signing-off.

run1fast commented 1 year ago

This is back to not working again. I went and setup an automation to reload the integration multiple times a day. Hopefully the reload will be a stop-gap.

alhemicar86 commented 1 year ago

This might be more widespread issue, even the asuswrt that is included in HA is not tracking properly. Also found out that integration intended to give info about washing machine behaves exactly the same... Stops updating after some amount of time. This might be the issue in HA, hope they are aware of it.

auanasgheps commented 1 year ago

In my case, looks like my router (AC-86U) has an extremely unreliable client monitoring. When I login in the Router UI and load the client list, it immediately updates the tracked devices in HA.

Either this and the official integration show the same behavior in my case, so I think it's the router.

Have you seen the same

Vaskivskyi commented 1 year ago

The main issue, as already pointed here, is the fact that some routers themself do not show the connected devices properly.

E.g.,on the RT-AC66U I have partial access to, the devices are only coming online but not offline even in the Web UI. Unless, you manually open the device list menu (via the "full list" button) in the Web UI. Unfortunately, even mimicking this behavior from the integration side, I didn't yet manage to solve the issue.

With some other devices the method of the guest networks does really help, but not all of them.

So, I hope, you can understand, when the issues are on the device side, it's not as easy to be fixed (or even avoided) from the external integration

In any case, the work on fixing at least a part of issues with the device tracking is ongoing. As soon as there will be any news, I'll let you know

P.S. As for the "I'll never use AsusRouter again", I am surely sad of hearing this, but AsusRouter is my hobby project, done by testing on a single device I have available. Please, try to understand this limitations. You can always use the default HA AsusWRT integration which will have quite the same problems. Or, for the devices you need to know exact location, you better use the proper way of monitoring - which is never a router - WiFi connection requires quite some time and you can actually cross all the WiFi coverage area before your device authenticate and the router (of any model and manufacturer) will report it

pepe59 commented 1 year ago

Your comment is fine, the component is great, but it's strange that previously device tracking (phone) worked without problems on my router RT-AC68U and HA. Even today the devices are correctly detected online/offline in the router only this state fails to load HA.

alhemicar86 commented 1 year ago

Today I was tackling unrelated bug, it was a problem with rendering the default Overview dashboard, and stumbled upon a thread that pointed out about bug that didn't treat properly entities that had space at the end of the name. I chased down one entity created by another integration that had extra space at the end, and once I fixed that, after the reboot, the trackers started working as intended in both AsusRouter and AsusWRT integrations. I can't confirm yet if that was the culprit, but so far everything seems to work as intended. Will see in a few days.