krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
452 stars 47 forks source link

Unexpected error importing meross_lan/**** #414

Closed andker87 closed 8 months ago

andker87 commented 8 months ago

Version of the custom_component

v5.0.3

Describe the bug

I solved this issue by removing the custom_component, restarting Home Assistant and installing it again. I removed power from the 3 devices (Meross 310 smart plugs) and then reconnected them. Home Assistant immediately discovered them by dhcp and they were configured correctly. However, every time HA restarts, this error appears.

(Also, I don't know if it's related, all the custom_component configurations dialogs don't show any text...it's like they're in white text on a white background. this happens only with this custom component, others are fine. I can provide a screenshot if needed)

Debug log


Logger: homeassistant.helpers.integration_platform
Source: helpers/integration_platform.py:52
First occurred: 12:54:36 AM (6 occurrences)
Last logged: 12:55:29 AM

Unexpected error importing meross_lan/media_source.py
Unexpected error importing meross_lan/system_health.py
Unexpected error importing meross_lan/cast.py
Unexpected error importing meross_lan/significant_change.py
Unexpected error importing meross_lan/hardware.py
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 52, in _get_platform
    return integration.get_platform(platform_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1010, in get_platform
    return self._load_platform(platform_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1025, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1058, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.me.recorder'
gary-sargent commented 8 months ago

@andker87 do you have a single WiFi access point, or multiple ones (or mesh)? In my experience the Meross devices lock on to an access point when they start, and don't roam.

What that means is if their closest access point goes down at some point, they may then switch to one further away. At that point even when the closer access point comes online, they don't roam to it.

It may be that simply unplugging your devices has allowed them to connect to a closer access point, providing a more stable signal?

andker87 commented 8 months ago

@andker87 do you have a single WiFi access point, or multiple ones (or mesh)? In my experience the Meross devices lock on to an access point when they start, and don't roam.

I only have one access point (but meanwhile, one of the 3 smart plugs, the nearest one to the access point, has again become unavailable)

andker87 commented 8 months ago

solved, there was an hidden copy of the folder in custom_components, that I could not detect via Home Assistant Editor. deleting that folder solved the problem.