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.:
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?.