Modbus: modbus.write_register does not work

Hi, since I’m new in this community I’m not sure if this is the right place to ask for support.
However:
I try to control my ecar charging station (Schrack) via a Waveshare RS485 tcp to ETH device.
I can read the data such as “charging approval” or charging current, but I cant write the respective registers.
If I define these two registers as “switch” I’m able to change the values from “0” to “1”, also for the charging current, by turning the switch from “off” to “on”.
If they are defined as sensors, and I use the Modbus_write service, I finally a error message from logbook.

See here what I have defined (and most likely sorry for the wrong format, but where can I find the “preformatted text tool”, or “edit post toolbar” ?)

Modbus.yaml:

* name: Schrack_icharge_cion_hub
type: tcp
host: 192.168.2.118
port: 502
delay: 3

switches:
  * name: Ladefreigabe 100 switch # Erteilen (0: Laden nicht erlaubt; 1: Laden erlaubt)
address: 100
  * name: Ladestromvorgabe ecar 101 switch # Vorgabe als Schalter
address: 101sensors:
  * name: Ladefreigabe 100 # Lesen (0: Laden nicht erlaubt; 1: Laden erlaubt), wenn über MODBUS gesteuert wird
address: 100
input_type: holding
data_type: uint16
  * name: Ladestromvorgabe ecar 101 # Lesen des aktuellen Wertes der Ladestromvorgabe
address: 101
input_type: holding
data_type: uint16
device_class: current
unit_of_measurement: A

In a template I calculate the desired charging current and then want to write it to the charging station via an automation:

* id: "1741265909386"
alias: PV-excess_schedule_load_to_ecar-charger
description: ""
triggers:
  * trigger: time_pattern
seconds: /5
actions:
  * action: modbus.write_register
data:
hub: Schrack_icharge_cion_hub
address: 101
value: "{{ states('sensor.Ladestromvorgabe') | int }}"

Here the error message from logbook:

Executed: 13 March 2025 at 14:17:15
Result:
params:
domain: modbus
service: write_register
service_data:
hub: Schrack_icharge_cion_hub
address: 101
value: 18
target: {}
running_script: false

So, reading is ok, writing does not work.

Any hints?

Solved! I have to add mode:single to my automation, now it works. Now, I have a script executing modbus.write_register, and call this script from my automation, with mode:single (time_pattern 58 seconds).