Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors after install #44

Closed
HepoH3 opened this issue Apr 2, 2021 · 16 comments
Closed

Errors after install #44

HepoH3 opened this issue Apr 2, 2021 · 16 comments

Comments

@HepoH3
Copy link

HepoH3 commented Apr 2, 2021

Hi there! Thank you for this integration. It's working but after install I have this error in server log:
Unable to prepare setup for platform xiaomi_miot.sensor: Platform not found (cannot import name 'DeviceStatus' from 'miio.device' (/usr/local/lib/python3.8/site-packages/miio/device.py)).
And ha notification:

The following integrations and platforms could not be set up:
    xiaomi_miot.sensor

My environment: HA core-2021.3.4, also I using miio2 platform, and Xiaomi Gateway 3 integration.

@al-one
Copy link
Owner

al-one commented Apr 6, 2021

I also encountered this error, but I don't know why. Just restart HA.

@HepoH3
Copy link
Author

HepoH3 commented Apr 6, 2021

I also encountered this error, but I don't know why. Just restart HA.

I have this error at every single HA restart :)

@al-one
Copy link
Owner

al-one commented Apr 8, 2021

Try last commit: cb86416 of master.

@HepoH3
Copy link
Author

HepoH3 commented Apr 8, 2021

@al-one, thank you for reply!
Now, in addition to previous error, I got new error:

Error while setting up xiaomi_miot platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/xiaomi_miot/camera.py", line 44, in async_setup_entry
    await async_setup_config_entry(hass, config_entry, async_setup_platform, async_add_entities, ENTITY_DOMAIN)
  File "/config/custom_components/xiaomi_miot/__init__.py", line 369, in async_setup_config_entry
    await async_setup_platform(hass, c, async_add_entities)
  File "/config/custom_components/xiaomi_miot/camera.py", line 62, in async_setup_platform
    entities.append(MiotCameraEntity(hass, cfg, srv))
  File "/config/custom_components/xiaomi_miot/camera.py", line 71, in __init__
    super().__init__(miot_service, config=config)
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1012, in __init__
    super().__init__(miot_service, device, **kwargs)
  File "/config/custom_components/xiaomi_miot/__init__.py", line 589, in __init__
    device = MiotDevice(ip=host, token=token)
TypeError: __init__() missing 1 required positional argument: 'mapping'

@al-one
Copy link
Owner

al-one commented Apr 8, 2021

You need to clean up the installed python-miio or upgrade it to v0.5.5.2, and recommended upgrade HA to v2021.4.0.

rm -rf /usr/local/lib/python3.8/site-packages/*miio*
pip install -U python-miio
pip install -U homeassistant

@HepoH3
Copy link
Author

HepoH3 commented Apr 8, 2021

You need to clean up the installed python-miio or upgrade it to v0.5.5.2, and recommended upgrade HA to v2021.4.0.

rm -rf /usr/local/lib/python3.8/site-packages/*miio*
pip install -U python-miio
pip install -U homeassistant

Actually, I'm using HassOS, so I can't operate manualy with python libs.After upgrading HA to v2021.4.0 errors remains.

al-one added a commit that referenced this issue Apr 8, 2021
@al-one
Copy link
Owner

al-one commented Apr 8, 2021

Try last commit: 3fd2c3a of master.

@HepoH3
Copy link
Author

HepoH3 commented Apr 8, 2021

Now, new error went away, but original one still there.

@al-one
Copy link
Owner

al-one commented Apr 8, 2021

Find the version of python-miio you are using.

@HepoH3
Copy link
Author

HepoH3 commented Apr 8, 2021

python-miio

I will try, but currently don't know how to do this.

@HepoH3
Copy link
Author

HepoH3 commented Apr 8, 2021

Find the version of python-miio you are using.

Okay, found it. Version 0.5.5.

@HepoH3
Copy link
Author

HepoH3 commented Apr 8, 2021

So I succeed in updating miio version. Now error is:
Unable to prepare setup for platform xiaomi_miot.sensor: Platform not found (No module named 'miio.waterpurifier_yunmi').
UPD. nope, I rechecked version, print(miio.version) still says 0.5.5.

@karolzamosc
Copy link

So I succeed in updating miio version. Now error is:
Unable to prepare setup for platform xiaomi_miot.sensor: Platform not found (No module named 'miio.waterpurifier_yunmi').
UPD. nope, I rechecked version, print(miio.version) still says 0.5.5.

Any news? I have same problems too... After updating HA to the newest version my miio2 integration for STYTJ02YM vaccum stopped working. I had a HACS integration for Air Purifier 2S but it now supprted by built in miio integration. After uninstall miio2 all works fine but I can not add my vacuum to HA then... :-(

@HepoH3
Copy link
Author

HepoH3 commented Apr 12, 2021

In addition, now I can see another errors:
Error occurred loading configuration flow for integration xiaomi_miio: No module named 'miio.gateway.gateway'; 'miio.gateway' is not a package
and

Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 573, in async_create_flow
    integration.get_platform("config_flow")
  File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 490, 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 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  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 "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 5, in <module>
    from miio.gateway.gateway import GatewayException
ModuleNotFoundError: No module named 'miio.gateway.gateway'; 'miio.gateway' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 120, in async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 580, in async_create_flow
    raise data_entry_flow.UnknownHandler
homeassistant.data_entry_flow.UnknownHandler

@al-one
Copy link
Owner

al-one commented Apr 12, 2021

I suggest you recreate your HA environment.

@HepoH3
Copy link
Author

HepoH3 commented Apr 17, 2021

Okay, now I found what was the problem — it was this custom integration who caused the problems because of python-miio version in those manifest.

@HepoH3 HepoH3 closed this as completed Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants