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

Updating to 2025.1.0b2 makes loading the integration impossible. #176

Closed
daemonenstall opened this issue Dec 25, 2024 · 8 comments
Closed

Comments

@daemonenstall
Copy link

Version of the custom_component

v0.9.1

Describe the bug

Setup failed for custom integration 'idm_heatpump': Unable to import component: No module named 'pymodbus.register_read_message'

Debug log


Logger: homeassistant.setup
Quelle: setup.py:334
Erstmals aufgetreten: 13:12:37 (1 Vorkommnisse)
Zuletzt protokolliert: 13:12:37

Setup failed for custom integration 'idm_heatpump': Unable to import component: No module named 'pymodbus.register_read_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/idm_heatpump/__init__.py", line 33, in <module>
    from .coordinator import IdmHeatpumpDataUpdateCoordinator
  File "/config/custom_components/idm_heatpump/coordinator.py", line 11, in <module>
    from .idm_heatpump import IdmHeatpump
  File "/config/custom_components/idm_heatpump/idm_heatpump.py", line 12, in <module>
    from pymodbus.register_read_message import ReadInputRegistersResponse
ModuleNotFoundError: No module named 'pymodbus.register_read_message'

@daemonenstall
Copy link
Author

Ok, the hass-victron integration has the same problem.
sfstar/hass-victron#263

@kodebach
Copy link
Owner

kodebach commented Jan 4, 2025

I'll look into this on Monday, but it probably is just a mismatch in the pymodbus version. Sadly pymodbus often introduces breaking changes so custom integrations need to closely match the version they depend on to the version the main Home Assistant uses.

@mhonicat
Copy link

mhonicat commented Jan 6, 2025

Running HA in docker, so maybe on a different plattform that might not work:

As a quick fix i bumped pymodbus to 3.8.3 manually and changed the following module in idm_heatpump.py

- from pymodbus.register_read_message import ReadInputRegistersResponse
+ from pymodbus.pdu.register_message import ReadInputRegistersResponse

This seems to be working, but no idea if it might break something else. As far as i can see everything works as expected (for me).

@kodebach
Copy link
Owner

kodebach commented Jan 6, 2025

Thanks for the hint @mhonicat the small change would've been enough, but because of changes in pymodbus that would have lead to loads of deprecation warnings in the Home Assistant logs. The issue is fixed on master and I will create a proper release ASAP.

@daemonenstall
Copy link
Author

Thanks for the new release! Unfortunately the link that HACS is trying to download does not work.
HACS is trying to download this
https://github.com/kodebach/hacs-idm-heatpump/releases/download/v0.10.0/idm_heatpump.zip
but the link under releases is
https://github.com/kodebach/hacs-idm-heatpump/archive/refs/tags/v0.10.0.zip
I think this happened also in the past.

@kodebach
Copy link
Owner

kodebach commented Jan 6, 2025

The automated release job that builds the ZIP file failed. However, this time it was a third party issue softprops/action-gh-release#556. Please use v0.10.1

@daemonenstall
Copy link
Author

I can confirm that 0.10.1 works flawless. At this point it's time to say thank you for the integration! :)

@HoBPirE
Copy link

HoBPirE commented Jan 7, 2025

@kodebach

Unfortunately it is still not working on my side.

integration version: v0.10.1
HA Core: 2025.1.0

Fault message:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants