ha-asusrouter icon indicating copy to clipboard operation
ha-asusrouter copied to clipboard

[Bug] Device tracker states not updating

Open jazzyisj opened this issue 2 years ago • 8 comments

The problem

Device tracker states don't seem to be updating. These are the device trackers for the phones in the home. Both of these phones have left the house several times the last couple of days but they never update to not_home.

Rebooting the router causes the device trackers to update to the correct state, but they do not update again after this. Other sensors (cpu temp, memory etc) are all updating normally.

image

Your device model

RT-AX58U

Firmware type

Stock

Firmware version

3.0.0.4.386-49674

Integration version with the issue

v0.9.3

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

Core 2022.10.5

Is there anything useful in the logs?

2022-10-21 10:18:18.001 DEBUG (MainThread) [asusrouter.connection] Started command 
2022-10-21 10:18:18.003 DEBUG (MainThread) [asusrouter.connection] Started command hook=cpu_usage(appobj);memory_usage(appobj);netdev(appobj);wanlink_state(appobj);
2022-10-21 10:18:18.005 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching misc data in 0.000 seconds (success: True)
2022-10-21 10:18:18.073 DEBUG (MainThread) [asusrouter.asusrouter] Page ajax_ethernet_ports.asp was loaded successfully
2022-10-21 10:18:18.073 DEBUG (MainThread) [asusrouter.connection] Started command 
2022-10-21 10:18:18.106 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching temperature data in 0.101 seconds (success: True)
2022-10-21 10:18:18.106 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching network_stat data in 0.101 seconds (success: True)
2022-10-21 10:18:18.108 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching ram data in 0.103 seconds (success: True)
2022-10-21 10:18:18.108 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching wan data in 0.103 seconds (success: True)
2022-10-21 10:18:18.109 DEBUG (MainThread) [asusrouter.asusrouter] Hook was sent successfully: cpu_usage(appobj);memory_usage(appobj);netdev(appobj);wanlink_state(appobj);
2022-10-21 10:18:18.110 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching cpu data in 0.107 seconds (success: True)
2022-10-21 10:18:18.195 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching ports data in 0.189 seconds (success: True)
2022-10-21 10:18:18.207 DEBUG (MainThread) [asusrouter.asusrouter] Page ajax_coretmp.asp was loaded successfully
2022-10-21 10:18:18.208 DEBUG (MainThread) [asusrouter.connection] Started command 
2022-10-21 10:18:18.266 DEBUG (MainThread) [asusrouter.asusrouter] Page ajax_status.xml was loaded successfully
2022-10-21 10:18:18.268 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching vpn data in 0.266 seconds (success: True)
2022-10-21 10:18:18.620 DEBUG (MainThread) [custom_components.asusrouter.router] Device tracking is enabled
2022-10-21 10:18:18.621 DEBUG (MainThread) [custom_components.asusrouter.router] Updating AsusRouter device list for '192.168.1.1'
2022-10-21 10:18:18.621 DEBUG (MainThread) [asusrouter.connection] Started command hook=get_clientlist()
2022-10-21 10:18:18.732 DEBUG (MainThread) [asusrouter.asusrouter] Hook was sent successfully: get_clientlist()
2022-10-21 10:18:19.001 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching light data in 0.000 seconds (success: True)
2022-10-21 10:18:19.002 DEBUG (MainThread) [asusrouter.connection] Started command hook=nvram_get(wl0_auth_mode_x);nvram_get(wl0_bw);nvram_get(wl0_channel);nvram_get(wl0_chanspec);nvram_get(wl0_closed);nvram_get(wl0_country_code);nvram_get(wl0_crypto);nvram_get(wl0_gmode_check);nvram_get(wl0_maclist_x);nvram_get(wl0_macmode);nvram_get(wl0_mbo_enable);nvram_get(wl0_mfp);nvram_get(wl0_nmode_x);nvram_get(wl0_optimizexbox_ckb);nvram_get(wl0_radio);nvram_get(wl0_radius_ipaddr);nvram_get(wl0_radius_key);nvram_get(wl0_radius_port);nvram_get(wl0_ssid);nvram_get(wl0_wpa_gtk_rekey);nvram_get(wl0_wpa_psk);nvram_get(wl1_auth_mode_x);nvram_get(wl1_bw);nvram_get(wl1_channel);nvram_get(wl1_chanspec);nvram_get(wl1_closed);nvram_get(wl1_country_code);nvram_get(wl1_crypto);nvram_get(wl1_gmode_check);nvram_get(wl1_maclist_x);nvram_get(wl1_macmode);nvram_get(wl1_mbo_enable);nvram_get(wl1_mfp);nvram_get(wl1_nmode_x);nvram_get(wl1_optimizexbox_ckb);nvram_get(wl1_radio);nvram_get(wl1_radius_ipaddr);nvram_get(wl1_radius_key);nvram_get(wl1_radius_port);nvram_get(wl1_ssid);nvram_get(wl1_wpa_gtk_rekey);nvram_get(wl1_wpa_psk);
2022-10-21 10:18:19.079 DEBUG (MainThread) [asusrouter.asusrouter] Hook was sent successfully: nvram_get(wl0_auth_mode_x);nvram_get(wl0_bw);nvram_get(wl0_channel);nvram_get(wl0_chanspec);nvram_get(wl0_closed);nvram_get(wl0_country_code);nvram_get(wl0_crypto);nvram_get(wl0_gmode_check);nvram_get(wl0_maclist_x);nvram_get(wl0_macmode);nvram_get(wl0_mbo_enable);nvram_get(wl0_mfp);nvram_get(wl0_nmode_x);nvram_get(wl0_optimizexbox_ckb);nvram_get(wl0_radio);nvram_get(wl0_radius_ipaddr);nvram_get(wl0_radius_key);nvram_get(wl0_radius_port);nvram_get(wl0_ssid);nvram_get(wl0_wpa_gtk_rekey);nvram_get(wl0_wpa_psk);nvram_get(wl1_auth_mode_x);nvram_get(wl1_bw);nvram_get(wl1_channel);nvram_get(wl1_chanspec);nvram_get(wl1_closed);nvram_get(wl1_country_code);nvram_get(wl1_crypto);nvram_get(wl1_gmode_check);nvram_get(wl1_maclist_x);nvram_get(wl1_macmode);nvram_get(wl1_mbo_enable);nvram_get(wl1_mfp);nvram_get(wl1_nmode_x);nvram_get(wl1_optimizexbox_ckb);nvram_get(wl1_radio);nvram_get(wl1_radius_ipaddr);nvram_get(wl1_radius_key);nvram_get(wl1_radius_port);nvram_get(wl1_ssid);nvram_get(wl1_wpa_gtk_rekey);nvram_get(wl1_wpa_psk);
2022-10-21 10:18:19.079 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching wlan data in 0.078 seconds (success: True)
2022-10-21 10:19:18.001 DEBUG (MainThread) [asusrouter.connection] Started command hook=cpu_usage(appobj);memory_usage(appobj);netdev(appobj);wanlink_state(appobj);
2022-10-21 10:19:18.003 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching misc data in 0.000 seconds (success: True)
2022-10-21 10:19:18.004 DEBUG (MainThread) [asusrouter.connection] Started command 
2022-10-21 10:19:18.055 DEBUG (MainThread) [asusrouter.asusrouter] Hook was sent successfully: cpu_usage(appobj);memory_usage(appobj);netdev(appobj);wanlink_state(appobj);
2022-10-21 10:19:18.056 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching wan data in 0.055 seconds (success: True)
2022-10-21 10:19:18.106 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching network_stat data in 0.103 seconds (success: True)
2022-10-21 10:19:18.153 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching cpu data in 0.149 seconds (success: True)
2022-10-21 10:19:18.272 DEBUG (MainThread) [asusrouter.asusrouter] Page ajax_ethernet_ports.asp was loaded successfully
2022-10-21 10:19:18.273 DEBUG (MainThread) [asusrouter.connection] Started command 
2022-10-21 10:19:18.282 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching vpn data in 0.277 seconds (success: True)
2022-10-21 10:19:18.283 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching ram data in 0.278 seconds (success: True)
2022-10-21 10:19:18.284 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching ports data in 0.279 seconds (success: True)
2022-10-21 10:19:18.341 DEBUG (MainThread) [asusrouter.asusrouter] Page ajax_coretmp.asp was loaded successfully
2022-10-21 10:19:18.341 DEBUG (MainThread) [asusrouter.connection] Started command 
2022-10-21 10:19:18.382 DEBUG (MainThread) [asusrouter.asusrouter] Page ajax_status.xml was loaded successfully
2022-10-21 10:19:18.384 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching temperature data in 0.380 seconds (success: True)
2022-10-21 10:19:18.620 DEBUG (MainThread) [custom_components.asusrouter.router] Device tracking is enabled
2022-10-21 10:19:18.620 DEBUG (MainThread) [custom_components.asusrouter.router] Updating AsusRouter device list for '192.168.1.1'
2022-10-21 10:19:18.621 DEBUG (MainThread) [asusrouter.connection] Started command hook=get_clientlist()
2022-10-21 10:19:18.708 DEBUG (MainThread) [asusrouter.asusrouter] Hook was sent successfully: get_clientlist()
2022-10-21 10:19:19.001 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching light data in 0.000 seconds (success: True)
2022-10-21 10:19:19.002 DEBUG (MainThread) [asusrouter.connection] Started command hook=nvram_get(wl0_auth_mode_x);nvram_get(wl0_bw);nvram_get(wl0_channel);nvram_get(wl0_chanspec);nvram_get(wl0_closed);nvram_get(wl0_country_code);nvram_get(wl0_crypto);nvram_get(wl0_gmode_check);nvram_get(wl0_maclist_x);nvram_get(wl0_macmode);nvram_get(wl0_mbo_enable);nvram_get(wl0_mfp);nvram_get(wl0_nmode_x);nvram_get(wl0_optimizexbox_ckb);nvram_get(wl0_radio);nvram_get(wl0_radius_ipaddr);nvram_get(wl0_radius_key);nvram_get(wl0_radius_port);nvram_get(wl0_ssid);nvram_get(wl0_wpa_gtk_rekey);nvram_get(wl0_wpa_psk);nvram_get(wl1_auth_mode_x);nvram_get(wl1_bw);nvram_get(wl1_channel);nvram_get(wl1_chanspec);nvram_get(wl1_closed);nvram_get(wl1_country_code);nvram_get(wl1_crypto);nvram_get(wl1_gmode_check);nvram_get(wl1_maclist_x);nvram_get(wl1_macmode);nvram_get(wl1_mbo_enable);nvram_get(wl1_mfp);nvram_get(wl1_nmode_x);nvram_get(wl1_optimizexbox_ckb);nvram_get(wl1_radio);nvram_get(wl1_radius_ipaddr);nvram_get(wl1_radius_key);nvram_get(wl1_radius_port);nvram_get(wl1_ssid);nvram_get(wl1_wpa_gtk_rekey);nvram_get(wl1_wpa_psk);
2022-10-21 10:19:19.061 DEBUG (MainThread) [asusrouter.asusrouter] Hook was sent successfully: nvram_get(wl0_auth_mode_x);nvram_get(wl0_bw);nvram_get(wl0_channel);nvram_get(wl0_chanspec);nvram_get(wl0_closed);nvram_get(wl0_country_code);nvram_get(wl0_crypto);nvram_get(wl0_gmode_check);nvram_get(wl0_maclist_x);nvram_get(wl0_macmode);nvram_get(wl0_mbo_enable);nvram_get(wl0_mfp);nvram_get(wl0_nmode_x);nvram_get(wl0_optimizexbox_ckb);nvram_get(wl0_radio);nvram_get(wl0_radius_ipaddr);nvram_get(wl0_radius_key);nvram_get(wl0_radius_port);nvram_get(wl0_ssid);nvram_get(wl0_wpa_gtk_rekey);nvram_get(wl0_wpa_psk);nvram_get(wl1_auth_mode_x);nvram_get(wl1_bw);nvram_get(wl1_channel);nvram_get(wl1_chanspec);nvram_get(wl1_closed);nvram_get(wl1_country_code);nvram_get(wl1_crypto);nvram_get(wl1_gmode_check);nvram_get(wl1_maclist_x);nvram_get(wl1_macmode);nvram_get(wl1_mbo_enable);nvram_get(wl1_mfp);nvram_get(wl1_nmode_x);nvram_get(wl1_optimizexbox_ckb);nvram_get(wl1_radio);nvram_get(wl1_radius_ipaddr);nvram_get(wl1_radius_key);nvram_get(wl1_radius_port);nvram_get(wl1_ssid);nvram_get(wl1_wpa_gtk_rekey);nvram_get(wl1_wpa_psk);
2022-10-21 10:19:19.062 DEBUG (MainThread) [custom_components.asusrouter.router] Finished fetching wlan data in 0.060 seconds (success: True)

