Open Romioyar opened 3 years ago
Hey, What kind of router/AP? Is this true for all devices or just specific ones? Which one? Did you try to telnet to the device and check the status manually? What do you consider "disconnection of the device"?
Hi, sorry for late reply. I use D-Link Dir 825 router. I tried only with iPhone 11. No, I did not try. I mean I disconnect phone from Wi-Fi and it disappears from the list of connected devices on the router, but device tracker entity is still “at home” until HA restart.
Can you still reproduce the issue or was it a one time thing?
Please telnet to the dlink when the phone is connected.
Run:
iwlist wlan0 ap iwlist wlan1 ap
then disconnect the phone from wifi and repeat the commands. post the results here. you can obfuscate MAC addresses if you prefer.
Hi, yes I still can reproduce, hovewer sometimes it works correctly and it goes to not_home after some minutes as set for device tracker, and sometimes it can be at home some days. I'll telnet to the router and as soon as it is done I come back to you.
Having the same issue. HA still shows "Home" even when the devices have left the building.
However the devices still show when i run iwlist wlan1 ap So i think its more of a router issue. Devices are not getting cleared from list.
Maybe add some code to check signal strength anything below 5/100 is offline
Quality=4/100
@Capone1983 "left the building", does it mean still within wifi range? Just making sure you are aware that the router doesn't know if the device is in the building or outside. It just assumes state based on whether the wifi is connected or not.
Try to turn off wifi on the phone/device and then run "iwlist". LMK what router model that is.
Anyway, if the router says the device is connected then I have to roll with that. It works with many devices so I don't think it will be beneficial for the majority of users to change it.
Sorry "left the building" means -> device has disconnected from the Wifi when out of range. The Router is a D-link DIR-825ACG1.
So I did more tests.
If I disconnect from the Wifi manually on the phone, then the router picks it up and removes the MAC from the list.
Your code then picks that up and HA = "away"
If the device gets disconnected when out of range, then the MAC stays on the list but at Quality=4/100 (No Idea why, maybe the lease rules). No Logic as you mentioned. If its connected then its connected. HA = "home"
Hi, I use the component and it detects new conected device correctly but the state does not change after disconnection of the device, router does not see the device anymore. HA restart helps.