Hi,
Real life example: I have a ventilation unit made by Nilan, very popular brand in Scandinavia. I use Modbus Integration to read sensors and change states on it. However, Modbus implementation in this device allows to write registers with function code 16 (0x10) only, for both single register or an array.
Function code 0x10 for write register can be called by using a configuration variabel write_type: holdings
, but only in platforms:
- switch
- fan
- light
Or by using service modbus.write_register
with array as value.
There is no option to use function code 0x10 in climate platform.
I think it should be quite straightforward to implement configuration variable write_type: holdings
in climate platform, for:
- target_temp_register
- hvac_mode_register
- hvac_onoff_register
since is already implemented in others platroms.
So, configuration could look like this:
modbus:
- name: hub1
type: tcp
host: IP_ADDRESS
port: 502
climates:
- name: "Bedroom Air Condition"
address: 10
target_temp_register: 10
write_type: holdings # New feature
hvac_mode_register:
address: 11
write_type: holdings # New feature
values:
auto: 0
cool: 1
heat: 2
fan_only: 3
dry: 4
hvac_onoff_register: 11
write_type: holdings # New feature