core: Modbus problem in 2024.4.0 and 2024.4.1

The problem

After core update to 2024.4.0 Modbus fails to read data.

What version of Home Assistant Core has the issue?

2024.4.0 and 2024.4.1

What was the last working version of Home Assistant Core?

2024.3.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

komfovent.yaml

Link to integration documentation on our website

No response

Diagnostics information

modbus.log

Example YAML snippet

modbus:
  - name: komfovent
    type: tcp
    host: 192.168.168.6
    port: 502
    message_wait_milliseconds: 30

    switches:
      - name: "Komfovent Eco Mode"
        address: 2
        command_on: 1
        command_off: 0
        verify:

    sensors:
      - name: "Komfovent Power"
        address: 0
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Komfovent Eco"
        address: 2
        input_type: holding
        data_type: uint16
        scan_interval: 30
      - name: "Komfovent Auto"
        address: 3
        input_type: holding
        data_type: uint16
        scan_interval: 30
      - name: "Komfovent Mode"
        address: 4
        input_type: holding
        data_type: uint16
        scan_interval: 30
      - name: "Komfovent Status bit mask"
        address: 899
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Komfovent Supply temperature 'C"
        address: 901
        input_type: holding
        data_type: int16
        scan_interval: 10
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
        device_class: temperature
        state_class: measurement
      - name: "Komfovent Extract temperature 'C"
        address: 902
        input_type: holding
        data_type: int16
        scan_interval: 10
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
        device_class: temperature
        state_class: measurement
      - name: "Komfovent Outdoor temperature 'C"
        address: 903
        input_type: holding
        data_type: int16
        scan_interval: 10
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
        device_class: temperature
        state_class: measurement
      - name: "Komfovent Supply Fan Intensivity '%"
        address: 909
        input_type: holding
        data_type: uint16
        scan_interval: 30
        unit_of_measurement: '%'
        scale: 0.1
        precision: 1
        state_class: measurement
      - name: "Komfovent Extract Fan Intensivity '%"
        address: 910
        input_type: holding
        data_type: uint16
        scan_interval: 30
        unit_of_measurement: '%'
        scale: 0.1
        precision: 1
        state_class: measurement
      - name: "Komfovent Heat exchanger, %"
        address: 911
        input_type: holding
        data_type: uint16
        scan_interval: 30
        unit_of_measurement: '%'
        scale: 0.1
        precision: 0
        state_class: measurement
      - name: "Komfovent Electric Heater %"
        address: 912
        data_type: uint16
        input_type: holding
        scale: 0.1
        precision: 1
        unit_of_measurement: '%'
        state_class: measurement
        scan_interval: 30
      - name: "Komfovent Filter Impurity, %"
        address: 916
        input_type: holding
        data_type: uint16
        scan_interval: 100
        unit_of_measurement: '%'
        state_class: measurement
      - name: "Komfovent Power consumption, W"
        address: 920
        input_type: holding
        data_type: uint16
        scan_interval: 30
        unit_of_measurement: W
        device_class: power
        state_class: measurement
      - name: "Komfovent Heating power, W"
        address: 921
        input_type: holding
        data_type: uint16
        scan_interval: 30
        unit_of_measurement: W
        device_class: power
        state_class: measurement
      - name: "Komfovent Heat Recovery, W"
        address: 922
        input_type: holding
        data_type: uint16
        scan_interval: 10
        unit_of_measurement: W
        device_class: power
        state_class: measurement
      - name: "Komfovent Heat exchanger efficiency, %"
        address: 923
        input_type: holding
        data_type: uint16
        scan_interval: 10
        scale: 1
        precision: 0
        unit_of_measurement: '%'
        state_class: measurement
      - name: "Komfovent Energy saving, %"
        address: 924
        input_type: holding
        data_type: uint16
        scan_interval: 10
        unit_of_measurement: '%'
        state_class: measurement
      - name: "Komfovent Power consumption Month, kWh"
        address: 928
        input_type: holding
        data_type: uint32
        scan_interval: 30
        unit_of_measurement: kWh
        precision: 0
        scale: 0.001
        device_class: energy
      - name: "Komfovent Power consumption Total, kWh"
        address: 930
        input_type: holding
        data_type: uint32
        scan_interval: 30
        unit_of_measurement: kWh
        precision: 0
        scale: 0.001
        state_class: total_increasing
        device_class: energy
      - name: "Komfovent Heating Recovery Month, kWh"
        address: 940
        input_type: holding
        data_type: uint32
        scan_interval: 30
        unit_of_measurement: kWh
        precision: 0
        scale: 0.001
        device_class: energy

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (13 by maintainers)

Most upvoted comments

Not sure if you’re trying to drag the actual #MeToo movement through the mud here, but these are just desperate users whose setups broke. Perhaps due to a change that was only listed in the “full changelog” (which probably nobody reads), wasn’t part of the blog post change log (which they might have read), and wasn’t listed under the “backwards-incompatible changes”. (Home Assistant does not have “breaking changes” anymore). Even if they had read it, and seen that particular change, how would that have helped them or anyone else? They did the obvious thing and rolled back to a working version and added their comment to underline that this doesn’t affect just one user.

@rostislav-palivoda There is no toggle, you can only downgrade to 2024.3.

Does this change to async library calls affect ordering and/or pacing of Modbus requests at all? There are various vendors who use very fickle Modbus implementations that can be broken just by making overlapping requests or multiple connections (looking at for example Sungrow and SolarEdge). I’d guess no, but guessing doesn’t really help here. 😉

Me Too. Only Rollback to 2024.3.3 solved IT !

the “not ready frame” will cause setting the entity to unavialable, I am still looking into why it happens.

Funny thing is that between 2024.3.3 and 2024.4.0 pymodbus is unchanged, what changed basically is that the transport level is not async, but decoding of the modbus packages etc are the same. So somewhere within that change set is something that do not work correctly.

Analyzed and isolated modbus problems

The analysis is added to https://github.com/home-assistant/core/issues/115236, which you can follow to see the progress, but PLEASE do not comment there, as it only makes it more difficult to solve the problems.

Closing issue, Bug fixing will happen on https://github.com/home-assistant/core/issues/115236

Downgraded from 2024.4.2 to 2024.3.3. Modbus works.

Hi, I just want to mention that I encountered the exact same issue (most likely) with 2024.04 and my modbus configuration. Multiple restarts and other attempts did not fix it. Rollback to 2024.3.3 solved the issue instantly.

Maybe the “not ready frame” is part of reason why device is not responding… All my devices are up and no problems after the rollback to 2024.3.3.