wills106 / homeassistant-solax-modbus

SolaX Power Modbus custom_component for Home Assistant (Supports some AlphaESS, Growatt, Sofar, Solinteg, Solis, SRNE, Swatten)
320 stars 102 forks source link

[Bug]: Home assistant doesn’t load Solax integration #1113

Open iMatte81 opened 3 weeks ago

iMatte81 commented 3 weeks ago

Describe the bug

After updating Home assistant core on docker version 2024.10.3 s9lax integration stop to load.

Integration Version

2024.10.4

Homeassistant core version

2024.10.3

Inverter brand

Solax

Plugin used

plugin_solax.py

Serial prefix

NA

Inverter firmware versions

NA

Connection Method

Solax pocket wifi

Dongle firmware

NA

Detailed Error Log

Registratore: homeassistant.setup Fonte: setup.py:334 Prima occorrenza: 22:28:44 (1 occorrenze) Ultima registrazione: 22:28:44

Setup failed for custom integration 'solax_modbus': Unable to import component: cannot import name 'ModbusAsciiFramer' from 'pymodbus.transaction' (/usr/local/lib/python3.12/site-packages/pymodbus/transaction.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component comp = await self.hass.async_add_import_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/loader.py", line 1067, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/solax_modbus/init.py", line 60, in from pymodbus.transaction import ModbusAsciiFramer, ModbusRtuFramer ImportError: cannot import name 'ModbusAsciiFramer' from 'pymodbus.transaction' (/usr/local/lib/python3.12/site-packages/pymodbus/transaction.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component component = await integration.async_get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component self._component_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component comp = self._get_component() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/solax_modbus/init.py", line 60, in from pymodbus.transaction import ModbusAsciiFramer, ModbusRtuFramer ImportError: cannot import name 'ModbusAsciiFramer' from 'pymodbus.transaction' (/usr/local/lib/python3.12/site-packages/pymodbus/transaction.py)

Additional context

No response

wills106 commented 2 weeks ago

What pyModbus version are you running?

https://homeassistant-solax-modbus.readthedocs.io/en/latest/faq/#how-to-check-a-version-of-a-python-module-eg-pymodbus

iMatte81 commented 2 weeks ago

My version is 3.7.4

wills106 commented 2 hours ago

Does it work if you manually downgrade pyModbus to 3.6.8 or 3.6.9?

It might be difficult to support 3.7.x as HA is still on pre 3.7x version. Looks like they have changed how you import framers.

iMatte81 commented 3 minutes ago

It doesn't work but I think it is a my problem, because after downgrade to 3.6.9 after a reboot the version become always 3.7.4. When I'll have time I'll reinstall home assistant and I'll check if the problem is solved.

wills106 commented 1 minute ago

Do you use any other custom integrations using pyModbus? Aircon or Boiler etc?