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
69.72k stars 28.88k forks source link

Stability issues with xiaomi-air-purifier #117794

Open chooseYourUserName opened 1 month ago

chooseYourUserName commented 1 month ago

The problem

I have a Xiaomi Smart Air Purifier 4 Lite. i started to notice that the device on my dashboard keeps showing the device as unavailable.
it was working well last year. i just did not notice when or which version did the issue start on. i was just expecting that the next update would fix it.

when i look at the device integration i see this in the log.

Xiaomi Smart Air Purifier 4 Lite Child lock became unavailable 7:26:16 PM - 21 minutes ago Xiaomi Smart Air Purifier 4 Lite Buzzer became unavailable 7:26:16 PM - 21 minutes ago Xiaomi Smart Air Purifier 4 Lite became unavailable 7:26:16 PM - 21 minutes ago Xiaomi Smart Air Purifier 4 Lite Child lock turned off 7:25:56 PM - 21 minutes ago Xiaomi Smart Air Purifier 4 Lite Buzzer turned on 7:25:56 PM - 21 minutes ago Xiaomi Smart Air Purifier 4 Lite turned off 7:25:56 PM - 21 minutes ago Xiaomi Smart Air Purifier 4 Lite Child lock became unavailable 7:25:01 PM - 22 minutes ago Xiaomi Smart Air Purifier 4 Lite Buzzer became unavailable 7:25:01 PM - 22 minutes ago Xiaomi Smart Air Purifier 4 Lite became unavailable 7:25:01 PM - 22 minutes ago Xiaomi Smart Air Purifier 4 Lite Child lock turned off 7:24:41 PM - 22 minutes ago Xiaomi Smart Air Purifier 4 Lite Buzzer turned on 7:24:41 PM - 22 minutes ago Xiaomi Smart Air Purifier 4 Lite turned off 7:24:41 PM - 22 minutes ago Xiaomi Smart Air Purifier 4 Lite Child lock became unavailable 7:15:46 PM - 32 minutes ago Xiaomi Smart Air Purifier 4 Lite Buzzer became unavailable 7:15:46 PM - 32 minutes ago Xiaomi Smart Air Purifier 4 Lite became unavailable 7:15:46 PM - 32 minutes ago Xiaomi Smart Air Purifier 4 Lite Child lock turned off 7:15:26 PM - 32 minutes ago Xiaomi Smart Air Purifier 4 Lite Buzzer turned on 7:15:26 PM - 32 minutes ago Xiaomi Smart Air Purifier 4 Lite turned off 7:15:26 PM - 32 minutes ago Xiaomi Smart Air Purifier 4 Lite Child lock became unavailable 6:59:51 PM - 1 hour ago

from the Home assistant core log

`Logger: homeassistant.components.xiaomi_miio Source: helpers/update_coordinator.py:347 integration: Xiaomi Miio (documentation, issues) First occurred: May 18, 2024 at 9:50:15 AM (396 occurrences) Last logged: 7:28:11 PM

Error fetching Xiaomi Smart Air Purifier 4 Lite data: Unable to discover the device 10.2.8.87 Error fetching zhimi.airp.rmb1 data: Unable to discover the device 10.2.8.87 `

XiaoMi's own app does not show that the device is disconnected. the firmware of the device is 2.2.1.0058 ( from the xiaomi app)

actions i've tried:

  1. remove the integration and add it back.
  2. use both automatic and manual configuration.
  3. power cycle the Xiaomi air purifier.
  4. power cycle the home assistant PC.
  5. tried the reload option from integration.

What version of Home Assistant Core has the issue?

2024.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/#xiaomi-air-purifier-air-humidifier-and-standing-fan

Diagnostics information

2024-05-20 20:05:49.660 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Initializing with host 10.2.8.87 (token 56459...) 2024-05-20 20:05:49.661 DEBUG (SyncWorker_9) [miio.click_common] Unknown model, trying autodetection. None None 2024-05-20 20:05:54.668 DEBUG (SyncWorker_9) [miio.miioprotocol] Unable to discover a device at address 10.2.8.87 2024-05-20 20:05:54.670 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Finished fetching Xiaomi Smart Air Purifier 4 Lite data in 5.009 seconds (success: False)

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 month ago

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

Code owner commands Code owners of `xiaomi_miio` 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 xiaomi_miio` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

sephrat commented 3 weeks ago

I have the same issue with my Roborock S5. I've noticed that opening the Xiaomi Home app seems to get the device back online, until it eventually becomes unavailable again. It looks like the device network interface goes into sleep mode when the app is not open and the Android app will wake it up when trying to fetch information. NB: the device seems to occasionally wake up on its own as well. This definitely is a new behaviour, I suspect a recent firmware update causes this.

Yesterday I started testing sending a WoL magic packet to the device when it becomes unavailable in HA. So far this seems to do the trick: this will get the device back online the next time HA polls it (in the next 30s). This is not ideal but at least reduces the time the device appears unavailable. After running this for a few weeks, this seems to have been a coincidence and it doesn't solve the issue.

Stooovie commented 1 week ago

Same with Smartmi Fan 2S and Air Purifier 4. Devices just disconnect (while still online in Xiaomi Home) intermittently.