Home Assistant - Problems with USB Modbus Plugin - With Error-Log [solved]

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=6
    G_DIETPI_VERSION_RC=1

  • Distro version | bookworm 0

  • Kernel version | Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

  • Architecture | arm64

  • SBC model | RPi 4 Model B (aarch64)

  • Power supply used | orig. Raspberry 4

  • SD card used | San Disk ultra

Additional Information (if applicable)

  • Software title | Home Assistant
  • Was the software title installed freshly or updated/migrated? Freshly
  • Can this issue be replicated on a fresh installation of DietPi? Yes
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Hello,

I am quite a beginner when it comes to Home Assistant.
I would like to read out my solar inverter via RS485-USB stick on the Raspberry.
There is a special plugin for Home Assistant for this.

I have integrated the plugin via HACS, but unfortunately the plugin does not work.

Here is the error log:

2024-08-23 09:02:17.029 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration solax_modbus 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
2024-08-23 09:02:17.033 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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
2024-08-23 09:02:18.281 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.
2024-08-23 09:02:19.636 ERROR (ImportExecutor_0) [homeassistant.components.camera.img_util] Error loading libturbojpeg; Camera snapshot performance will be sub-optimal
Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/components/camera/img_util.py", line 100, in __init__
    TurboJPEGSingleton.__instance = TurboJPEG()
                                    ^^^^^^^^^^^
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.12/site-packages/turbojpeg.py", line 298, in __init__
    self.__find_turbojpeg() if lib_path is None else lib_path)
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.12/site-packages/turbojpeg.py", line 928, in __find_turbojpeg
    raise RuntimeError(
RuntimeError: Unable to locate turbojpeg library automatically. You may specify the turbojpeg library path manually.
e.g. jpeg = TurboJPEG(lib_path)
2024-08-23 09:02:26.034 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry SolaX for solax_modbus
Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/dietpi_userdata/homeassistant/custom_components/solax_modbus/__init__.py", line 159, in async_setup_entry
    hub = SolaXModbusHub(
          ^^^^^^^^^^^^^^^
  File "/mnt/dietpi_userdata/homeassistant/custom_components/solax_modbus/__init__.py", line 237, in __init__
    self._client = AsyncModbusSerialClient(
                   ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AsyncModbusSerialClient.__init__() got an unexpected keyword argument 'method'
2024-08-23 09:02:26.169 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/frontend", "/mnt/dietpi_userdata/homeassistant/custom_components/hacs/hacs_frontend", False)])`; This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 54: hass.http.register_static_path(f"{URL_BASE}/frontend", locate_dir(), cache_headers=False), please create a bug report at https://github.com/hacs/integration/issues
2024-08-23 09:02:26.177 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/iconset.js", "/mnt/dietpi_userdata/homeassistant/custom_components/hacs/iconset.js", True)])`; This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 57: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-23 09:02:26.184 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-23 09:02:27.043 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-23 09:02:30.849 ERROR (SyncWorker_2) [aiodhcpwatcher] Cannot watch for dhcp packets without a functional packet filter: libpcap is not available. Cannot compile filter !

Does anyone have any idea what I could do to make it work?

I have now completely reinstalled the Raspberry with Home Assistant OS and the plugin runs without any problems.
So it is definitely due to Dietpi, or rather the way Home Assistant is implemented.

Does anyone here have any idea what I can do to make the whole thing run under Dietpi?

YOu probably need to install libjpeg-turbo: apt install libjpeg-turbo

Then there is a fresh issue about the SolaX error in github:
https://github.com/wills106/homeassistant-solax-modbus/issues/1008

and the last error is about libcap, which can be installed with

apt install libpcap-dev
1 Like

It was a bug in the Modbus plugin itself. This has been fixed with the new version 2024.08.12.

Now everything works

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.