Open Matze5593 opened 1 year ago
Good question. I will be installing a second one soon.
Can we keep this in English please.
hey,
that should work. See https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/16
Recently, one guy in the home assistant forum confirmed that he got it working: https://community.home-assistant.io/t/sungrow-sh10-rt-modbus-integration/361356/35
Unfortunately, the method described in #16 does not work. i tried to avoid duplicate names by using the designation 2 or slave. but dying didn't help. modbus_sungrow2.yaml.txt
copied this together with just 2 sensors, but I obviously cannot check without a second inverter, so I need your help here :)
When this works, the next step is more or less copy / paste for the other sensors
This works with my two SH10RT! I've completed the 2nd yaml, see below.
I have an additional question: when I try to write a modbus register like this, it's not working. Do you have any idea? Actually the "Set battery SoC reserve" doesn't work either. Perhaps the same problem?
alias: Battery-SoC 17
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.battery_level
above: 90
condition: []
action:
- service: modbus.write_register
data:
address: 13100
hub: SungrowSHx
slave: 2
value: 17
mode: single
great to know that this is working.
I will put this on the "ToDo" list, but final integration and documentation will take some time.
If you want to write to modbus register 13100 (reserved soc for backup), you need to decrement the address to 13099
copied from modbus_sungrow.yaml (arount line 1470)
alias: "sungrow inverter update reserved soc for backup"
description: "Updates reserved SoC for backup register"
trigger:
- platform: state
entity_id:
- input_number.set_sg_reserved_soc_for_backup
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: !secret sungrow_modbus_slave
address: 13099 # reg 13100
value: "{{ states('input_number.set_sg_reserved_soc_for_backup') | int}}"
mode: single```
Does this help?
Yes, it works! Thanks!! But for example, if I enter value: "70" the Battery SoC reserve (sensor.battery_soc_reserve) displays 7%, with "90" this changes to 9%, values above 100 have no effect. Where is my mistake?
This is known, I haven't seen it..
- name: Battery SoC reserve 2
unique_id: sg_battery_soc_reserve_2
slave: !secret sungrow_modbus_slave_inv2
address: 13099 # reg 13100
input_type: holding
count: 1
data_type: uint16
swap: word
unit_of_measurement: "%"
device_class: battery
state_class: measurement
scale: 1 **# NOT 0.1**
scan_interval: 10
I tried to adjust the max_charge_power because battery system SunGrow SBR265 supports up to 17.520 W Unfortunately this doesn't work... Perhaps the register isn't correct?
set_sg_battery_max_charge_power:
name: Set max battery charge power in W
#initial: 40
min: 0
max: 17520
step: 100
set_sg_battery_max_discharge_power:
name: Set max battery discharge power in W
#initial: 40
min: 0
max: 17520
step: 100
In the secret.yaml, the slave inverter must be set as a Modbus slave from 1 to 2 in order to be able to query data via the sh10rt's Modbus port
z.B
`
sungrow_modbus_host_ip: 192.168.178.xx sungrow_modbus_port: 502 sungrow_modbus_slave: 1
########################################################################
sungrow_modbus_host_ip_inv2: 192.168.178.xx sungrow_modbus_port_inv2: 502 sungrow_modbus_slave_inv2: 2 `
This works with my two SH10RT! I've completed the 2nd yaml, see below.
I have an additional question: when I try to write a modbus register like this, it's not working. Do you have any idea? Actually the "Set battery SoC reserve" doesn't work either. Perhaps the same problem?
alias: Battery-SoC 17 description: "" trigger: - platform: numeric_state entity_id: sensor.battery_level above: 90 condition: [] action: - service: modbus.write_register data: address: 13100 hub: SungrowSHx slave: 2 value: 17 mode: single
Thankyou. Your YAML file worked perfectly for my TWO SG5.0RS I'd spent a couple of hours trying to create a second modbus_sungrow.yaml file to handle two inverters! Now I can plot my 4 MPPT string currents
Quick heads up RE the dual YAML files - reduce increase the scan_interval time ...the default will flood the Winet-s devices and knock them offline. i've taken mine to 60s at the moment and will see how it goes
hi, i have problems with the power mppt 1/2. I don't understand how the code works and my mistake lies. I just don't get any values for the power. Could you please help me
`
name: MPPT1 voltage inv 2 unique_id: sg_mppt1_voltage_inv2 slave: !secret sungrow_modbus_slave_inv2 address: 5010 # reg 5011 input_type: input count: 1 data_type: uint16 swap: word precision: 1 unit_of_measurement: V device_class: Voltage scale: 0.1 scan_interval: 10
name: MPPT1 current inv 2 unique_id: sg_mppt1_current_inv2 slave: !secret sungrow_modbus_slave_inv2 address: 5011 # reg 5012 input_type: input count: 1 data_type: uint16 swap: word precision: 2 unit_of_measurement: A device_class: Current scale: 0.1 scan_interval: 10
name: MPPT2 voltage inv 2 unique_id: sg_mppt2_voltage_inv2 slave: !secret sungrow_modbus_slave_inv2 address: 5012 # reg 5013 input_type: input count: 1 data_type: uint16 swap: word precision: 1 unit_of_measurement: V device_class: Voltage scale: 0.1 scan_interval: 10
name: MPPT2 current inv 2 unique_id: sg_mppt2_current_inv2 slave: !secret sungrow_modbus_slave_inv2 address: 5013 # reg 5014 input_type: input count: 1 data_type: uint16 swap: word precision: 2 unit_of_measurement: A device_class: Current scale: 0.1 scan_interval: 10
name: Total DC power inv 2 unique_id: sg_total_dc_power_inv2 slave: !secret sungrow_modbus_slave_inv2 address: 5016 # reg 5017 input_type: input count: 2 data_type: uint32 swap: word precision: 0 unit_of_measurement: W device_class: power state_class: measurement scale: 1 scan_interval: 10 sensor: name: MPPT1_inv2 power unique_id: sg_mppt1_power_inv2 unit_of_measurement: W device_class: power availability: "{{states('sensor.mppt1_voltage_inv2')|is_number and states('sensor.mppt1_current_inv2')|is_number }}" state: "{{ (states('sensor.mppt1_voltage_inv2') | float * states('sensor.mppt1_current_inv2') | float) |int }}"
name: MPPT2_inv2 power unique_id: sg_mppt2_power_inv2 unit_of_measurement: W device_class: power availability: "{{states('sensor.mppt2_voltage_inv2')|is_number and states('sensor.mppt2_current_inv2')|is_number }}" state: "{{ (states('sensor.mppt2_voltage_inv2') | float * states('sensor.mppt2_current_inv2') | float) |int }}"
Since the last update i get no data from my second inverter... Does anybody have an idea?
Last HA Update broke my complete Sungrow INtegration for SH and SG... Think there are some issues between Modbus in HA Core and the Code (there is something with regards to uint/int16 needs swap: none ... but this did not help...
I will get deeper into this during the next week.
Are you using the latest version of modbus.yaml file? There the error with swap
is fixed.
Since HA 2023.9.x there are some new, weird ModBus issues. See 158
There you will find a link to the HA issue regarding the problems with ModBus.
I created a .yaml config file for my second inverter that works with Home Assistant 10.1. I only included the sensors I really need, so of you like, feel free to complete the file - I was too lazy :)
If you want to use this, please follow the instructions given earlier in this thread. Thanks to @bleughb for the "inspiration" (I basically stole your way of doing the config).
Has anyone two SH10RT-V112 as Master/Slave working and both combined shown in a flow chart?
Gibt es die Möglichkeit 2 Wechselrichter einzubinden wenn man die Konstellation im Master und Slave hat?