Heh… I made several mistakes. One is also in your initial code… I try to describe all of them to help you find final solution.
- Initially I put proposed by you content into file
__init__.py
instead of manifest.json
. It silently worked as expected without any notifications. I suppose because of false
written lowercase. It should be uppercase.
- Your hacs code seems to work but it raises notification and related records in ha log:
2021-07-18 15:40:54 INFO (MainThread) [homeassistant.setup] Setting up shelly
2021-07-18 15:40:54 ERROR (MainThread) [homeassistant.setup] Setup failed for shelly: No setup function defined.
Otherwise log contain a line:
2021-07-18 15:40:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for shelly which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
which somehow confirms running custom component
Also I found following error:
2021-07-18 15:42:36 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration shelly: No module named 'custom_components.shelly.config_flow'
2021-07-18 15:42:36 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 535, in async_create_flow
integration.get_platform("config_flow")
File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 429, 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 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.shelly.config_flow'
And likely for all my shelly devices which I clicked “Ignore”:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 119, in async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 542, in async_create_flow
raise data_entry_flow.UnknownHandler
homeassistant.data_entry_flow.UnknownHandler
2021-07-18 15:42:36 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration shelly: No module named 'custom_components.shelly.config_flow'
2021-07-18 15:42:36 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 535, in async_create_flow
integration.get_platform("config_flow")
File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 429, 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 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.shelly.config_flow'
....