xiaomi_airpurifier: Cannot import name 'AirHumidifierMiot' from 'miio'" - workaround
Get error, when check config:
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'AirHumidifierMiot' from 'miio' (/usr/local/lib/python3.8/site-packages/miio/__init__.py)
Error appears, when adding to configuration.yaml:
fan:
- platform: xiaomi_miio_airpurifier
name: mi_humidifier_child
host: 192.168.x.xx
token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
model: deerma.humidifier.mjjsq
HA supervised. Xiaomi Mi Air Purifier, Air Humidifier, Air Fresh and Pedestal Fan Integration installed via HACS. System info:
arch | x86_64
-- | --
chassis | vm
dev | false
docker | true
docker_version | 19.03.11
hassio | true
host_os | HassOS 4.15
installation_type | Home Assistant OS
os_name | Linux
os_version | 5.4.72
python_version | 3.8.6
supervisor | 2020.11.0
timezone | Europe/Moscow
version | 0.117.4
virtualenv | false
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 28 (11 by maintainers)
I got the error
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'FanMiot' from 'miio'
today with HA 0.118.0 after upgrading xiaomi_airpurifier from 0.6.1 to 0.6.2 I tried HACS and manual install from downloaded xiaomi_airpurifier-develop.zip Downgraded back to 0.6.1I have another error with this model. Errors starts with last version, before works fine
Platform error fan.xiaomi_miio_airpurifier - cannot import name 'FanMiot' from 'miio' (/usr/local/lib/python3.8/site-packages/miio/__init__.py)
I use homeassistant/qemux86-64-homeassistant:0.117.5 container, it has 0.5.4 python-miio
I found a workaround which works for me. Copy the official
xiaomi_miio
component to yourcustom_components
folder and edit themanifest.json
. The updated dependencies must be used here:Reboot HA. This solves the issue of different required
python-miio
andconstruct
versions. All manifest.json’s of python-miio dependend custom components requires the same version/line at the manifest:If this is fulfilled the errors are gone. As soon HA 0.119 is reased the
xiaomi_miio
folder can be removed again.I hit the same issue today:
If I check the age of the
__init__.py
we can see the pip package is installed on every reboot:As soon as HA and the custom component uses the same python-miio version the issue will be gone.
@syssi That’s what I did 😉 Guten Rutsch ins neue Jahr. Greetings from Shanghai
@neo799 just update the manifest.json of the heater to: