Xiaomi Miio not working since Release 2021.10.X

Hi. I have a couple of Xiaomi power plugs which use the Xiaomi Miio integration. They have stopped working since this latest release.
The logs say:
Error occurred loading configuration flow for integration xiaomi_miio: cannot import name ‘FanZA5’ from ‘miio’ (/usr/local/lib/python3.9/site-packages/miio/init.py)

If I try and remove them they won’t remove. If I try and re-add the integration I get:
## Error

Config flow could not be loaded

Anyone have any ideas?

Actually I just managed to fix it. I was also using the Xiaomi Miio for Yeelight integration from HACS. Once I updated that it, the Xiaomi Miio integration also started to work… due to reasons I don’t understand =)

Huh??? Both Xiaomi Miio (for my WiFi Plugs) and Yeelights are using the core HA components and work perfectly.

Since Xiaomi branded Yeelights no longer allow for local control, they don’t work with the standard Yeelight integration any more. The only way I found to get around it is to use the HACS integration “Xiaomi Miio for Yeelight” (apparently now there are other ways to do it though…).

My core HA integration Xiaomi Miio was broken until I also updated the HACS one. No idea why.

My Yeelights are pretty old and still have the LAN control setting…

If they are specifically Xiaomi branded Yeelights, make sure you don’t update the firmware then.

See the “Active Alert” at the top of the page:

no they are Yeelight brand only and are a few years old

Hi.
I faced with the same issue, sometimes HA miio works ok, sometimes I got the same error (FanZA5).
I did random actions (change configs, update something or even change lang, restart HA, reboot), sometimes it help.
Also I noted, file /srv/homeassistant/lib/python3.9/site-packages/miio/init.py
had a row:
from miio.fan_miot import Fan1C, FanMiot, FanP9, FanP10, FanP11, FanZA5
but now somehow it have been without ‘FanZA5’:
from miio.fan_miot import Fan1C, FanMiot, FanP9, FanP10, FanP11
If I added ‘, FanZA5’ at the end of the string (row 39) and restart HA, miio started work fine.

Home Assistant 2021.11.1

Python: 3.9.8
HW: RPi 4

Seems something edit init file, one after I added FanZA5, one before:


diff /srv/homeassistant/lib/python3.9/site-packages/miio/__init__.py /work/__init__.py
39c39
< from miio.fan_miot import Fan1C, FanMiot, FanP9, FanP10, FanP11
---
> from miio.fan_miot import Fan1C, FanMiot, FanP9, FanP10, FanP11, FanZA5
51a52
> from miio.roidmivacuum_miot import RoidmiVacuumMiot

Robot vacuum intergration impact on miio ?

Solved:
I checked all manifest.json files regarding miio version dependency. One custom integration have following string:
./.homeassistant/custom_components/miio2/manifest.json: “python-miio==0.5.6”
Just changed it to:
./.homeassistant/custom_components/miio2/manifest.json: “python-miio>=0.5.6”
Also I executed following commands from HA user:
PATH=$PATH:/srv/homeassistant/bin
hass --script check_config #very useful command

2 Likes

Hello, mine it’s still:

“requirements”: [
“construct==2.10.56”,
“python-miio>=0.5.6”

And it does not work. Any other suggestions? Thanks