Those last few days, I’ve been receiving feedback from the user community.
Thanks a lot, it helped detect and solve bugs. Now that the custom integration is “stable”. I will no longer introduce new features, but still solve bugs if any.
Next step is to make it an official integration and go for the first production ready release.
I’m very open to contributors and any other help and guidance, I will be working on my next official major release as time allows.
PS/ why official ? cause it allows me to learn on how to code in Python and apply best practices.
So first step is to have your Nikobus config files for modules placed in /config
Rename the file from .default to .json
Please mind that for module, the address is not the same as in openHAB. if the address of your module is ABCD in HomeAssistant config file discussed above it needs to be CDAB. The integration uses the very same address as defined in Nikobus software.
Get that step started, no need to test with all modules. once done revert here if the setup is still failing with a debuglog.
Debuglog,
go to settings - integration - nikobus - enable debuglog
restart HomeAssistant
go to settings - system - logs - put a filter with “niko” then copy/paste the log with error here
This error originated from a custom integration.
Logger: custom_components.nikobus
Source: custom_components/nikobus/__init__.py:35
integration: Nikobus (documentation, issues)
First occurred: 7:51:57 PM (1 occurrences)
Last logged: 7:51:57 PM
An error occurred during connection setup: An error occurred loading configuration files: Module configuration file not found: /config/nikobus_module_config.json
Logger: homeassistant.config_entries
Source: config_entries.py:635
First occurred: 7:51:57 PM (1 occurrences)
Last logged: 7:51:57 PM
Error setting up entry Nikobus - /dev/ttyUSB0 for nikobus
Traceback (most recent call last):
File "/config/custom_components/nikobus/nkbconfig.py", line 25, in load_json_data
async with aio_open(file_path, mode="r") as file:
File "/usr/local/lib/python3.12/site-packages/aiofiles/base.py", line 63, in __aenter__
return await self
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiofiles/base.py", line 59, in __await__
self._obj = yield from self._coro.__await__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiofiles/threadpool/__init__.py", line 92, in _open
f = await loop.run_in_executor(executor, cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/config/nikobus_module_config.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/nikobus/nikobus.py", line 55, in connect
self.dict_module_data = await self._nikobus_config.load_json_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nikobus/nkbconfig.py", line 29, in load_json_data
self._handle_file_not_found(file_path, data_type)
File "/config/custom_components/nikobus/nkbconfig.py", line 72, in _handle_file_not_found
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Module configuration file not found: /config/nikobus_module_config.json
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/nikobus/__init__.py", line 33, in async_setup_entry
await coordinator.connect()
File "/config/custom_components/nikobus/coordinator.py", line 66, in connect
self.api = await Nikobus.create(
^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nikobus/nikobus.py", line 45, in create
if await instance.connect():
^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nikobus/nikobus.py", line 99, in connect
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: An error occurred loading configuration files: Module configuration file not found: /config/nikobus_module_config.json
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nikobus/__init__.py", line 36, in async_setup_entry
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: An error occurred loading configuration files: An error occurred loading configuration files: Module configuration file not found: /config/nikobus_module_config.json
Strange. When I browse in de file editor in HA I don’t see a config folder. Looks like the configuration.yaml is in the root.
When browsing Samba there is a config folder with the same files as in the root of de HA file editor.
n.
Logger: custom_components.nikobus
Source: custom_components/nikobus/__init__.py:35
integration: Nikobus (documentation, issues)
First occurred: 9:03:23 PM (1 occurrences)
Last logged: 9:03:23 PM
An error occurred during connection setup: An error occurred loading configuration files: Scene configuration file not found: /config/nikobus_scene_config.json