meltaxa / solariot

Leverage your IoT enabled Solar PV Inverter to stream your solar energy usage data to a real time dashboard.
https://solariot.live
MIT License
210 stars 71 forks source link

Sungrow SG10RT inverter modbus #49

Open rark-ha opened 3 years ago

rark-ha commented 3 years ago

Hi. I've recently installed a SG10RT inverter (3 Phase) and trying to work out the modbus setup.

If I use the model = "sungrow-sg5kd" I can get most of the readings, except "power consumption" and "energy consumption".

(sungrow-sh5k modbus fails to connect at all).

Can someone point me in the right direction to set up a modbus file that collects the power and energy info to?

rark-ha commented 3 years ago

I can scrape the 5000-5100 range and the 7000-7100 (though not much there) using function 04. I can't get the 13000-13100 range to scrape with function 04 as it says illegal data address.

sungrow-sh5k pulls the values I'm still missing from 13000 range and nothing in the 5000 range appears to be it.

STL2020 commented 3 years ago
2021-07-06 10:29:39 | stdout | pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] ModbusTcpClient(192.168.2.93:502): Connection unexpectedly closed 1.477375 seconds into read of 25 bytes without response from unit before it closed connection -- | -- | -- 2021-07-06 10:29:39 | stdout | raise ConnectionException(msg) 2021-07-06 10:29:39 | stdout | File "/usr/local/lib/python3.9/site-packages/pymodbus/client/sync.py", line 343, in _handle_abrupt_socket_close 2021-07-06 10:29:39 | stdout | return self._handle_abrupt_socket_close( 2021-07-06 10:29:39 | stdout | File "/usr/local/lib/python3.9/site-packages/pymodbus/client/sync.py", line 298, in _recv 2021-07-06 10:29:39 | stdout | self._key_packet = self._recv(25) 2021-07-06 10:29:39 | stdout | File "/usr/local/lib/python3.9/site-packages/SungrowModbusTcpClient/SungrowModbusTcpClient.py", line 40, in _getkey 2021-07-06 10:29:39 | stdout | self._getkey() 2021-07-06 10:29:39 | stdout | File "/usr/local/lib/python3.9/site-packages/SungrowModbusTcpClient/SungrowModbusTcpClient.py", line 54, in connect 2021-07-06 10:29:39 | stdout | client.connect() 2021-07-06 10:29:39 | stdout | File "/solariot/solariot.py", line 108, in  2021-07-06 10:29:39 | stdout | Traceback (most recent call last): 2021-07-06 10:29:38 | stdout | INFO:root:Connecting 2021-07-06 10:29:38 | stdout | INFO:root:Creating SungrowModbusTcpClient 2021-07-06 10:29:38 | stdout | INFO:root:Loaded config sungrow-sg5kd
STL2020 commented 3 years ago

The same Problem with modbus TCP .No connect

rark-ha commented 3 years ago

Further investigation from the WiNet WiFi module local web output shows real time data and also has a read back function for the modbus data (but only in hexadecimal).

(Note for others - PLC Addresses needed if you're scanning Modbus for analysis otherwise you're out by 1).

5003 daily_power_yield_0.01 5004 total_power_yield_100 5006 #NEW Total On-Grid Running Time (hrs) 5008 internal_temp_10 5009 #NEW Apparent Power_0.001 (kVa) 5011 pv1_voltage_10 (called MPPT1 Voltage in web interface) 5012 pv1_current_10 (called MPPT1 Current in web interface) 5013 pv2_voltage_10 (called MPPT2 Voltage in web interface) 5014 pv2_current_10 (called MPPT2 Current in web interface) 5017 total_pv_power 5019 #NEW Phase A Voltage_0.1 5020 #NEW Phase B Voltage_0.1 5021 #NEW Phase C Voltage_0.1 5022 #NEW Phase A Current_0.1 5023 #NEW Phase B Current_0.1 5024 #NEW Phase C Current_0.1 5031 total_active_power 5036 grid_frequency_10 5071 #NEW Array Insulation Resistance_10 (Kohms)

5216 export_power_overflow 5217 export_power_indicator 5218 power_meter

Still trying to identify;

I've mapped a heap of Modbus registers through to InfluxDB to help graph the readings over time but these last 3 still elude me. They might sit outside the 5000-5300 range.

bohdan-s commented 3 years ago

Hi, I have the official modbus map from Sungrow. I dont want to post it here, but can send you a copy if you want.

bohdan-s commented 3 years ago
daily_purchased_energy_10 = "Daily import energy"? 5097~5098 U32
daily_energy_consumption_0.01 = "Daily direct energy consumption"? 5101~5102 U32
total_energy_consumption_10 = "Total direct energy consumption"? 5103~5104 U32
meltaxa commented 3 years ago

Hi @bohdan-s. See my Github bio for my contact details to send me a copy. Cheers!

freman commented 3 years ago

Hi @bohdan-s, I also would be super interested if I may have a copy? I'm trying to get the Sungrow to work along side my Fronius (fronius is doing the solar, sungrow is doing the battery) and I'm really just trying to fill in the blanks

bohdan-s commented 3 years ago

@meltaxa @freman sorry for the delay, I have uploaded the file here: https://www.dropbox.com/s/qiwpam3b1m9a1cl/TI_20210716_Communication%20Protocol%20of%20PV%20Grid-Connected%20String%20Inverters_V1.1.37_EN.pdf?dl=0

freman commented 3 years ago

@bohdan-s no worries, and thanks. this time was used figuring out modbus, how it works, and what it means. I've learned a lot so now I can actually use this knowledge :D

I actually had an older version of that document.