Synchronization of virtual thermostat from lovelace UI with modbus thermostat

Via modbus, data is periodically read from the thermostat and sent to the lovelace thermostat. At the same time, the desired temperature can be changed from the lovelace thermostat and this can be written to the modbus thermostat via events state. It happens that in the meantime the temperature on the slider is thrown to the previous one and then for a short time back to the newly set one. In what way can this be synchronized.