Modbus RTU dimmer, write multiple registers

I have no experience with modbus, I’m just looking at the documentation.
For consecutive registers, this should work:

modbus.write_register: Write register or registers
value: (write_register) A single value or an array of 16-bit values. Single value will call modbus function code 0x06. Array will call modbus function code 0x10. Values might need reverse ordering. E.g., to set 0x0004 you might need to set [4,0], this depend on the byte order of your CPU
Modbus - Home Assistant

If that doesn’t work, you can specify multiple service calls for your template light.

...
     set_level:
        - service: modbus.write_register
          data_template:
            hub: "hub1"
            unit: 5
            address: 3
            value: 250

        - service: modbus.write_register
          data_template:
            hub: "hub1"
            unit: 5
            address: 4
            value: "{{ brightness }}"