MODBUS is connecting, but not polling

I want to connect my SDM-230 power meter via MODBUS to HA, so I wrote a MODBUS/IP to MODBUS-RTU gateway for my home control units in the cabinet. The gateway works fine when I test it with MODBUS POLL, and I’m getting the requested values from the meter.

Unfortunately I have an issue with HA, which opens the TCP connection but never sends any polling.

In my configuration.yaml:

# MODBUS Power Meter
modbus:
  - name: powermeter1
    timeout: 2
    message_wait_milliseconds: 50
    type: tcp
    host: 10.1.2.1
    port: 502

… and further down in the sensors section:

# Sensoren
sensor:
[...]
  - platform: modbus
    sensors:
      - name: volt_l1
        unit_of_measurement: Volts
        scan_interval: 5
        slave: 1
        address: 0
        register_type: input
        data_type: float32
        precision: 2

When I start HA, my gateway debug output shows that HA opens the TCP connection as configured:

2022/08/08 20:35:42  [0200] <- | 08.08.22 20:35:41  01:59:38.25 | TCP server connection request on connection 1 QID 0201 
2022/08/08 20:35:42  [0200] <- | 08.08.22 20:35:41  01:59:38.25 | Established as subconnection 1 QID 0201 
2022/08/08 20:35:42  [0201] <- | 08.08.22 20:35:41  01:59:38.25  MID:32CC| QNR:001 SUB:0001 OPT:0101 OPT2:0000 ADR:167837963 PORT:43567  FID:0000 FSUB:0 FOPT:0000 FOPT2:0000 FADR:0 FPORT:0  LEN:0
2022/08/08 20:35:42  [0201] <- | 08.08.22 20:35:41  01:59:38.26 | MODBUS IP connection #1 established from 10.1.1.11

But there is no polling at all :unamused:

I have configured scan_interval to 5 seconds, but nothing happens.

Any ideas?

  count: 2

Edit:

That is old yaml format.

Now modbus sensors are inside modbus:

modbus:

  - name: edpbox1
    type: tcp
    host: 10.1.0.47
    port: 9502
    delay: 1
    timeout: 3
    retries: 3
    retry_on_empty: true
    message_wait_milliseconds: 250

    sensors:

### ### ###

      - name: "EB1 T1 Vazio" # 0x0026
        slave: 1
        address: 38
        input_type: input
        count: 1
        data_type: uint32
        precision: 1
        scale: 0.001
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scan_interval: 91
1 Like

Have you got the data type & input type in your sensor?

     - name: Planter 2 Temperature
       unit_of_measurement: C
       slave: 52
       address: 0
       input_type: holding
       data_type: int16
       scale: 0.01
       precision: 1
       scan_interval: 60