Miio Xiaomi Air Purifier availability blinking

I have connected my Mi Air Purifier 3H via Xiaomi Air Purifier integration.

However, I’ve noticed it gets offline from time to time.

If you take a closer look at the history graph, you’ll notice that availability is blinking and eventually it gets unavailable completely. Only rebooting a router helps to get it back online.

At the same time, my humidifier that works over syssi/xiaomi_airpurifier, works fine.

I’ve configured my fans like this:

fan:
  - platform: xiaomi_miio_airpurifier
    name: humidifier
    host: !secret humidifier_host
    token:  !secret humidifier_token
  - platform: xiaomi_miio
    name: purifier
    host: !secret purifier_host
    token: !secret purifier_token

In HA logs I get this:

2020-06-18 12:11:06 ERROR (SyncWorker_11) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 12:11:06 WARNING (MainThread) [homeassistant.components.fan] Platform xiaomi_miio not ready yet. Retrying in 60 seconds.
2020-06-18 12:12:12 ERROR (SyncWorker_8) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 12:12:12 WARNING (MainThread) [homeassistant.components.fan] Platform xiaomi_miio not ready yet. Retrying in 90 seconds.
2020-06-18 12:13:48 ERROR (SyncWorker_3) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 12:13:48 WARNING (MainThread) [homeassistant.components.fan] Platform xiaomi_miio not ready yet. Retrying in 120 seconds.

2020-06-18 12:31:38 WARNING (MainThread) [homeassistant.helpers.entity] Update of fan.purifier is taking over 10 seconds
2020-06-18 12:36:17 WARNING (MainThread) [homeassistant.helpers.entity] Update of fan.purifier is taking over 10 seconds
2020-06-18 12:36:17 ERROR (SyncWorker_8) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 12:36:17 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188
2020-06-18 12:36:43 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188
2020-06-18 12:38:46 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
2020-06-18 13:05:03 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
2020-06-18 13:12:16 WARNING (MainThread) [homeassistant.helpers.entity] Update of fan.purifier is taking over 10 seconds
2020-06-18 13:12:16 ERROR (SyncWorker_3) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 13:12:16 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188
2020-06-18 13:13:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of fan.purifier is taking over 10 seconds
2020-06-18 13:15:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of fan.purifier is taking over 10 seconds
2020-06-18 13:15:51 ERROR (SyncWorker_8) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 13:15:51 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188
2020-06-18 13:17:23 WARNING (MainThread) [homeassistant.helpers.entity] Update of fan.purifier is taking over 10 seconds
2020-06-18 13:17:23 ERROR (SyncWorker_7) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 13:17:23 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188
2020-06-18 13:17:23 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request 
2020-06-18 13:18:56 ERROR (SyncWorker_1) [miio.miioprotocol] Unable to discover a device at address 192.168.0.188
2020-06-18 13:18:56 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188

The most interesting part here (from my point of view):

[homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.0.188
[homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}

Maybe I’ve set up it wrong way? Or maybe there’s some instability with integration itself?

I have a same issue, I using Mi Air Purifier 3 (zhimi.airpurifier.ma4)

Same here.
Nobody find the solution?

Same for me.
There is no solution yet?

Same problem here

Same here. Any Idea?

same here, any updates?

Same here. Any fix yet?

Hi,

Same problem for me on both air purifier and vacuum.
I don’t know if it’s related to a xiaomi_miio platform update or a host update.
For me this happened when I moved my IoT devices in a dedicated LAN, separated from everything else, including Home Assistant.
Can you guys tell me if you’re in this case too ? HA and Xiaomi devices not in the same LAN ?
Because if not, that means it’s not related to that and I can stop searching this way :sweat_smile:

My Air Purifier 3H is on the same VLAN as my HA Pie. I’m still having these connectivity issues on HA 2021.4 with the device now configured through the UI (rather than in the configuration.yaml).

This issue got ‘resolved’ in the latest version of Home Assistant 2021 (2021.6.0).

2021.6.3 here and still seeing the air purifier go unavailable randomly:

Same here, though not as much as before. Maybe extend the time just a little bit more to fix the issue completely.

Note sure if my issue is related, but I have HA and the Xiaomi air purifiers (zhimi.airpurifier.m1) on different VLANs. HA detects the devices on the network and I am offered to add the Integration via the GUI; however, the following errors present itself in the log

2021-06-16 22:51:41 ERROR (MainThread) [homeassistant.components.xiaomi_miio.device] DeviceException during setup of xiaomi device with host 192.168.72.12

I have double and triple-checked the token used and it is still accurate.

I have same issue

I saw an issues on github as “MERGED”
Allow some failures before setting Xiaomi Miio MIOT air purifiers unavailable by bieniu · Pull Request #50755 · home-assistant/core (github.com)

Anyone know when is this fix going live or if its already?

Thanks.

I have the very same issue, also having the Xiaomi devices on different subnet. (however there is no firewall between these subnets, so everything can reach each other vica versa.
The miio integration detects my gateway and my purifier 3h, and after when i added them, I got these errors for both as well:

Retrying setup: DeviceException during setup of xiaomi gateway with host {self._host}

Is there any fix for this?

The problem is definitely around the different subnet settings, as if I put my xiaomi device to the same network which is my home wifi, then the integration works like charm. However this is just very strange, as there is no firewall between the networks, and the device is totally reachable from other subnets as well. Could you please check on this?

2 Likes

BUMP for this.

MY Roborock S5 works fine, my Purifier 3H does not. Any idea why this subnet issue appears?

They call me the Grave Digger. I’m uncovering this bug because it’s pretty annoying.

Is it better to just buy a new purifier and hope it’s firmware isn’t as bad as this one?

1 Like

i don’t think it’s really a firmware issue :slight_smile: if you set the the correct settings in your router it will work just fine (nat masquerade).