Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: HA 2025.01: Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message' #873

Open
5 tasks done
screamer3003 opened this issue Jan 3, 2025 · 31 comments
Labels
bug Something isn't working

Comments

@screamer3003
Copy link

screamer3003 commented Jan 3, 2025

Describe the issue

After the Update to 2025.1.0 I Get this error

Logger: homeassistant.setup
Quelle: setup.py:334
Erstmals aufgetreten: 21:28:29 (1 Vorkommnisse)
Zuletzt protokolliert: 21:28:29

Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message'
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 1035, in async_get_component
self._component_future.result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1015, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._get_component, True
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, 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.13/importlib/init.py", line 88, 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 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/huawei_solar/init.py", line 9, in
from huawei_solar import (
...<9 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/init.py", line 4, in
from .bridge import (
...<6 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 34, in
from .huawei_solar import (
...<5 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 19, in
from pymodbus.message.rtu import MessageRTU
ModuleNotFoundError: No module named 'pymodbus.message'

Describe your Huawei Solar Setup

Inverter Type:
Inverter Firmware version:
sDongle present: Yes / No
sDongle Type: sDongleA-05 (WiFi / Ethernet) / SDongleA-03 (4G)
sDongle Connectivitiy: WiFi / Ethernet / 4G
sDongle Firmware:
Power meter present: three phase / single phase / no
Optimizers Present: Yes / No
Battery: LUNA2000-SO xxkWh / LUNA2000-S1 xxkWh (Released 2024) / LG RESU xxkWh / None
Battery Firmware version:
Huawei Solar integration version:

How do you connect to the inverter?

Via the SDongle, wired connection

Upload your Diagnostics File

Drag & Drop your Diagnostics File here.

Upload your relevant debug logs

Logger: homeassistant.setup
Quelle: setup.py:334
Erstmals aufgetreten: 21:28:29 (1 Vorkommnisse)
Zuletzt protokolliert: 21:28:29

Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message'
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 1035, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1015, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, 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.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/huawei_solar/__init__.py", line 9, in <module>
    from huawei_solar import (
    ...<9 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/__init__.py", line 4, in <module>
    from .bridge import (
    ...<6 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 34, in <module>
    from .huawei_solar import (
    ...<5 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 19, in <module>
    from pymodbus.message.rtu import MessageRTU
ModuleNotFoundError: No module named 'pymodbus.message'

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@screamer3003 screamer3003 added the bug Something isn't working label Jan 3, 2025
@wlcrs
Copy link
Owner

wlcrs commented Jan 3, 2025

Warning

Users that use the native modbus-integration alongside this integration should not upgrade to Home Assistant 2025.1, as it contains an upgrade to an incompatible version 3.7.4 of the pyModbus library. Significant work has already been done to upgrade this integration to support v3.8.0 of this library. We expect this to release alongside Home Assistant 2025.2, which is expected to also upgrade to that latest pyModbus version. This will solve the compatibility issue.

@wlcrs wlcrs pinned this issue Jan 3, 2025
@wlcrs wlcrs changed the title [Bug]: Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message' [Bug]: HA 2025.01: Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message' Jan 4, 2025
@Criaga
Copy link

Criaga commented Jan 4, 2025

@wlcrs
Hi, sorry but I'm not very expert. So you don't have to update to the new version 2025.1?

@xm4rcell0x
Copy link

Second this bug.
Hard to revert to 2024.12.5 and is working well.

@jwcappeln
Copy link

Yes, i downgrade core as well without restore a backup.
ha core update --version 2024.12.5

@jomach
Copy link

jomach commented Jan 4, 2025

same here. I just rollback the upgrade without any issues

@ablyes
Copy link

ablyes commented Jan 4, 2025

Same problem for me.
I have modbus for my hitachi heat pump and this plugin for the huawei converter.
Is it possible to have a quick fix ?

@jomach
Copy link

jomach commented Jan 4, 2025

@ablyes downgrade with the command: "ha core update --version 2024.12.5"

@ablyes
Copy link

ablyes commented Jan 4, 2025

I don’t have any backup.
Is this command working without ? With any type of installation ? I have a virtual machine under a synology.

image

@ablyes
Copy link

ablyes commented Jan 4, 2025

Your command worked.
Reading this command makes me understand that it doesn't rely on any backup. Just reach the asked version and install it.
Thank you so much. I have my HA in a good state.
I'll wait for an update of the HACS.

@luzik
Copy link

luzik commented Jan 5, 2025

Sorry for hate but this is the only integration I ever used that ask me for a downgrade. HA 2025.1 is also related to security updates. Now I can't downgrade because of others updated integration that requires now HA 2025.1
You ask me to check all installed integration README before HA upgrade? or only huawei_solar ? That's stupid!

@Aljosha89
Copy link

Sorry for hate but this is the only integration I ever used that ask me for a downgrade. HA 2025.1 is also related to security updates. Now I can't downgrade because of others updated integration that requires now HA 2025.1 You ask me to check all installed integration README before HA upgrade? or only huawei_solar ? That's stupid!

wlcrs is making huge effort to support this integration, your comment is untimely. If you do not like how the integration is handled you should not use it.

@mariusnauj
Copy link

@wlcrs if it works with 2025.01 version of HA if I am using network type integration via inverter wi-fi?

@luzik
Copy link

luzik commented Jan 5, 2025

Don't get me wrong, I love this integration, just wanted to show that some things are important for some people.
This is how I'm using it
tablet – Home Assistant

@netmb
Copy link

netmb commented Jan 5, 2025

Did you pay a penny for the software? Probably not. Accordingly, you have no claims whatsoever against the author. If the software is so important to you, program it yourself. Some people's sense of entitlement really pisses me off. Remember: the author created this in his free time, so we don't have to stress him out. If you can do better: Let's go.

@mariusnauj
Copy link

mariusnauj commented Jan 5, 2025

Hello,

Maybe somebody who tryied can answer:

if it works with 2025.01 version of HA if I am using network type integration via inverter wi-fi?

@luzik
Copy link

luzik commented Jan 5, 2025

Did you pay a penny for the software? Probably not. Accordingly, you have no claims whatsoever against the author. If the software is so important to you, program it yourself. Some people's sense of entitlement really pisses me off. Remember: the author created this in his free time, so we don't have to stress him out. If you can do better: Let's go.

So I’ve got an idea to contribute a bit.
@wlcrs, if you upgrade any branch to include the already updated huawei-solar-lib, which supports the new pymodbus, just add the requirement "homeassistant": "2025.2.0b0" in hacs.json. I’ll update my HA to the 2025.2 beta dev version and test the integration with my setup as much as my hardware allows.

@luzik
Copy link

luzik commented Jan 5, 2025

Helio,

Maybe somebody who tryied can answer:

if it works with 2025.01 version of HA if I am using network type integration via inverter wi-fi?

I believe that it does not work

@mimusato
Copy link

mimusato commented Jan 5, 2025

Hello,

Maybe somebody who tryied can answer:

if it works with 2025.01 version of HA if I am using network type integration via inverter wi-fi?

For me it fails with:

Error setting up entry SUN2000-4KTL-L1 for huawei_solar
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/huawei_solar/init.py", line 207, in async_setup_entry
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2278, in async_forward_entry_setups
await integration.async_get_platforms(platforms)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1185, in async_get_platforms
import_future.result()
~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1185, in async_get_platforms
import_future.result()
~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1185, in async_get_platforms
import_future.result()
~~~~~~~~~~~~~~~~~~~~^^
[Previous line repeated 1 more time]
File "/usr/src/homeassistant/homeassistant/loader.py", line 1173, in async_get_platforms
platforms.update(self._load_platforms(platform_names))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1098, in _load_platforms
platform_name: self._load_platform(platform_name)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1272, in _load_platform
cache[full_name] = self._import_platform(platform_name)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1304, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/init.py", line 88, 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 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/huawei_solar/sensor.py", line 16, in
from homeassistant.const import (
...<8 lines>...
)
ImportError: cannot import name 'ENERGY_KILO_WATT_HOUR' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)


Note: a similar error has been fixed in another repo - https://github.com/tggm/rointe-hacs/pull/15/files

@mimusato
Copy link

mimusato commented Jan 5, 2025

Never mind, I was running an old version. After upgrading to 1.4.1 it seems to work well.

@mariusnauj
Copy link

Never mind, I was running an old version. After upgrading to 1.4.1 it seems to work well.

What version of HA, and what type of integration?

@mimusato
Copy link

mimusato commented Jan 5, 2025

#What version of HA, and what type of integration?#

HA version 2025.1.0. Using integration via inverter wi-fi.

@0x442E472E
Copy link

0x442E472E commented Jan 5, 2025

huawei_solar 1.5.0b1 seems to work great for me with HA 2025.1.0! Thank you, @wlcrs :)

Edit: Ok, sadly it doesn't. This integration works now, but my own modbus sensors do not.

@Criaga
Copy link

Criaga commented Jan 5, 2025

Good evening, sorry but you have to be patient 😅
I read that it works for some and for others it doesn't.
I'm connected via the Dongle's IP and I would like to know if I can update to version 2025.1
Thk

@Barbarul
Copy link

Barbarul commented Jan 5, 2025

Yes, i downgrade core as well without restore a backup. ha core update --version 2024.12.5

Rolled back with your command, and not it works fine. I will skip this core version.

@ThomDietrich
Copy link

Thanks for all your work on this component! 🎉

To contribute and for potential troubleshooting. I am on HA 2025.01 and using the latest 1.5.0b2, this is the error I am faced with:

Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.pdu.register_message'

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 1035, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1015, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, 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.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/huawei_solar/__init__.py", line 21, in <module>
    from huawei_solar import (
    ...<9 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/__init__.py", line 4, in <module>
    from .bridge import (
    ...<6 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 34, in <module>
    from .huawei_solar import (
    ...<5 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 20, in <module>
    from pymodbus.pdu.register_message import (
    ...<2 lines>...
    )
ModuleNotFoundError: No module named 'pymodbus.pdu.register_message'

@mariusnauj
Copy link

After upgrading HA to 2025.1.1 integration not working:

Setup failed for custom integration 'huawei_solar': Unable to import component: cannot import name 'ModbusRequest' from 'pymodbus.pdu' (/usr/local/lib/python3.13/site-packages/pymodbus/pdu/init.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1015, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._get_component, True
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, 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.13/importlib/init.py", line 88, 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 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/huawei_solar/init.py", line 20, in
from huawei_solar import (
...<4 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/init.py", line 3, in
from .bridge import HuaweiSolarBridge
File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 28, in
from .huawei_solar import (
...<5 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 17, in
from pymodbus.message.rtu import MessageRTU
File "/usr/local/lib/python3.13/site-packages/pymodbus/message/init.py", line 7, in
from pymodbus.message.message import Message, MessageType
File "/usr/local/lib/python3.13/site-packages/pymodbus/message/message.py", line 15, in
from pymodbus.message.rtu import MessageRTU
File "/usr/local/lib/python3.13/site-packages/pymodbus/message/rtu.py", line 12, in
from pymodbus.factory import ClientDecoder
File "/usr/local/lib/python3.13/site-packages/pymodbus/factory.py", line 15, in
from pymodbus import bit_read_message as bit_r_msg
File "/usr/local/lib/python3.13/site-packages/pymodbus/bit_read_message.py", line 15, in
from pymodbus.pdu import ModbusRequest, ModbusResponse
ImportError: cannot import name 'ModbusRequest' from 'pymodbus.pdu' (/usr/local/lib/python3.13/site-packages/pymodbus/pdu/init.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 1035, in async_get_component
self._component_future.result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
comp = self._get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, 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.13/importlib/init.py", line 88, 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 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/huawei_solar/init.py", line 20, in
from huawei_solar import (
...<4 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/init.py", line 3, in
from .bridge import HuaweiSolarBridge
File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 28, in
from .huawei_solar import (
...<5 lines>...
)
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 17, in
from pymodbus.message.rtu import MessageRTU
File "/usr/local/lib/python3.13/site-packages/pymodbus/message/init.py", line 7, in
from pymodbus.message.message import Message, MessageType
File "/usr/local/lib/python3.13/site-packages/pymodbus/message/message.py", line 15, in
from pymodbus.message.rtu import MessageRTU
File "/usr/local/lib/python3.13/site-packages/pymodbus/message/rtu.py", line 12, in
from pymodbus.factory import ClientDecoder
File "/usr/local/lib/python3.13/site-packages/pymodbus/factory.py", line 15, in
from pymodbus import bit_read_message as bit_r_msg
File "/usr/local/lib/python3.13/site-packages/pymodbus/bit_read_message.py", line 15, in
from pymodbus.pdu import ModbusRequest, ModbusResponse
ImportError: cannot import name 'ModbusRequest' from 'pymodbus.pdu' (/usr/local/lib/python3.13/site-packages/pymodbus/pdu/init.py)

@mariusnauj
Copy link

I am using native pymodbus integration for my Komfovent device. SO after installed 2025.1.1 Huawei integration stop working

@m3rsok3
Copy link

m3rsok3 commented Jan 7, 2025

I suppose there will be a update so it works woth 2025 core soon?

@luzik
Copy link

luzik commented Jan 8, 2025

PR has been merged, new HA dev image has been build, but it still messing with modbus integration:

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/modbus/sensor.py", line 114, in async_update
    raw_result = await self._hub.async_pb_call(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._slave, self._address, self._count, self._input_type
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/modbus/modbus.py", line 409, in async_pb_call
    result = await self.low_level_pb_call(unit, address, value, use_call)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/modbus/modbus.py", line 374, in low_level_pb_call
    result: ModbusPDU = await entry.func(address, value, **kwargs)
                              ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ModbusClientMixin.read_input_registers() takes 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given

@JavanXD
Copy link

JavanXD commented Jan 10, 2025

Users that use the native modbus-integration alongside this integration should not upgrade to Home Assistant 2025.1, as it contains an upgrade to an incompatible version 3.7.4 of the pyModbus library. Significant work has already been done to upgrade this integration to support v3.8.0 of this library. We expect this to release alongside Home Assistant 2025.2, which is expected to also upgrade to that latest pyModbus version. This will solve the compatibility issue.

looks like we have to wait and downgrade first

@ThomDietrich
Copy link

Maybe someone can help me here. I did downgrade to 2024.12.5, now I am seeing this new issue:

Logger: homeassistant.setup
Quelle: setup.py:334
Erstmals aufgetreten: 11:14:18 (1 Vorkommnisse)
Zuletzt protokolliert: 11:14:18

Setup failed for custom integration 'huawei_solar': Unable to import component: cannot import name 'FramerRTU' from 'pymodbus.framer' (/usr/local/lib/python3.13/site-packages/pymodbus/framer/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1014, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, 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.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/huawei_solar/__init__.py", line 21, in <module>
    from huawei_solar import (
    ...<9 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/__init__.py", line 4, in <module>
    from .bridge import (
    ...<6 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 34, in <module>
    from .huawei_solar import (
    ...<5 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 18, in <module>
    from pymodbus.framer import FramerRTU
ImportError: cannot import name 'FramerRTU' from 'pymodbus.framer' (/usr/local/lib/python3.13/site-packages/pymodbus/framer/__init__.py). Did you mean: 'Framer'?

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 1034, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1026, in async_get_component
    comp = self._get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, 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.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/huawei_solar/__init__.py", line 21, in <module>
    from huawei_solar import (
    ...<9 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/__init__.py", line 4, in <module>
    from .bridge import (
    ...<6 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 34, in <module>
    from .huawei_solar import (
    ...<5 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 18, in <module>
    from pymodbus.framer import FramerRTU
ImportError: cannot import name 'FramerRTU' from 'pymodbus.framer' (/usr/local/lib/python3.13/site-packages/pymodbus/framer/__init__.py). Did you mean: 'Framer'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests