Skip to content

Venusos beta 3.70~34 breaks integration - modbus communication fails "invalid argument" #375

@RobMeerwijk

Description

@RobMeerwijk

The problem

When using venusos beta 3.70~34 of 3.70~35 modbus-communication is no longer possible. Other applications still can access venusos with no problems.

Environment

  • Home Assistant Core release with the issue: 2025.9.2
  • Last working Home Assistant Core release (if known): 2025.9.2
  • Integration version causing this issue: victron

Problem-relevant configuration dialog

Traceback/Error logs

Deze fout is ontstaan door een aangepaste integratie.

Logger: pymodbus.logging
Bron: custom_components/victron/hub.py:88
integratie: victron (documentatie, problemen)
Eerst voorgekomen: 12:34:36 (45 gebeurtenissen)
Laatst gelogd: 12:47:23

Repeating....
Connection to (venus.local, 502) failed: [Errno 22] Invalid argument
Connection to (venus.local, 502) failed: [Errno -5] Name has no usable address


Logger: pymodbus.logging
Bron: custom_components/victron/hub.py:72
integratie: victron (documentatie, problemen)
Eerst voorgekomen: 12:34:36 (49 gebeurtenissen)
Laatst gelogd: 12:47:23

Connection to (venus.local, 502) failed: [Errno 22] Invalid argument
Connection to (venus.local, 502) failed: [Errno 111] Connection refused
Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.victron.coordinator
Bron: helpers/update_coordinator.py:392
integratie: victron (documentatie, problemen)
Eerst voorgekomen: 12:34:36 (45 gebeurtenissen)
Laatst gelogd: 12:47:23

Unexpected error fetching victron data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 392, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/victron/coordinator.py", line 77, in _async_update_data
    data = await self.fetch_registers(unit, register_info_dict[name])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/victron/coordinator.py", line 179, in fetch_registers
    return await self.hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.api_update, unit, registerData
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/victron/coordinator.py", line 204, in api_update
    return self.api.read_holding_registers(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        unit=unit,
        ^^^^^^^^^^
        address=self.api.get_first_register_id(registerInfo),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        count=self.api.calculate_register_count(registerInfo),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/victron/hub.py", line 88, in read_holding_registers
    return self._client.read_holding_registers(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        address=address, count=count, device_id=slave
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pymodbus/client/mixin.py", line 113, in read_holding_registers
    return self.execute(no_response_expected, pdu_reg.ReadHoldingRegistersRequest(address=address, count=count, dev_id=device_id))
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pymodbus/client/base.py", line 201, in execute
    raise ConnectionException(f"Failed to connect[{self!s}]")
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient venus.local:502]

In case of unit ID issue, missing devices or non-updating devices

Additional information

I checked if venus os modbus port 502 was available from homeassistant, and it was.
I checked my other apps that connect to victron via modbus, and those were still ok

I went back to official release 3.66 and everything is fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfixInconsistencies or issues which will cause a problem for users or implementors.staleThere has not been activity on this issue or PR for quite some time.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions