edalquist / ha_state_machine

5 stars 1 forks source link

Health errors in log since I installed this integration #3

Open erkr opened 12 months ago

erkr commented 12 months ago

Hi,

I copies the folder ha_state_machine, restarted and then added the integration with a sensor (using the example.json) Since then I get these errors in my log:

Logger: homeassistant.helpers.integration_platform
Source: loader.py:855
First occurred: 15:16:11 (9 occurrences)
Last logged: 15:31:08

Unexpected error importing state_machine/system_health.py
Unexpected error importing state_machine/group.py
Unexpected error importing state_machine/cast.py
Unexpected error importing state_machine/hardware.py
Unexpected error importing state_machine/energy.py
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 50, in _async_process_single_integration_platform_component
    platform = integration.get_platform(platform_name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 838, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 855, 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 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.ha_state_machine-main.diagnostics'
erkr commented 12 months ago

Solved!

Found this: https://community.home-assistant.io/t/why-is-homeassistant-trying-to-load-non-existing-logbook-group-system-health/268964/2?u=erkr

After renaming my folder to the exact domain name (instead of ha_state_machine), these errors are gone!! I was not aware of this restriction. Maybe spent a few lines in the readme on the install procedure (folder name state_machine) I can now proceed.

Best Eric