Problem core2023.10.x with modbus float. float not accepted since core2023.10.x

Hello,
I am using the SDM530 (predecessor of SDM630) with an USB to RS485 dongle and this worked fine for 9 months. The new core2023.10.x gave some trouble with the modbus and now I want to use a TCP unit instead (Protoss HE11). I wrote a C# program and the HE11 works fine. Wrote the program to make sure that everything is connected in the right way.

Power is negative due to the solar panels. So that’s right.
This lines are in my configuration.yaml:

# modbus communication
modbus:    #line 49 which gives an error
  - name: "sdm530"
    close_comm_on_error: true
    delay: 5
    type: rtuovertcp
    host: 192.168.1.145
    port: 502
    sensors:
      - name: sdm530_phase_1_line_to_neutral_volts
        slave: 1
        address: 0
        input_type: input
        count: 2
        precision: 2
        data_type: float
        unit_of_measurement: V
        device_class: voltage
        scan_interval: 30

I get this error:

Invalid config for [modbus]: value must be one of [<DataType.CUSTOM: 'custom'>, <DataType.FLOAT16: 'float16'>, <DataType.FLOAT32: 'float32'>, <DataType.FLOAT64: 'float64'>, <DataType.INT16: 'int16'>, <DataType.INT32: 'int32'>, <DataType.INT64: 'int64'>, <DataType.INT8: 'int8'>, <DataType.STRING: 'string'>, <DataType.UINT16: 'uint16'>, <DataType.UINT32: 'uint32'>, <DataType.UINT64: 'uint64'>, <DataType.UINT8: 'uint8'>] for dictionary value @ data['modbus'][0]['sensors'][0]['data_type']. Got 'float'. (See /config/configuration.yaml, line 49). 

when I update float to float32 I still get an error:

Invalid config for [modbus]: sdm630_phase_1_line_to_neutral_volts: `count: 2` cannot be combined with `data_type: float32` @ data['modbus'][0]['sensors'][0]. Got {'name': 'sdm630_phase_1_line_to_neutral_volts', 'slave': 1, 'address': 0, 'input_type': 'input', 'count': 2, 'precision': 2, 'data_type': 'float32', 'unit_of_measurement': 'V', 'device_class': 'voltage', 'scan_interval': 30}. (See /config/configuration.yaml, line 49).

I wrote the C# program and 2 word/short values are equal to 2 * 2 bytes = 4 bytes = 32bits, so a float32 should be fine.
It seems that “float” is not accepted anymore since core2023.10.x. It was still accepted in release 2023.9.3 Why? Did I do something wrong? Do I have to downgrade to core2023.9.3 to make it work again? Or is float still accepted (because of the “modbus:” line error?)? What is wrong?
Thanks for your reply.

Kind regards,
Erik

Just remove the “count: 2” line

Thank you for the fast reply. The removal of “count: 2” certainly helps.
But there is still no communication with the Modbus TCP:

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:355
Integration: Modbus (documentation, issues)
First occurred: 17:04:16 (1 occurrences)
Last logged: 17:04:16

Pymodbus: sdm530: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 4 bytes (0 received)

And my program receives data on that exact port and ip number. I have changed the type: rtuovertcp to type: tcp. Both don’t work. Very annoying.

I finally got it working. I sometimes miss the first register I am trying to retrieve. I need to know register 12 (power ph1), 14 (power ph2) and 16 (power ph3). power ph1 fails sometimes. the modbus request is probably doing all registers at once and since the first fails sometimes, so I request also the register before the register I really need (power ph1). That is register 10. Phase 3 current. So I request register 10, 12, 14 and 16. I know register 10 will fail sometime, but who cares. Don’t need register 10 at all. Maybe not the most elegant solution, but it works. Problem solved!

# modbus communication
modbus:
  - name: "pe11tcp"
    type: tcp
#    message_wait_milliseconds: 30
#    timeout: 15
#    delay: 1
    retries: 50
#    retry_on_empty: true    
    host: 192.168.1.145
    port: 502
    sensors:
#First register may fail. Don't need this register    
      - name: SDM530_1_Ph3_Current
        slave: 1
        address: 10
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: W
        device_class: power
        scan_interval: 10        
      - name: SDM530_1_Ph1_Power
        slave: 1
        address: 12
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: W
        device_class: power
        scan_interval: 10
      - name: SDM530_1_Ph2_Power
        slave: 1
        address: 14
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: W
        device_class: power
        scan_interval: 10
      - name: SDM530_1_Ph3_Power
        slave: 1
        address: 16
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: W
        device_class: power
        scan_interval: 10
#First register may fail. Don't need this register
      - name: SDM530_1_Who_Cares
        slave: 1
        address: 50
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: W
        device_class: power
        scan_interval: 10
      - name: SDM530_1_Total_System_Power
        slave: 1
        address: 52
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: W
        device_class: power
        scan_interval: 10
#First register may fail. Don't need this register        
      - name: SDM530_1_Frequency
        slave: 1
        address: 70
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: Hz
        device_class: frequency
        state_class: total_increasing
        scan_interval: 300
      - name: SDM530_1_Import_Power
        slave: 1
        address: 72
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scan_interval: 300
      - name: SDM530_1_Export_Power
        slave: 1
        address: 74
        input_type: input
        precision: 2
        data_type: float32
        unit_of_measurement: kWh    
        device_class: energy
        state_class: total_increasing
        scan_interval: 300

I know the problem, but I don’t know how to fix it without getting that dummy register. This is the problem:

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:355
Integration: Modbus (documentation, issues)
First occurred: 07:46:53 (103 occurrences)
Last logged: 08:03:54

Pymodbus: pe11tcp: Modbus Error: [Connection] ModbusTcpClient(192.168.1.145:502): Connection unexpectedly closed 0.00011730194091796875 seconds into read of 8 bytes without response from slave before it closed connection
Pymodbus: pe11tcp: Modbus Error: [Connection] ModbusTcpClient(192.168.1.145:502): Connection unexpectedly closed 0.00014090538024902344 seconds into read of 8 bytes without response from slave before it closed connection
Pymodbus: pe11tcp: Modbus Error: [Connection] ModbusTcpClient(192.168.1.145:502): Connection unexpectedly closed 0.00012564659118652344 seconds into read of 8 bytes without response from slave before it closed connection
Pymodbus: pe11tcp: Modbus Error: [Connection] ModbusTcpClient(192.168.1.145:502): Connection unexpectedly closed 0.0001270771026611328 seconds into read of 8 bytes without response from slave before it closed connection
Pymodbus: pe11tcp: Modbus Error: [Connection] ModbusTcpClient(192.168.1.145:502): Connection unexpectedly closed 0.0001354217529296875 seconds into read of 8 bytes without response from slave before it closed connection

Connection is closed before a reply is given. That why I need to call that dummy register probably. I don’t know why. I an using a Protoss HE11. Ethernet to RS485/Modbus adapter

The last message about protoss HE11 and home assistant. There was a problem with the communication. Connecting was lost between transfers. I discovered that the settings of the HE11 where the cause of the communication failure. So no need to get extra registers to bypass the communication failure. Just use the settings below. Also use the standard port settings (8899).
These are the settings I use for the modbus without any problems…