Modbus configuration broken after update to 2024.4.1

Good day,

My HA was working perfectly fine and using all my modbus sensors daily. I then updated to 2024.4.1 and then all my modbus sensors stopped working.

If I check the debug menu, I get this:

Here is my modbus.yaml file (I haven not edited this in months):

# cat modbus.yaml
# configuration entry for a TCP connection
# com.victronenergy.grid    slave: 30
# com.victronenergy.system  slave: 100
# com.victronenergy.battery slave: 225

# system :
- name: victron
  retry_on_empty: true
  retries: 5
  type: tcp
  host: 192.168.1.9
  port: 502
  # REMARK: scan_interval: <5 can cause troubles
  sensors:
    # Upstream AC Consumption
    # - name: "AC Consumption L1"
    #   unit_of_measurement: "W"
    #   slave: 100
    #   address: 817
    #   data_type: uint16
    #   scan_interval: 3
    #   device_class: power

    # L1 Grid power
    - name: "Multiplus Grid power"
      unit_of_measurement: "W"
      slave: 100
      address: 820
      data_type: int16
      scan_interval: 5
      device_class: power

any ideas what could be causing these issues?

2 Likes

Hi,

What was the last working HA release?
Anything in the log?
Did you check the documentation?

Retry_on_empty is not a valid configuration. Remove it and retry.

I have the same issue with type: tcp as an invalid value.
Especially line 4 and line 9 is weird and seems very broken.

Invalid config for 'modbus' at modbus.yaml, line 3: required key 'bytesize' not provided, please check the docs at https://www.home-assistant.io/integrations/modbus
Invalid config for 'modbus' at modbus.yaml, line 3: required key 'method' not provided, please check the docs at https://www.home-assistant.io/integrations/modbus
Invalid config for 'modbus' at modbus.yaml, line 3: required key 'parity' not provided, please check the docs at https://www.home-assistant.io/integrations/modbus
Invalid config for 'modbus' at modbus.yaml, line 3: required key 'stopbits' not provided, please check the docs at https://www.home-assistant.io/integrations/modbus
Invalid config for 'modbus' at modbus.yaml, line 4: not a valid value for dictionary value 'modbus->0->type', got 'tcp', please check the docs at https://www.home-assistant.io/integrations/modbus
Invalid config for 'modbus' at modbus.yaml, line 5: 'close_comm_on_error' is an invalid option for 'modbus', check: modbus->0->close_comm_on_error, please check the docs at https://www.home-assistant.io/integrations/modbus
Invalid config for 'modbus' at modbus.yaml, line 9: 'host' is an invalid option for 'modbus', check: modbus->0->host, please check the docs at https://www.home-assistant.io/integrations/modbus
2024-04-12 15:15:58.725 ERROR (MainThread) [homeassistant.setup] Setup failed for 'modbus': Invalid config.

Has anyone upgraded to 2024.4.3 and can confirm if it was fixed?

Not fixed. I saw that it should be fixed in 2024.4.5 at best, so hold off for now.

1 Like

Okay thanks for the info

I just tied 2024.5.0 just now and the problem still persists!

Is there any reference to git that would indicate that it gets fixed in a future release?

There has been a new issue opened in git related to this:

But there is also this older issue:

Yep. And still not solved on my end. Sometimes it works for a few days, sometimes a few hours. But the connection will always break.
I have been repeating this at length on GitHub, my connection via Modbus had been working rock solid for years. With upgrade to 2024.4 things broke. No Hardware change, no firmware change on the SMA, no network change. The only thing was the upgrade to 2024.4, hence why I’m looking for the issue there.

Was thinking to bring this to SMA as well, but it seems there are issues with other devices too.