mueslo / openwrt_hass_devicetracker

Simple OpenWRT package which forwards device connection changes to a HomeAssistant instance
GNU General Public License v3.0
92 stars 31 forks source link

AP-STA-DISCONNECTED erroneously ignored #29

Closed quthla closed 5 years ago

quthla commented 5 years ago

Recently I started wondering why my mobile phone wasn't marked away reliably anymore.

Tue May  7 18:41:03 2019 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED xx:xx:xx:xx:xx:xx
Tue May  7 18:41:03 2019 daemon.info hostapd: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: disassociated due to inactivity
Tue May  7 18:41:03 2019 user.debug /usr/lib/hass/push_event.sh: push_event wlan0 AP-STA-DISCONNECTED xx:xx:xx:xx:xx:xx
Tue May  7 18:41:03 2019 user.debug /usr/lib/hass/push_event.sh: push_event ignored as device is still online
Tue May  7 18:41:04 2019 daemon.info hostapd: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)

It seems the is_connected check comes a little too early for the device to be disassociated on the wireless interface already

glogiotatidis commented 5 years ago

I experience the same problem. Adding the sleep command as suggested in https://github.com/quthla/openwrt_hass_devicetracker/commit/ea0f08d1f68d36107706f231d5c0cfa2c762441d fixes the issue