home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.25k stars 30.24k forks source link

Wifi device keeps flipping between home/unavailable long after being offline. #99801

Closed janvojt closed 1 year ago

janvojt commented 1 year ago

The problem

I am using UniFi Network integration to track devices connected to Wifi networks. I have a smartphone device (Samsung Galaxy A22), which was connected to guest Wifi network, and then left the house. Even after more than 30 minutes, this device keeps flipping its state between home/unavailable every few seconds.

Unifi clearly and correctly states the device disconnected at 9:53 AM and was offline since. Homeassistant integration is flipping the states. See screenshots:

Screenshot from 2023-09-07 10-19-30 Screenshot from 2023-09-07 10-18-54 Screenshot from 2023-09-07 10-44-37

What version of Home Assistant Core has the issue?

core-2023.8.4

What was the last working version of Home Assistant Core?

unknown

What type of installation are you running?

Home Assistant OS

Integration causing the issue

UniFi Network

Link to integration documentation on our website

https://www.home-assistant.io/integrations/unifi/

Diagnostics information

I am including the diagnostic data. To not publish too much sensitive info I manually removed all unrelated clients but the one with the problem.

config_entry-unifi-b2c93dca302fca5ef952fd3a780def68.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @kane610, mind taking a look at this issue as it has been labeled with an integration (unifi) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `unifi` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign unifi` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


unifi documentation unifi source (message by IssueLinks)

janvojt commented 1 year ago

It seems the flipping of states on the device trackers started happening 2 days ago at 3:21 AM. Almost definitely caused by an automatic upgrade of UniFi firmware.

image

The reason why the device_tracker was flipping to home instead of away is probably a different issue, likely with the HA integration.

zaskem commented 1 year ago

Can confirm the same thing -- mine did the same thing starting immediately after the UniFi Network update to v 7.5.174. Devices are flipping states every 5-30 seconds in the history.

Kane610 commented 1 year ago

How are you running your UniFi controller?

janvojt commented 1 year ago

I have UDM Pro.

After upgrading homeassistant to 2023.9.0, the state flipping issue disappeared for me. @zaskem can you confirm?

zaskem commented 1 year ago

Yes, I can confirm. This is no longer happening (state flipping) after updating Home Assistant to 2023.9.0

janvojt commented 1 year ago

Thank you, I am closing this.