I created a Modbus based integration for a Sungrow SH10.RT inverter, which should be working for
SH3.6RS, SH4.6RS, SH5.0RS, SH5.0RT, SH6.0RS, SH8.0RT, SH6.0RT, SH10RT
and maybe SH5K-20 SH3K6 SH4K6 SH5K-V13 SH5K-30
See
Please let me know, if you have any questions and comments. If there is enough demand and with some help, I can also try to create a more user-friendly GUI-based integration (but I don’t know how to do that, yet!)
@mkai it works vor SH5.0RT. But I found one issue. For the Energy dashboard are only the Total values offered, which is wrong, we need the active values there, can you please have a look into it?
The build-in energy dashboard requires monotonic increasing “kWh values”. The reason behind this is that the measured energy values (kWh) are much more accurate than the current / momentum values (Watts) due to the scanning interval (5 seconds in my pre-defined settings)
I made some screenshots with my settings. It takes over an hour, until the dashboard displays reasonable date.
Ach, deutsch ist gut
ich glaube ich habe die Energieflussgrafik falsch verstanden. Aufgrund der schlechten Produktionsraten in Deutschland ist halt im Moment nicht viel zu sehen…
I’m looking at buying a Sungrow inverter, but am seeing reports online that they’re rolling out a firmware update that locks out Modbus access with encryption:
Hi @mkai, followed the instructions (first time doing this so forgive me if this is a simple issue to resolve) didn’t have an integrations folder already present so created one and added the modbus_sungrow.yaml file as directed, updated configuration.yaml and restarted, on boot i’m getting an error
2022-03-02 03:49:49 ERROR (MainThread) [homeassistant.setup] Setup failed for packages: Integration not found.
I ran the config check and it came back with could not find Packages, I think the issue was in the configuration.yaml I had not indented the packages line so it ws listed like:
I made this modification and rechecked and it passed, restarted home assistant and now can see the dashboard properly - no values in there as yet and in reviewing the system logs i’m getting alot of errors:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/pymodbus/transaction.py”, line 208, in execute
self.client.framer.processIncomingPacket(response,
File “/usr/local/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py”, line 153, in processIncomingPacket
self._process(callback)
File “/usr/local/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py”, line 175, in _process
raise ModbusIOException(“Unable to decode request”)
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2022-03-03 02:25:25 ERROR (SyncWorker_6) [pymodbus.factory] index out of range
2022-03-03 02:25:25 ERROR (SyncWorker_6) [pymodbus.transaction] Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/pymodbus/transaction.py”, line 208, in execute
self.client.framer.processIncomingPacket(response,
File “/usr/local/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py”, line 153, in processIncomingPacket
self._process(callback)
File “/usr/local/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py”, line 175, in _process
raise ModbusIOException(“Unable to decode request”)
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
its a few steps forward, i’ll have to take a deeper look at the modbus_sungrow.yaml file to see what it’s looking at - could just be a module I don’t have (I don’t have a battery for example)
So been over 2 hours now and still nothing in the dashboards constantly getting hte errors in the logs - I read that the Sungrow Modbus was encrypted and that it was possible to get the data direct from the Winet-s adaptor by using SungrowModbusWebclient instead - Is this the right process to follow and if so do you have any experience doing so? Ie where would i modify to make this work?
So I took a look at that link you provided and downloaded the QmodMaster software - no dice initially then I logged onto the WiNet-S web interface as the admin, under system transfer configuration MODBUS there is an option to add IP whitelists. I added my PC to the whitelist and was able (with errors and timeouts) to get data returned. not quite sure how to translate this to the Home Assistant (already added as Whitelisted IP) but I guess it’s a step in the right direction.
I’m thinking of getting the SH10RT and a battery. What about control of the energy flow to/from the battery, can that be controlled by the integration? Can anyone confirm that it works?
Hi there, first time poster. I hope I haven’t missed anything too obvious.
I have a HomeAssistant Setup using Home Assistant OS on a Raspberry Pi 3. I am running core-2022.5.3 and Home Assistant OS 7.6. I already have a number of add-ons from the Official and Community Stores.
I recently installed an external SSD as I want to add monitoring of my two Sungrow SH5K-30 Hybrid inverters and I expect to need a InfluxdB and Grafana, which I have also installed.
My problem is that I cannot add the repository for the project I think may be what I need.
I want to use this project Sungrow-SHx-Inverter-Modbus-Home-Assistant by Mark Kaiser. I cannot work out how to specify the link to the repository in HomeAssistant. I keep getting error “Invalid Add-on repository!”
This is not an out of the box component nor add-on as Home Assistant already has a built-in Modbus integration. This repo merely demonstrates a working configuration.
I am very much a newbie with this, I didn’t realise that HA already supported Modbus, nor understand the need to add the code to configuration.yaml. I am very much a graphical user!
I am now using Modbus Client app (on my Mac) to test if I can retrieve any data. I suspect that I may have issues due to the encryption that has been reported being used by Sungrow.
But you have certainly answered the immediate question