question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot import name 'AirHumidifierMiot' from 'miio'" - workaround

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

5reactions
slydimancommented, Nov 18, 2020

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.1

3reactions
fufarcommented, Nov 16, 2020

I 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)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 823, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 422, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 427, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/xiaomi_miio_airpurifier/fan.py", line 7, in <module>
    from miio import (  # pylint: disable=import-error
ImportError: 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

bash-4.3# docker exec -it 64114 bash
bash-5.0# pip3 list | grep miio
python-miio                      0.5.4
bash-5.0# python3
Python 3.8.6 (default, Oct 14 2020, 15:45:05)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from miio import AirHumidifierMiot
>>> from miio import FanMiot
>>>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mi Smart Pedestal Fan - #179 by Grijzekop - Configuration
Hi, I have recently purchased one of these Mi Smart Pedestal Fans (see below) and whilst it works great the native app is...
Read more >
miio.discovery — python-miio documentation - Read the Docs
Source code for miio.discovery. import codecs import inspect import logging import time from functools import partial from ipaddress import ip_address from ...
Read more >
python-miio - PyPI
You can get some information from any miIO/MIoT device, including its device model, ... from miio import RoborockVacuum vac = RoborockVacuum("<ip address>", ...
Read more >
cannot import name 'file_hash' from 'pooch.utils' - YouTube
How to resolve ImportError: cannot import name 'file_hash' from 'pooch.utils'
Read more >
Python plugin: Xiaomi Mi Robot Vacuum - Page 5 - Domoticz
It should be more informative of why it can't be installed ! ... miio_server.py", line 17, in <module> from miio import Vacuum, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found