Write to modbus device

I am having a hard time writing to Modbus
I can read all values from the Modbus device
Can anybody help me with a solution?Preformatted text

Modbus is TCP
unit is 1
Register is 4x0100 and uses 0-4 as steps on a ventilation system

  • alias: Skift drifttrin
    trigger:
    • platform: event
      event_type: state_changed
      event_data:
      entity_id: sensor.drifttrin
      action:
    • service: modbus.write_register
      data:
      unit: 1
      address: 100
      data_template:
      value: ‘{{ states.sensor.drifttrin.state }}’
1 Like

I have the same problem. I can not write by modbus tcp. Did you find the solution?