Sungrow SH10.RT Modbus integration

Hello,
I tried the integration but I can only see values from the “Meter” (Meter active Power etc.). I have following errors:

  • General exception: index out of range
  • Modbus IO exception Modbus Error: [Input/Output] Unable to decode request
    Pymodbus: SungrowSHx: Modbus Error: [Input/Output] Unable to decode request

Can anyone help with this error?
Thanks in advance.

Update: fixed it. Like recommend (…) I used the “direct” LAN Port instead of the one from the WiNet S and almost everything works fine :slight_smile:

Very nice!

I can’t use the direct LAN Port of the Sungrow, can’t get it working, so i must use the WiFi Dongle with LAN.
Therefore as discribed on the top i cannot get all Modbus Commands.

Now i have connected a RS485 Cable on the Inverter with a USB-Modbus Stick on my HA Server.
What do i have to change for using ttyUSB1 instead of Modbus-LAN?

how did you get the LAN Port working?

It just worked “out of the box”… I additional connected the LAN-Port (at the moment I even have the WiNetS running for the iSolarCloud) and then changed the IP-Adress in the secrets.yaml and it was running :slight_smile:

ok, i got it running too!
My mistake was to asume that the Website of the SungrowInverter is also reachable over the LAN Port!
This LAN Port seems to be good ONLY for the Modbus-TCP Datas!
So the Solution with 2 LAN Cables seems to be the best if one want MODBUS and Website.

i have created a template integration that uses data form this integration to predict battery behaviour.
you can check it out here:

hey
did you find how to handle this, where to do it? - as a rookie, i’m struggling to “decrypt” this solution implementation - cannot figure out where to add/change that script config.

[Edit]
Solved because it rly was a defect port
[/Edit]

I am struggling getting this ModBus Port running. I am having a SH10RT-V112 with an WiNet-S Adapter. Both Ports, the “internal” one as well as the WiNet-S Adapter are connected using LAN. I tested both LAN cable with an cable tester and both are absolutely fine.

I am getting an IP address of the WiNet-S wired-connection but the “internal” LAN Port is not connected. No IP address in my router, no blinking light at the switch … nothing. I already did the Cold-Start thing from the Known-Errors section. Nothing seems to work. Is there a hidden option I have to enable to enable that ModBus-Port?

Hello
thanks for the great work.
My configuration is: the Dongle (Lan) for iSolar and the Lan-Connector for Modbus and your Application.
It works mosttime pretty, but sometimes I get Errors:

  1. Warning

modbus SungrowSHx communication closed

  1. Error
  • Pymodbus: SungrowSHx: Modbus Error: [Connection] ModbusTcpClient(192.168.178.84:502): Connection unexpectedly closed 3.2901763916015625e-05 seconds into read of 8 bytes without response from unit before it closed connection
  1. Error

Pymodbus: SungrowSHx: Modbus Error: [Input/Output] [Errno 32] Broken pipe

I tried differnt Values of the Modbus-Defination in Yaml, but it didn’t help.

First I thaught, the reason is my second modbus-Devis (Solvis heat pump) on port 502. But also without the error occurs.

Can someone help?
Thanks
Jürgen

Hi!
Is there no entity with the Daily/total Energy consumption of home? I can find this value in iSolarcloud, but not in the modbus/template sensors?

there are some sensors for this.

Use Developer Tools → States and type “energy” into “filter entities”

Some sensors like “daily_exported_energy” , “daily_direct_energy_consumption” etc. will pop up. Does this help?

For a good overview I use the Home Assistant Energy Dashboard

I‘ve another question.
The template sensor of the sungrow inverter state is allways “Unknown - should not see me!” because the modbus sensor of the system state is 0 if the inverter is running normal.

In the Logs I can also find these values for the system state modbus sensor: 0, 21760, 5120 and 5632.

I’m using a SH10RT. All other values for example for the device type are correct.

      - name: System state
        unique_id: sg_system_state
        slave: !secret sungrow_modbus_slave
        address: 12999 # reg 13000
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        scale: 1
        scan_interval: 10

  - name: Sungrow inverter state
    unique_id: sg_inverter_state
    state: >-
      {% if ((states('sensor.system_state') | int(default=0)) == 0x0002) %}
        Stop
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0008) %}
        Standby
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0010) %}
        Initial Standby
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0020) %}
        Startup
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0040) %}
        Running
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0100) %}
        Fault
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0400) %}
        Maintain mode
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x0800) %}
        Forced mode
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x1000) %}
        Off-grid mode
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x2501) %}
        Restarting
      {% elif ((states('sensor.system_state') | int(default=0)) == 0x4000) %}
        External EMS mode
      {% else %}
        Unknown - should not see me!
      {% endif %}

Hallo,
the integration is not running since the last core update.
Has anyone the same Problem? I Can’t restart HA too

Had also applied the update last night and the Modbus integration stopped working. Fortunately I had made a backup that I could undo the update.

ok i never restored a back up … i hope it is working for me too and not crashing my HA :slight_smile: How long needs it to restore it?

10 minutes

Same problem here.

maybe it’s the same modbus issue:

Just install 2023.8.2 and wait for 2023.8.4. the current release 2023.8.3 the modbus is broken. You also don’t need to restore a backup. Just use terminal and execute „ha core update —version 2023.8.2“

check the last update - it was an issue with my code :slight_smile:

I used “word swaps” for int16 uint16 data types, which does no sense. The latest modbus updates found this possible issue and the validator was updated accordingly. Then it did not allow the integration to load, which is actually a desired behaviour…

Hello mkai,

great work, great support, top !

I installed your cool sungrow integration for our SH10RT, it works but i dont get the battery charge/discharge gauge working. The binary types also are still without function.
Is this a known issue ? what can i check ?

Also the power flow shows only the total power data. I configured it like you sayed in dec '21
Total … parameters
What is wrong there ?

Thank you very much for some tip
Thomas