Sungrow SH10.RT Modbus integration

your value “40” must be read decimal, which is 0010 1000 binary or 0x28 hexadecimal

the first one from the left corresponds to the “importing power flag”
- name: “Importing power”
unique_id: “sg_importing_power”
state: >
{{ states(‘sensor.running_state’)|int(default=0)|bitwise_and(0x20) > 0 }}

The second 1 shows, if the load is active or reactive (personally, I never saw a reason why anyone should know that, so I did not implement this)

looks like it should be working … haha

Please go to: Developer Tools → Statistics

is there anything related to the export power sensor?

If not, can you delete the sensor via the GUI?

Thanks for the hint to have a look at statistics. I’m new to HA, coming from OH. Anyway, I found two sensors with the same name and deleted the zombie and voilá it is working again.
Nice work! BR

glad to help - this was also my very last straw :sweat_smile:

Hello

I am new in the forum.

I have a recently installed PV , with sh-5.0rs and sungrow battery. The Ethernet connection with cable but for the Wi-net .

I used the code done By mkai, many thanks to you, and it works well in a LOT of registers. But i had problems with sensor. running_state for evaluating the charge/discharge of battery , exporting/ importing… I solved evaluating vàlues like sensor.total_dc_power for detect in what mode is the inverter.

If someone is interested I can Share MY modifications.

Dani

Hi, the easiest solution would be to connect the LAN to the dedicated LAN Port, because some modbus registers can’t be read over WiNet, even if it is connected via hardwired LAN.
However, for the community it would be interesting, if there is a workaround.

hi,

good point of deriving these sensors… You inspired me to write this code. Could you compare with your solution and check if this is working?

edit: Made a branch for that: Sungrow-SHx-Inverter-Modbus-Home-Assistant/modbus_sungrow.yaml at fix_running_state · mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant · GitHub

I Don’t know if it possible connect my inverter directiy without WINET

I have found that my inverter is flooding my HA log.
When battery is discharging sg_running_state is changing value every few minutes. Stating that inverter is importing power or exporting power for 10 seconds (the register read intervall).
This happens at a short interval of a few minutes. Not a constant interval. Varies from 2 to > 15 minutes.
Is this normal behavior? Or is something wrong with my inverter configuration?

Maybe someone could check the HA logs when battery is discharging. Did this happen to you also?

I am stuck here, too! When I unplug the LAN-Cable from the “WLAN-Port” and put it into the LAN-Port, I don´t get any new IP-Address in my router. Even restarting the router doesn´t help.It seems as if the LAN-Port is dead. Do I have to “activate” it somewhere?

May be 2 points you can check: restart the inverter by shutting down DC, Battery, and AC. I seem to recall that the internal restart from web interface was not sufficient to trigger DHCP. Second, I think you have to activate modbus operation within the local web interface (depending on the firmware). May be that helps?!

Thank you. Restarted the inverter, the battery and the router. I still don´t get a connection to the LAN-Port. very strange…

did you check this:

?
For me it did run out of the box, except I had an issue with the wire, which I fixed. Also, my inverter had to be substituted due to a malfunctioning communication module which only affected the energy meter.


Funny, I have way less options here…

Probably the wrong forum for that, but are you logged in as admin?

I tried again last night via the local access. here, i have all the options, too. After several reboots of inverter and router i finally received all three IP-adresses. I cannot exactly say, what helped in the end, but I guess it was the fix ip (other than DHCP). It works fine now.
Thanks for your efforts an support!

Hi,
Someone can help me with the integration of my SH4.0RS with WiNet-S and S-100 meter?
I do not undestand how to config the parameters.

Thank you for your help!!!
Francesco.

maybe I can help you :slight_smile:

Please follow the instructions here and let me know, at which point you have questions. Then I will update the documentation. I want it to be self-explanatory, but as a creator of things you get easily lost in details and things get hard to explain to not-yet-knowing-people :slight_smile:

'Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/integrations/modbus_sungrow.yaml”, line 27, column 66

Can anyone help with this error? I got it when I check configuration.
Thx in advance.’

1 Like

Do you get it working?
Most errors are due to yaml formatting. The number of blanks is very important.

No m8, I did not. I experienced another issue after rebooting my NUC with Home Assistant. I could not reach it anymore over gui. Then I figured out that it may be related to added ssl part of the code, so I acceseed it over https:// and did not try anything from that point. Modbus_sungrow.yaml is just downloaded, so I don’t think I could mess the formatting in it.
Best regards.