Hi
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?
/Henrik
Hi
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?
/Henrik
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!”
I have used the link from the green CODE button on the project page;
“GitHub - mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant: Sungrow SH Integration for Home Assistant for SH3.6RS, SH4.6RS, SH5.0RS, SH5.0RT, SH6.0RS, SH8.0RT, SH6.0RT, SH10RT” and
“GitHub - mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant: Sungrow SH Integration for Home Assistant for SH3.6RS, SH4.6RS, SH5.0RS, SH5.0RT, SH6.0RS, SH8.0RT, SH6.0RT, SH10RT”, neither work.
I have also tried to do the same for meltaxa/solariot and have encountered the same problem.
Could someone suggest what I am doing wrong.
Thanks
AC
Hi Anthony…
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 suggest starting by copying Sungrow-SHx-Inverter-Modbus-Home-Assistant/modbus_sungrow.yaml at 20c594987a5808c74e018942699324ce62ab86a2 · mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant · GitHub into your own configuration.yaml
(or a package
within it), merging modbus
sections if you have others. Adjust your secrets to use the correct IP, port, etc.
Thx Bo,
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
I am sure I will have more
That may be as far as I can take you. I’m still waiting for my Sungrow inverter and solar to be installed at end of month! I am also anticipating some issues with encryption but hopefully we can overcome them !
Bo,
I installed the ModbusTCP2MQTT successfully. Thanks for your tip. It is sending requests, but I am getting errors, which I suspect may be due to the fact that Sungrow have now implemented encryption.
I have found this project rpvelloso/Sungrow-Modbus which adds encryption to the standard ModbusTCP client, by " just replace ModbusTcpClient() with SungrowModbusTcpClient()".
I couldn’t figure out how to do that, and I have created a new thread how to swap the standard TCP with the encrypted one. The thread is " TCP Client for Sungrow Devices with encryption"
I will let you know how I go.
Anthony
@mkai, Thank you a lot for sharing this awesome code.
I have a SH10RT with battery and WiNet-S. If somebody else is struggeling a bit, modbus with LAN was working fine for me from the beginning.
WLAN started to work after a firmware update in my case:
I have two minor problems:
Battery Power has always a positive value. No matter, if it is charging or discharging.
on/off Sensors are not working. They are always off:
Does anybody have similar problems or even a solution?
Thank you!
I installed the ModbusTCP2MQTT successfully. Thanks for your tip. It is sending requests, but I am getting errors.
I want to install TCP Client for Sungrow Devices with encryption .
I dont know how/where to " just replace ModbusTcpClient() with SungrowModbusTcpClient()".
Could some direct me where ModbusTcpClient is located? thanks.
Anthony
sorry for the late response.
The battery power supplied by the modbus interface does not reflect the energy flow direction.
Therefore you need the on/off sensors, which unfortunately are not working for you.
I recently made several improvements to the overall integration. Can you check, if it works with the testing branch? → https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/tree/testing
If the Battery charging sensor works, it should be relatively easy to create a template sensor (look at the lower part of the modbus_sungrow.yaml for examples)
BR
Martin
Hi Martin, thank you very much for your reply and your effort for the integration. I already solved it using a battery load trend sensor checking, if % load goes up or down. Works like a charm.
Anyway I will check your updated version and let you know.
Best,
Axel
Hi Martin,
I updated the yaml. It’s working fine, but my binary sensors are still all “off”.
Thank you for the credits.
Cheers, Axel
I noticed that battery current was negative when charging, so I did the following:
modbus:
- name: SungrowSHx
# ...
sensors:
- name: Inverter battery power (raw)
unique_id: inverter_battery_power_raw
slave: !secret sungrow_modbus_slave
address: 13021
input_type: input
count: 1
data_type: uint16
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: 10
- name: Inverter battery current
unique_id: inverter_battery_current
slave: !secret sungrow_modbus_slave
address: 13020
input_type: input
count: 1
# data_type: uint16
data_type: int16 # docs say unsigned but I'm getting overflows when battery is charging
# changing to int shows negative amperage which makes sense.
swap: word
precision: 1
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.1
scan_interval: 10
sensor:
- platform: template
sensors:
inverter_battery_power:
unique_id: inverter_battery_power
friendly_name: Inverter battery power
value_template: >-
{% set current = states('sensor.inverter_battery_current') %}
{% set power = states('sensor.inverter_battery_power_raw') %}
{% if 'unavailable' in [current, power] %}
unavailable
{% elif current|float < 0.0 and power|float > 0.0 %}
{{ -1 * power | float }}
{% else %}
{{ power | float }}
{% endif %}
unit_of_measurement: W
device_class: power
Edit: I had to change the data_type
on the battery current to be int16
, despite what Sungrow docs show. Also, from talking to other people, the value ranges in these registers might vary based on the actual battery pack you have. In my case, I have a SH5.0RS with SBR128 battery.
Hi
Thanks for the good config!
I’ve managed to get this config up, however the on/off sensors are not working for me either, has anyone find a solution for this?
I’ve also a question regarding to charge the battery. I want to specify a certain time to charge the battery from the grid (depending on price of electricity), how do I force the system via HA to charge the battery from the grid?
Thanks
Managed to get the on/off sensors working. Connected directly to the inverter solved the problem.
Hey @mkai,
The SH10RT has a DO relay that is a part of its load control, did you see it in your modbus scan? as I can’t see it anywhere. I also don’t seem to be able to scan my inverter with any modbus tool but your integration works and gets data so it must be working.
Hello, Thank you for your work. I have an SH10RT. I can access it via LAN-Interface as “User” and as “Admin”. But the integration is’nt delivering any value.
I have triple-checked the ip-address, modbus-port and slave-settings.
How can I troubleshoot it?
Best regards
Ekkehard
There was an issue on github for that. Unfortunately the thread starter did not share his processings. Feel free to re-open it
@ [CodeRed]
Best to check the github page (especially the issues) for that.
I would start updating to the current firmware. Next step is to ensure, that you are using the SH10.RT’s native LAN port, NOT the LAN port of the dongle.
Then use some modbus TCP tool (search: modbus tool, windows / linux) to check the address and slave port.
Thanks for your answer.
I have implemented the second inverter independently in the same way
It works perfect.
Greets
Basti