core: Xiaomi MIIO Integration - Air Purifier 3H detected but not working

The problem

I’ve installed the Xiaomi MIIO integration (https://www.home-assistant.io/integrations/xiaomi_miio/) using the direct link from page. It asked me the credential and after detected correctly the Air Purifier but then: image

and I get an infinite sequence of:


2023-01-22 14:47:16.134 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Finished fetching Air 3H Studio data in 5.005 seconds (success: False)
2023-01-22 14:48:04.298 ERROR (MainThread) [homeassistant.components.homeassistant] The service homeassistant.turn_off cannot be called without a target
2023-01-22 14:48:36.197 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Initializing with host 192.168.1.132 (token cb988...)
2023-01-22 14:48:36.198 DEBUG (SyncWorker_39) [miio.click_common] Unknown model, trying autodetection. None None
2023-01-22 14:48:36.458 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Initializing with host 192.168.1.119 (token 95436...)
2023-01-22 14:48:36.459 DEBUG (SyncWorker_34) [miio.click_common] Unknown model, trying autodetection. None None
2023-01-22 14:48:41.203 DEBUG (SyncWorker_39) [miio.miioprotocol] Unable to discover a device at address 192.168.1.132
2023-01-22 14:48:41.204 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Finished fetching Air 3H Studio data in 5.007 seconds (success: False)
2023-01-22 14:48:41.465 DEBUG (SyncWorker_34) [miio.miioprotocol] Unable to discover a device at address 192.168.1.119
2023-01-22 14:48:41.466 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Finished fetching Air 3H Camera data in 5.008 seconds (success: False)
2023-01-22 14:50:01.449 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Initializing with host 192.168.1.132 (token cb988...)
2023-01-22 14:50:01.449 DEBUG (SyncWorker_46) [miio.click_common] Unknown model, trying autodetection. None None
2023-01-22 14:50:01.590 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Initializing with host 192.168.1.119 (token 95436...)
2023-01-22 14:50:01.591 DEBUG (SyncWorker_31) [miio.click_common] Unknown model, trying autodetection. None None
2023-01-22 14:50:06.455 DEBUG (SyncWorker_46) [miio.miioprotocol] Unable to discover a device at address 192.168.1.132
2023-01-22 14:50:06.456 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Finished fetching Air 3H Studio data in 5.007 seconds (success: False)
2023-01-22 14:50:06.596 DEBUG (SyncWorker_31) [miio.miioprotocol] Unable to discover a device at address 192.168.1.119
2023-01-22 14:50:06.597 DEBUG (MainThread) [homeassistant.components.xiaomi_miio] Finished fetching Air 3H Camera data in 5.007 seconds (success: False)

What version of Home Assistant Core has the issue?

core-2023.1.6

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/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

Most upvoted comments

It’s fixable. I spend some time on it, and the root cause of much of the issues is that those Purifier 3H devices ONLY respond to packets coming from either “the Xiaomi Cloud servers” or from an device with an IP address on the same subnet. Having your HA in another subnet, even without any firewall rules blocking anything is not allowed by the firmware of the Purifiers. So you can either move your HA or Purifiers around, or you can do some IP masquerading so that packets coming from a HA in another subnet or VLAN, seems to be coming from a device on the subnet/vlan of the Purifiers.

If you happen to use Pfsense as a firewall then this will fix it: image

Not stale