I have UPower-Hi hybrid inventer and I can read “Charging Mode” value from it (via HA → TCP → mbusd → orginal Epever rs485 USB cable, chip CH343).
But I also wan’t to write new value to it and let HA control battery charge from grid on cheap hours.
I have following config to read it and this works.
modbus:
- name: epever
type: tcp
host: 172.16.0.33
port: 502
timeout: 10
close_comm_on_error: false
retry_on_empty: true
retries: 20
sensors:
- name: "Charging Mode"
slave: 4
address: 0x9607
input_type: holding
Unofficial docs says that function code to read is 04 and write 10.
Values is: 1=Solar Priority, 2=Utility & Solar, 3=Solar.
So I thinking to set it to “2=Utility & Solar” to night times and rest of the day to “3=Solar”.
Any ideas how I can write to this holding register?