xiaomi_miot_raw icon indicating copy to clipboard operation
xiaomi_miot_raw copied to clipboard

HA 2023.6 Update Error

Open cataseven opened this issue 1 year ago • 12 comments

Hi,

After the update I am getting this error for Xiaomi Miot Raw integration

This error originated from a custom integration.

The following integrations and platforms could not be set up:

  • xiaomi_miot_raw.sensor
  • xiaomi_miot_raw.binary_sensor
  • xiaomi_miot_raw.number filter=xiaomi_miot_raw.number))
  • xiaomi_miot_raw.fan
  • xiaomi_miot_raw.select
  • xiaomi_miot_raw.vacuum filter=xiaomi_miot_raw.vacuum))

Please check your config and Logger: homeassistant.loader Source: custom_components/xiaomi_miot_raw/basic_dev_class.py:684 Integration: Xiaomi MIoT (documentation, issues) First occurred: 12:34:59 (6 occurrences) Last logged: 12:35:00

Unexpected exception importing platform custom_components.xiaomi_miot_raw.binary_sensor Unexpected exception importing platform custom_components.xiaomi_miot_raw.number Unexpected exception importing platform custom_components.xiaomi_miot_raw.fan Unexpected exception importing platform custom_components.xiaomi_miot_raw.select Unexpected exception importing platform custom_components.xiaomi_miot_raw.vacuum

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/xiaomi_miot_raw/sensor.py", line 20, in <module>
    from .basic_dev_class import (
  File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 63, in <module>
    class GenericMiotDevice(Entity):
  File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 684, in GenericMiotDevice
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
Logger: homeassistant.setup
Source: setup.py:374
First occurred: 12:34:59 (6 occurrences)
Last logged: 12:35:00

Unable to prepare setup for platform xiaomi_miot_raw.binary_sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.binary_sensor).
Unable to prepare setup for platform xiaomi_miot_raw.number: Platform not found (Exception importing custom_components.xiaomi_miot_raw.number).
Unable to prepare setup for platform xiaomi_miot_raw.fan: Platform not found (Exception importing custom_components.xiaomi_miot_raw.fan).
Unable to prepare setup for platform xiaomi_miot_raw.select: Platform not found (Exception importing custom_components.xiaomi_miot_raw.select).
Unable to prepare setup for platform xiaomi_miot_raw.vacuum: Platform not found (Exception importing custom_components.xiaomi_miot_raw.vacuum).

cataseven avatar Jun 08 '23 09:06 cataseven

https://docs.python.org/3.8/library/asyncio-task.html#asyncio.coroutine

That is the reason i think

cataseven avatar Jun 08 '23 12:06 cataseven

Go to your ../custom_components/xiaomi_miot_raw folder & And remove the following in each *.py file.

import asyncio @asyncio.coroutine

Then reload the addon, and then it will run again :-)

Gerrett84 avatar Jun 08 '23 14:06 Gerrett84

Go to your ../custom_components/xiaomi_miot_raw folder & And remove the following in each *.py file.

import asyncio @asyncio.coroutine

Then reload the addon, and then it will run again :-)

This is the easiet solution. Thanks

cataseven avatar Jun 08 '23 15:06 cataseven

Hi , I need some help. I try to fix this problem with the latest version of HA, when I try to delete this file I don't find it in "config/custom_component/xiaomi_miot_raw". I try with file editor , studio code server and SAMBA SHARE with no solution can any help me Thanks

mattiabrunello5 avatar Jun 09 '23 21:06 mattiabrunello5

They are not files, they are words in files. Go to miot folder, right click on miot folder, select find in folder, write "import asyncio". It will show all of them. Delete these words. Do the same for @asyncio.coroutine

Restart HA

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: mattiabrunello5 @.> Sent: Saturday, June 10, 2023 12:56:59 AM To: ha0y/xiaomi_miot_raw @.> Cc: cataseven @.>; Author @.> Subject: Re: [ha0y/xiaomi_miot_raw] HA 2023.6 Update Error (Issue #518)

Hi , I need some help. I try to fix this problem with the latest version of HA, when I try to delete this file I don't find it in "config/custom_component/xiaomi_miot_raw". I try with file editor , studio code server and SAMBA SHARE with no solution can any help me Thanks

— Reply to this email directly, view it on GitHubhttps://github.com/ha0y/xiaomi_miot_raw/issues/518#issuecomment-1585170512, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMQIZKFCHIDCIRXSJG3TTJTXKOL2XANCNFSM6AAAAAAY7B3B2U. You are receiving this because you authored the thread.Message ID: @.***>

cataseven avatar Jun 09 '23 22:06 cataseven

mine still not working

Ricricric109 avatar Jun 11 '23 06:06 Ricricric109

Go to your ../custom_components/xiaomi_miot_raw folder & And remove the following in each *.py file.

import asyncio @asyncio.coroutine

Then reload the addon, and then it will run again :-)

also need to change "yield from" to "await" in basic_dev_class.py (line 705,709)

kongh9 avatar Jun 11 '23 22:06 kongh9

I have the same issue after updating of HA 2023.6 version

kpblca avatar Jun 13 '23 22:06 kpblca

Is this project no longer maintained

wuai1024 avatar Jun 14 '23 00:06 wuai1024

Additionally, its required one more change from: https://github.com/ha0y/xiaomi_miot_raw/issues/516#issuecomment-1586767510

kpblca avatar Jun 14 '23 07:06 kpblca

It works for me by just removing 'import asyncio' and '@asyncio.coroutine'. Thank you very much.

ongct avatar Oct 09 '23 09:10 ongct

024-04-10 22:34:18.516 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 554, in create_sub_entities self._hass.data[DOMAIN]['add_handler']['number'][self._entry_id](num_to_add, update_before_add=True) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ KeyError: 'number'

sonicno1 avatar Apr 10 '24 14:04 sonicno1