Why is Homeassistant trying to load non-existing logbook / group / system_health /

Hi, I’m currently seeing an error that I’ve never seen before during the development of a new component.

2021-01-16T07:53:04.083654480Z 2021-01-16 08:53:04 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing ha_alert/system_health.py
2021-01-16T07:53:04.083693727Z Traceback (most recent call last):
2021-01-16T07:53:04.083705781Z   File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
2021-01-16T07:53:04.083715228Z     platform = integration.get_platform(platform_name)
2021-01-16T07:53:04.083721930Z   File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platform
2021-01-16T07:53:04.083729296Z     cache[full_name] = self._import_platform(platform_name)
2021-01-16T07:53:04.083737810Z   File "/usr/src/homeassistant/homeassistant/loader.py", line 429, in _import_platform
2021-01-16T07:53:04.083744849Z     return importlib.import_module(f"{self.pkg_path}.{platform_name}")
2021-01-16T07:53:04.083752594Z   File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
2021-01-16T07:53:04.083808604Z     return _bootstrap._gcd_import(name[level:], package, level)
2021-01-16T07:53:04.083818586Z   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2021-01-16T07:53:04.083826068Z   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2021-01-16T07:53:04.083835135Z   File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2021-01-16T07:53:04.083843253Z ModuleNotFoundError: No module named 'custom_components.ha_alerts.system_health'

The type of error occurs 4x: For system_health / media_source / logbook / group

Its worth to mention that the sensor part of it loads and is working fine, but why is HASS trying to load the other 4 parts?

It feels a bit silly to ask because this seams super stupid. But I’ve spend multiple hours to fix it and can’t get it to work. I’ve copied directly from my other custom_components which work all fine and even used the code from https://github.com/boralyl/github-custom-component-tutorial/blob/feature/part4/custom_components/github_custom/config_flow.py but nothing helps

The Code that’s causing the trouble is this:

Help is highly appreciated
Kolja

Did you ever figure this out?

Edit: I was having the same issue with a custom component and it was because the folder name was not exactly the same as the DOMAIN. A typo I introduced while cleaning things up. Once I fixed the name, the errors went away.

3 Likes