Modbus integration - write register

Hello,

I’m using the Modbus integration to connect my HA to my air condition. Until now I was able to set the serial connection and I’m reading some registers through Modbus Sensor.
Now I would like to write some registers, for example: I want to write a register to set the operating mode of the AC according to: 1: Heat mode; 2: Domestic hot water: 3: Cool mode and domestic hot water; 4: Heat mode and domestic hot water; 5: Cool mode.

Can someone help me to understand how can I implement this?

Thanks
André