Modbus Home Assistant 2024.3.3 not working at all

I have been trying to get modbus working on HA 2024.3.3 but it doesn’t seem to do anything except giving an error:

Logger: pymodbus.logging
Source: components/modbus/modbus.py:448
First occurred: 8:39:11 PM (47 occurrences)
Last logged: 8:50:38 PM

Connection to (010.010.010.014, 502) failed: timed out

It’s not even trying to make a connection when I monitor the connection from a monitor port with Wireshark. What I at least expect to see is some traffic to the modbus slave device from the TCP handshake.

I tried several configurations, but nothing works really, not even when I simulate a modbus client from a modbus slave.

The slave is working and 100% (see QModMaster who is connected) reachable from the HA server.

This is my test config:

image

modbus:

  • name: pyModSlave
    type: tcp
    host: 010.010.010.014
    port: 502
    sensors:
    • name: test
      unit_of_measurement: V
      slave: 1
      address: 2
      input_type: input
      data_type: uint16
      scale: 0.1
      precision: 2
      device_class: voltage

Please help.

A Tip - when you post code to the forum you need to post it as ‘preformatted text’ please (Use the’</>’ button in the editor above).

HA 2024.3.3 Modbus is still working for me.

modbus:

  - name: pyModSlave
    type: tcp
    host: 010.010.010.014
    port: 502

    sensors:
      - name: test
        unit_of_measurement: V
        slave: 1
        address: 2
        input_type: input
        data_type: uint16
        scale: 0.1
        precision: 2
        device_class: voltage
1 Like

Thanks for the tip, I will use the </> button next time.

Can you connect to a PyModSlave modbus client with the follow settings from you HA server?:

https://sourceforge.net/projects/pymodslave/

Ofcourse you’ll need to modify your IP adres to your own subnet.

Can you please test with the following code (change IP):

modbus:

  - name: pyModSlave
    type: tcp
    host: 010.010.010.014
    port: 502

    sensors:
      - name: test
        unit_of_measurement: V
        slave: 1
        address: 2
        input_type: input
        data_type: uint16
        scale: 0.1
        precision: 2
        device_class: voltage

Can you read register 2 from the integrations pane?

It appears to me your problem may lie with the connection?

Have you tried using: 10.10.10.14 for the IP instead of 010.010.010.014? That failed to connect “First occurred: 8:39:11 PM (47 occurrences)” so that seems to be your problem to me atm?

Worth checking/eliminating in any case don’t you think?

Your config looks fine to me otherwise.

PS: Did this just stop working with HA 2024.3.3? Or are just setting it up under HA 2024.3.3?