Non-standard modbus registers size support

Just a small custom to add support for registers big than 2 bytes

# configuration.yaml

#logger:
#
#  logs:
#    homeassistant.components.modbus: debug
#    pymodbus.client: debug

# modbus-base.yaml

  - name: edpbox1
    type: tcp
    host: 10.1.0.53
    port: 8888
    timeout: 3
    delay: 1
  
    sensors:

      - name: "EB1 0x0001" # Clock
        slave: 1
        address: 1
        input_type: input
        count: 1
        data_type: custom
        register_size: 12
        structure: ">H7BhB"
        scan_interval: 5

      - name: "EB1 0x006C" # V/A
        slave: 1
        address: 108
        input_type: input
        count: 7
        data_type: custom
        register_size: 2
        structure: ">7H"
        scan_interval: 8

      - name: "EB1 0x0073" # Power
        slave: 1
        address: 115
        input_type: input
        count: 7
        data_type: custom
        register_size: 4
        structure: ">7L"
        scan_interval: 9

      - name: "EB1 0x007B" # PF
        slave: 1
        address: 123
        input_type: input
        count: 5
        data_type: custom
        register_size: 2
        structure: ">5H"
        scan_interval: 11

      - name: "EB1 0x0026" # TotEneTx
        slave: 1
        address: 38
        input_type: input
        count: 3
        data_type: custom
        register_size: 4
        structure: ">3L"
        scan_interval: 301

      - name: "EB1 0x0016" # TotEne I/E/Q
        slave: 1
        address: 22
        input_type: input
        count: 6
        data_type: custom
        register_size: 4
        structure: ">6L"
        scan_interval: 302

      - name: "EB1 0x000B" # Tariff
        slave: 1
        address: 11
        input_type: input
        count: 1
        data_type: custom
        register_size: 2
        structure: ">Bx"
        scan_interval: 31

Th thought that’s what the count option was for in the core integration?

Core only support 2 bytes registers (modbus standard).

My device have “count: 1” with “N” bytes.

Register 1 have 12 bytes for example

After 2021.8 we can use uint32

uint32 only work with Modbus TCP

RTU ou rtuovertcp not working for non-standard

pymodbus bug?