MODBUS - multiple holding register writing via automation

Hi.

I’m trying to save a multiple register through automation.
I wanted to modify the automation described in this thread that I already know well and have used successfully in other cases.:

https://community.home-assistant.io/t/how-to-link-an-input-select-list-to-from-a-modbus-list-of-integers/446437/20?page=2

unfortunately, this time it’s about input.number and not input.select in the multiple register.

I created the input.number helper, then I modified the automation from the mentioned thread, which looks like this:

alias: deye system_mode_soc_time1
description: "DEYE poziom baterii okres 1"
triggers:
  - trigger: state
    entity_id:
      - sensor.system_mode_soc_time1
    id: input
    to: null
  - trigger: state
    entity_id:
      - input_number.system_mode_soc_time_1
    id: select
    to: null
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: input
        sequence:
          - variables:
              value: >-
                {{ (states('input_number.system_mode_soc_time_1'))  }}
          - action: input_select.select_option
            target:
              entity_id: input_number.system_mode_soc_time_1
            data:
              option: "{{ values.get(trigger.to_state.state) }}"
      - conditions:
          - condition: trigger
            id: select
        sequence:
          - action: modbus.write_register
            data:
              address: 166
#              use_write_multiple: true
              slave: 1
              hub: deye
              value: >-
                {{ trigger.to_state.state[0] | int(0)  }}
mode: single

unfortunately, if I set the number in the helper to, for example, 95, only the first digit, i.e. 9, is saved to the multiple register.

params:
  domain: modbus
  service: write_register
  service_data:
    address: 166
    slave: 1
    hub: deye
    value: 9
  target: {}
running_script: false

In the case of a switch configuration, it is possible to save .:

write_type: holdings

in the case of automation using a service, it is not possible.
Is there any advice for this?.

Update.:

After intensive searching I managed to find a thread where I found a solution to my problem.:

https://community.home-assistant.io/t/modbus-switch-write-specific-bit-in-holding-register/363580/6

Currently, this is what the automation that works in my case looks like after appropriate modification.:

id: 'acc1b5a0-ec70-4500-9011-b4ab3f6d0f9a'
alias: 'deye system_mode_soc_time1_update'
description: "DEYE aktualizacja poziom baterii okres 1"
initial_state: on
trigger:
  - trigger: state
    entity_id: sensor.system_mode_soc_time1
condition: []
action:
  - action: input_number.set_value
    target:
      entity_id: input_number.system_mode_soc_time_1
    data:
      value: "{{ trigger.to_state.state | int(0)  }}"


id: "adb78a66-27fb-4032-88ae-94723a11d8e1"
alias: deye system_mode_soc_time1
description: "DEYE poziom baterii okres 1"
initial_state: on
trigger:
  - trigger: state
    entity_id: input_number.system_mode_soc_time_1
condition: []
action:
  - action: modbus.write_register
    data:
      hub: deye
      unit: 1
      address: 166
      value: >-
        [{{ trigger.to_state.state | int(default=30) }}]
  - action: homeassistant.update_entity
    data:
      entity_id: sensor.system_mode_soc_time1