Modbus TCP/IP - climate thermostat

Hi All,
I tried to integrate HASS with soft PLC based on Codesys 3.5.
I would like to create interface in HASS for my automation system. I would like to use Modbus TCP/IP to send and receive data from PLC.
I managed to test modbus connection using “switch”, “sensor” form hass example .
I have problem with termostat for modbus communication. I am able to receive current temperature, current setpoint (in case of changeing register by e.g server) but I cannot send setpoint to my modbus server. My example is listed below.

climate:

  • platform: modbus
    scan_interval: 5
    name: termostat salon
    hub: hub1
    slave: 1
    data_type: uint //i’ve tried int - doesnt work
    data_count: 1
    scale: 1
    offset: 0
    precision: 1
    max_temp: 30
    min_temp: 15
    temp_step: 1
    target_temp_register: 15 // holding register 15
    current_temp_register: 16 // holding register 16

Anyone has similiar issue?

I had the issue that any write command writes two registers.
so if you write to register 15 it also writes 0 to register 16 and maybe you plc doesn’t allow write to register 16 since it is a sensor.
what I did is to have an empty register after Avery write register. so leave 16 empty and on the PLC use 17 for the current temp register.
I have te same problem for binary switches.