Diagnostics information

config_entry-asusrouter-d7f26af8a2f7da0d8ec212eca5a59111.json.txt

Additional information

No response

jazzyisj avatar Oct 21 '22 14:10 jazzyisj

Hello, @jazzyisj,

Thanks for your feedback! :+1: And sorry, that something is not working well for you.

Can you please check the following:

  • Does rebooting of integration also update device trackers or should all the HA be restarted for this?
  • Do they stuck only in the home state? For e.g. after reboot do all the sensors update once and get stuck or do not home sensors also update to a home state once?
  • What does the connected devices sensor say? Is the number (or list in the devices attribute correct? Does it change, go up, go down?

Thanks!

Vaskivskyi avatar Oct 21 '22 15:10 Vaskivskyi

Hang tight. I've updated the firmware on my AP's and I've since gotten at least one device cycling between home / not_home properly. I'm going to watch it for a day or two and I'll update with results.

jazzyisj avatar Oct 24 '22 03:10 jazzyisj

Could you please check whether the issue is still happening with the new version 0.11.0? There was a force update implemented for the device list. It should help some devices which do not update the list by themself.

Vaskivskyi avatar Oct 29 '22 19:10 Vaskivskyi

Sorry for delay, needed a moment to test again.

Yes the issue is still occuring with 0.11.0. Aagin, rebooting the ROUTER updates the entities to the correct state, but once they have a state of home again, they never return to not_home. Sometimes after rebooting the router they work for one home/not_home cycle but then get stuck on home again.

Just curious, I don't use the router WIFI, I connect everything through Unify WIFI AP's. Could the problem be there? Maybe I can try disabling the AP and setting the SSID in the router to the AP values to see if the problem persists without the AP's. I haven't tried this yet because the devices actually do show offline or disconnected in the router, but still show home in HA so I assumed that couldn't be the issue.

FWIW, everything used to work perfectly, I can't really pinpoint when it started this behaviour though.

jazzyisj avatar Oct 31 '22 18:10 jazzyisj

I've the same issue on AC86U with merlin 386.7_2 firmware. Im tracking my PS5 and once the device switched to home it will stay permanently, so im using a ping based tracker at the moment, which is fine.

sfortis avatar Nov 25 '22 06:11 sfortis

Having same thing as well with RT-AX58U, my Connected Devices are not updating after while, and device trackers are always Home. Version Merlin 388.1 image 1 Hour ago I've reloaded the integration.

scetu avatar Dec 11 '22 16:12 scetu

Ok, in my case, I had many issues with Merlin Firmware, now I am back on stock (386), and seems that it is working more reliable. Including Device Trackers...

scetu avatar Dec 11 '22 18:12 scetu

its probably a bug with merlin then... I've made ping based HA device trackers since this issue was never resolved.

sfortis avatar Dec 12 '22 09:12 sfortis

Unfortunately, this problem happens with some devices only on both stock and Merlin FW.

I am trying to reproduce this behaviour but did not succeed with it yet.

Vaskivskyi avatar Dec 18 '22 07:12 Vaskivskyi

I am no longer having problems with Original firmware (3.0.0.4.386_49674-ge182230), but had multiple problems with Merlin on my RT-AX58U.

scetu avatar Dec 20 '22 07:12 scetu

Please, check the new version 0.17.0 of the integration. Improvement of device trackers has been implemented

Vaskivskyi avatar Jan 08 '23 17:01 Vaskivskyi

Sorry I've been MIA last couple of months. Life got in the way... Anyway, as far as I can see, this issue does now seem to be resolved for me. Thank you for your efforts!

jazzyisj avatar Mar 14 '23 14:03 jazzyisj

Please, refer to issue #570, in which we are trying to collect as much data as possible to find the reason for the problem with device trackers for some of the users

Vaskivskyi avatar Mar 14 '23 14:03 Vaskivskyi