SunGrow Inverters

Hi Mark,

This looks great, I installed your code too, and I can’t see anything either. I have an SG5K-D (no battery) like Simon.

I also know nothing about modbus, but happy to test code or send you logs.

Jamie

@mvandersteen Have you looked in to not only reading values, but also setting values?
I’m about to install a SH10RT with panels and battery, and in wintertime with the current electricity prices it would be very nice to be able to set the charging mode to have the battery charge when the price is low.

@jamie.carlyle I’m having a look at this today, i’ll see where I get, most of the work is to marry up the register-code names for both inverter types which i didn’t do at the start which was silly.

@Dali01 I have considered this and probably will at some point because my clock is always out crossing over day light savings, and I have considering the same thing. Fo rexample what i would like to do is here in Melbourne Australia, peak electricity is between 3pm and 9pm (for my retailer anyway) and in middle of winter when not getting a full charge from solar would like to charge the battery before 3pm. So at some point I will investigate. I haven’t looked into what that means yet though, happy to accept any info on how to do this. I would imagine its just sending a value to the relevant register with different modbus command and possibly slave address though.

1 Like

I’m based in Melbourne AU also, just had my system installed - Sungrow SH5.0RS with SBR096 battery.

I tried your integration but the script is having issues connecting to the inverter via MODBUS it seems:

Modbus connection failed, connection could not be made or register range failed to be read.

Does MODBUS work over WiFi? Or ethernet connection is required?
I’ve also seen some forums which suggest Sungrow started encrypting the MODBUS traffic, not sure if this was the cause.

Edit:
Yep that definitely looks to be the case, there are different WiFi modules and some are encrypted. Someone on Whirlpool has written a script to read from the Websocket via its local access web portal instead, I may look to integrate this when I get some time. https://forums.whirlpool.net.au/thread/3vxm5jy3?p=11#r214

This should be compatible with the SungrowInverter client that you wrote @mvandersteen

1 Like

Urgh, and I just ran the Sungrow firmware updates before I installed this add-on…

I’m having an issue with assigning a static IP to my Sungrow inverter so I can consistently read the data into HA.

I’ve assigned it an IP via my router’s DHCP settings and I’ll usually get a couple of days where the inverter turns off overnight and comes back up correctly. However, every so often it will come back up with a different MAC address (ie. 02:A0:00:36:30:4E vs 02:A0:00:C0:0F:E6) and the router will give it a new IP address, thinking it’s a different device.

Is this just something that should be expected? How can I reliably get the readings if both MAC and IP addresses keep changing?

@mvandersteen I’d like to get data from my SG5K-D into HA
i see you have added support for the Hybrid units, will you be adding support for the string models?

on a separate question to see if the Modbus encrypting traffic will be an issue for me, is the firmware updated automatically on these units or a manual process, and how do you tell what version of firmware it is running?

I’ve just today finally got some data from my SG5K-D correctly into HA via modbus - after months of pulling my hair out. Turns out I needed to offset all the addresses that are reported in modbus mappings by -2 (even though solariot gives me the standard modbus register numbers). Don’t know why. But now it works. Here’s configuration (in configuration.yaml) for PV generation and grid voltage:

modbus:
  - name: 'Sungrow'
    type: tcp
    host: 192.168.XXX.XXX
    port: 502
    sensors:
      - name: 'Grid voltage'
        slave: 1
        address: 5017
        input_type: input
        count: 2
        scale: 0.1
        precision: 1
        unit_of_measurement: V
        device_class: energy
        scan_interval: 30
      - name: 'Active power'
        slave: 1
        address: 5029
        input_type: input
        offset: 65535
        count: 2
        precision: 0
        unit_of_measurement: W
        device_class: energy
        scale: 1
        scan_interval: 30
      - name: 'PV generation'
        slave: 1
        address: 5015
        input_type: input
        offset: 65535
        count: 2
        precision: 0
        unit_of_measurement: W
        device_class: energy
        scale: 1
        scan_interval: 30

Hope this helps! Good luck.

HI and thanks for this information

I have just had a PV system installed today with the same inverter.
Are you using that standard Wifi module that came with the system.
If so was there anything you needed to do to get communications working with it on Modbus other than putting your config in to HA?

TIA.

I believe it’s the standard wifi module. It was all pre-installed on the house we purchased. Other than setting it up to connect to our network there was nothing else I had to do. I don’t know if maybe some have newer firmware that encrypts traffic but I didn’t have that with mine.

I have a SG10KTL-M inverter. It was there when i bought the house, no documentation.

It has a very old communication module (CDMA 1X, no documentation can be found) connect to the RJ-45 communication port.

I replace the communication module. new module is a 485 to Wi-Fi module. The communication port RJ-45 pin 1 is +5V, pin 2 is GND, pin 3 is 485 B-, pin 6 is 485 A+.

I found the modbus register map from https://loja.l8energy.com/wp-content/uploads/2020/11/TI_20190929_String-Inverters_Communication-Protocol_V10_EN.pdf

I write a very simple modbus multiplexer so that HA and other program can access modbus registers simultaneous.

当前信息 is a simple web I wrote(sorry it’s chinese)

I am using this but have found it doesn’t give me any grid voltage or grid import

I managed to get SolarIOT working and publishing to MQTT however I’m getting the following error

Pymodbus: Sungrow: Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response

I’ve got a sungrow SH5K inverter with LG battery.
I’ve had plenty of success monitoring the inverter via HA and modbus but I don’t have the confidence to try more than that.

@mvandersteen I’d love to be able to force it to charge at defined times. Were you able to make any progress on that?

Hey thanks, for this. i got this running about a month ago and everything was fine. then all of a sudden(on July 23) it stopped working.

i’m not sure why but it looks like my IP address changed which is an easy enough fix but that didn’t resolve the issue. is anyone else having an issue with this?

i’ve tried updating everything but no dice.

1 Like

Yeah, it all stopped working for me a few months ago. The data I was getting from my system was pretty unreliable and my system doesn’t have export monitoring so I’ve given up on sungrow and have arranged an electrician to come install an enphase monitoring system. It’ll cost a bit but I’ll easily recoup the cost by time shifting our heating and cooling to optimal times.

oh, thanks.

what system are you going to install that will work with the sungrow inverter? have you found a good installer?

Mine stopped working the same day. I’m part of the origin VPP (virtual power plant) program and gave Origin a call and apparently a lot of their VPP customers have the same issue. It’s completely stopped the inverters operating with the batteries. Still yet to get a technician out to fix but the person I talked to indicated some update was rolled out that did not work well.

I’ll let you know what the technical says when they (finally) come out.

Tried turning it on again after several days and it started OK. Not sure what the problem was but interface with homeassistant all ok now too.

Does this work for Sungrow a well?