New Pypi library available SungrowInverter #64
mvandersteen
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Just letting you know seeing as I have leveraged the work done here in combination with modbus register pdf's I found on a german site.
I have created a module for communicating with the Sungrow Hybrid and String inverter series of systems. You can find details of what inverter it supports @ https://github.com/mvandersteen/SungrowInverter
I've created it for use with Homeassistant and working there fine.
I still need to extend a few thing, like get the stats out of registers 6100 to 6862 (today 15 mins, daily, monthly, yearly stats) but otherwise it should expose most things.
I only have a SH5K inverter to test against with a battery (LG Chem 6.5) but so far is connecting fine, the entire thing is based on your work @meltaxa so thank you for doing that, hopefully you guys can also find this useful.
It will attempt to connect to the invert on initialisation, to get the inverter model, serial and nominal output capacity, also the holding registers to get battery info of what is connected, based on the inverter device_type_code it finds at register 5000 (4999) it will then load either the hybrid registers or string inverter registers; for the inverter it finds it will only setup the necessary data as well.
If connection fails on initialisation will will attempt to lookup the model details on the next async_update() call.
Have a look see if you can leverage, i've found that use of a few of the registers is not really correct on these, and have changed some to match the pdf's out of sungrow.
Thanks again for doing the leg work originally here Meltaxa, i've been using it work year, just recently wanted to integrate the data into home-assistant properly so decided to create a proper module to do that and minimise codeon home assistant , more useful this way.
If interested I've also put the 2 pdf's on hybrid and string inverter modbus registers on the site as well :) hope they help.
Use how ever you wish.
I'm only using the SungrowModbusTCPClient so let me know if this causes a problem as well, I'll fix, from what I've read though around different forums this is most problems found have nothing to do with using the specific SungrowModbusTCPClient that was made though.
to use simple as the following, (uses async connectivity too hence asyncio below)
from sungrowinverter import SungrowInverter
import asyncio
sungrowclient = SungrowInverter("192.168.1.127")
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
result = loop.run_until_complete(sungrowclient.async_update())
if sungrowclient.data is not None:
print(f'Output Data: {sungrowclient.data}')
cheers
Mark
Beta Was this translation helpful? Give feedback.
All reactions