Hi,
Thanks to all the tips read in this thread I’ve almost successfully integrated a ZCS 1PH HYD5000 ZSS HP inverter.
My inverter is connected with an ethernet adapter.
My configuration is the following
I’ve added to the configuration.yaml
file the following line:
modbus: !include modbus.yaml
Then I created a new file called modbus.yaml
where I pasted the following code:
- name: "Inverter ZCS"
type: tcp
host: IP-INVERTER
port: 8899
retry_on_empty: true
retries: 10
sensors:
# Inverter Info
- name: "ZCS Stato" #"Operation_Status"
slave: 1
address: 0x0404
input_type: holding
data_type: uint16
scan_interval: 320
lazy_error_count: 5
- name: "ZCS Prelievo Rete" #"grid_input"
slave: 1
address: 0x0485
data_type: uint16
device_class: power
state_class: measurement
unit_of_measurement: "W"
scale: 10
scan_interval: 24
precision: 2
lazy_error_count: 5
- name: "ZCS Rete Immisione Prelievo" #"ongrid_load"
slave: 1
address: 0x0488
data_type: int16
device_class: power
state_class: measurement
unit_of_measurement: "W"
scale: 10
scan_interval: 17
precision: 2
lazy_error_count: 5
- name: "ZCS Rete Potenza Attiva" #"ongrid_active_power"
slave: 1
address: 0x048F
data_type: uint16
device_class: power
state_class: measurement
unit_of_measurement: "W"
scale: 10
scan_interval: 13
precision: 2
lazy_error_count: 5
- name: "ZCS Assorbimento Casa" #"inverter_sysload"
slave: 1
address: 0x04AF
data_type: uint16
device_class: power
state_class: measurement
unit_of_measurement: W
scale: 10
scan_interval: 12
precision: 2
lazy_error_count: 5
- name: "ZCS Potenza Stringa 1" #"pv_1_power"
slave: 1
address: 0x0586
data_type: uint16
device_class: power
unit_of_measurement: "W"
scale: 10
scan_interval: 10
precision: 2
lazy_error_count: 5
- name: "ZCS Potenza Stringa 2" #"pv_2_power"
slave: 1
address: 0x0589
data_type: uint16
device_class: power
unit_of_measurement: "W"
scale: 10
scan_interval: 10
precision: 2
lazy_error_count: 5
- name: "ZCS Carico Batteria" #"battery_power"
slave: 1
address: 0x0606
data_type: int16
device_class: power
state_class: measurement
unit_of_measurement: W
scale: 10
scan_interval: 16
precision: 2
lazy_error_count: 5
- name: "ZCS Temperatura Batteria" # "inverter_temp_battery"
slave: 1
address: 0x607
input_type: holding
data_type: int16
device_class: temperature
unit_of_measurement: "°C"
scan_interval: 290
lazy_error_count: 5
- name: "ZCS Stato Carica Batteria" #"battery_soc"
slave: 1
address: 0x0608
data_type: uint16
device_class: battery
state_class: measurement
unit_of_measurement: "%"
scan_interval: 72
lazy_error_count: 5
- name: "ZCS Salute Batteria" #"battery_soh"
slave: 1
address: 0x0609
data_type: uint16
device_class: battery
state_class: measurement
unit_of_measurement: "%"
scan_interval: 1900
lazy_error_count: 5
- name: "ZCS Cicli Batteria" #"battery_cycle"
slave: 1
address: 0x060A
data_type: uint16
scan_interval: 2100
lazy_error_count: 5
- name: "ZCS Energia Prodotta Totale" #"total_generation"
slave: 1
address: 0x0686
data_type: uint32
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
count: 2
scale: 0.1
scan_interval: 48
precision: 1
lazy_error_count: 5
- name: "ZCS Energia Consumata Totale" #"total_consumption"
slave: 1
address: 0x068A
data_type: uint32
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
count: 2
scale: 0.1
scan_interval: 44
precision: 1
lazy_error_count: 8
- name: "ZCS Energia Importata Totale" #"total_import"
slave: 1
address: 0x068E
data_type: uint32
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
count: 2
scale: 0.1
scan_interval: 42
precision: 1
lazy_error_count: 8
- name: "ZCS Energia Esportata Totale" #"total_export"
slave: 1
address: 0x0692
data_type: uint32
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
count: 2
scale: 0.1
scan_interval: 53
precision: 1
lazy_error_count: 8
- name: "ZCS Carica Batteria Totale" #"total_battery_charge"
slave: 1
address: 0x0696
data_type: uint32
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
count: 2
scale: 0.1
scan_interval: 39
precision: 2
lazy_error_count: 8
- name: "ZCS Scarica Batteria Totale" #"total_battery_discharge"
slave: 1
address: 0x069A
data_type: uint32
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
count: 2
scale: 0.1
scan_interval: 34
precision: 2
lazy_error_count: 8
This configuration most of the time works great except for some random errors in the values returned by the inverter to Home assistant.
I’m not sure that the problem is the inverter or Home Assistant whatever in the middle.
In the log in Home assistant I have the following entries
Pymodbus: Inverter ZCS: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
11:53:55 – (ERROR) Modbus - message first occurred at 16 April 2023 at 16:44:19 and shows up 1191 times
Connection to (10.0.0.22, 8899) failed: timed out
11:45:52 – (ERROR) components/modbus/modbus.py - message first occurred at 16 April 2023 at 17:30:10 and shows up 98 times
Received 2 bytes, unpack error unpack requires a buffer of 4 bytes
08:47:07 – (ERROR) Modbus - message first occurred at 16 April 2023 at 18:14:19 and shows up 11 times
And here an example of the wrong value obtained by home assistant.
So more or less once a day I have to fix manually the wrong values in the STATISTICS tab in the DEVELOPER TOOLS section.
Do you have any idea how can I fix those errors?
Or at least how I can force Home Assistant to discard that single wrong values automatically?
Thanks in advance.
(you can answer me also in Italian of course
)