openwrt-ha-device-tracker
openwrt-ha-device-tracker copied to clipboard
Main router takes longer to change status to not_home
Hello, first I would like to thank you for your project.
I have the following configuration: Archer C7 as the main router and an Archer C2 with DHCP turned off.
When leaving home I'm always connected to C2, which when disconnecting gives me the status of not_home more accurate than C7. C7 takes an average of 3 or 4 minutes longer to change the status to not_home.
Both use the same configuration in settings.json, except for ap_name.
Any way to make the C7 more accurate on disconnect?
C2:
Thu Sep 29 23:09:17 2022 daemon.info presence-detector[31246]: Device C2_xxxxxxx is now at home Thu Sep 29 23:09:17 2022 daemon.info hostapd: wlan1: STA xxxxxxx IEEE 802.11: associated (aid 1) Thu Sep 29 23:09:17 2022 daemon.notice hostapd: wlan1: AP-STA-CONNECTED xxxxxxx
C7:
Thu Sep 29 23:14:43 2022 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED xxxxxxx Thu Sep 29 23:14:43 2022 daemon.info hostapd: wlan1: STA xxxxxxx IEEE 802.11: disassociated due to inactivity Thu Sep 29 23:14:44 2022 daemon.info hostapd: wlan1: STA xxxxxxx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE) Thu Sep 29 23:14:44 2022 daemon.notice netifd: wan (2544): udhcpc: sending renew to ip Thu Sep 29 23:14:44 2022 daemon.notice netifd: wan (2544): udhcpc: lease of ip obtained, lease time 3600 Thu Sep 29 23:14:49 2022 daemon.info presence-detector[3120]: Device C7_xxxxxxx is now away
Hi @walberjunior. From the bits of log you've supplied I see that the device is disconnected because of a timeout. This means the device went out of range, and the router de-associates it after a certain amount of time. This amount of time is usually a few minutes, depending on your Wifi settings. This is different from when you actively disconnect the device (for example by turning off wifi on a phone): the device then disassociates itself, which is instant.
Long story short: when a device leaves because it goes out of range, there's not much the detector can do about that. It relies on hostapd
to signal that a device has left, which only happens after a bunch of timeouts.
I hope this explains it a bit. In this case I guess the C7 router has a wider (outside) range so it's usually the last one to still have signal and then time out?