mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
374 stars 95 forks source link

Connection issues for SunGrow SH3.0RS #403

Open MattiaPette opened 1 week ago

MattiaPette commented 1 week ago

Hi, in my residential installation I've installed a Sungrow SH3.0RS which I do not know if it's officially supported with this project (the readme mentions SH3.RS, SH3.6RS and i guess mine is the first one ? ) product page link

I have a small problem connecting to the inverter with the ethernet. I've plugged in the free ethernet port you see in the below image and it seams that it gets an IP from my DHCP ip pool but when portscanned or pinged it doesn't do anything, which probably is the reason the integration does not work. Is the port the correct one? Is the inverter supposed to not have any tcp port open or not be pinged? Is it because this particular model does not have support at all?

The black ethernet cable was installed by the technician and I've honestly no idea where it goes (maybe to the small device they added to my electrical box?) This is the only free ethernet port other than the one with the WLAN cloud dongle they added (which honeslty I would like to remove if it safe to do so, i do not need yet another device remotely connected to somewhere) PXL_20241116_160646233 RAW-01 COVER PXL_20241116_160820874 RAW-01 COVER

Gnarfoz commented 1 week ago

Check page 42 of your inverter's manual. It describes the COM2 port in detail. In short: there is no secondary Ethernet port on this model. You can still connect to the WiNet-S via Modbus, though, preferably via its Ethernet port. If that is only connected via Wi-Fi, unscrew the cap and connect a cable, if you like. You can then disable Wi-Fi on the WiNet-S. It doesn't just connect "somewhere", btw, but to Sungrow's iSolarCloud, the "normal" way to monitor and manage Sungrow solar systems. Sungrow's inverters can mostly be operated without it, if you spend the necessary time to learn the ins and outs of alternatives like this project.

Another alternative would be to connect a RS485 to Ethernet converter to COM2 ports A1 and B1, bypassing the WiNet-S altogether.

MattiaPette commented 6 days ago

Ok, so if I understand It correctly, that free ethernet port Is for DRM which Is something I do not have to worry about because it's only needed in some countries. The second eth Port which Is already plugged in Is for modbus TCP, and somehow it's already in use by my installator (maybe for remote assistance?)

I do not understand the WiNet-S thing as my installator wont let me use the phone application as "It voids my warranty" if I manage It by myself, i have not seen the app and I do not know what's all about It.

It leaves me the last thing to try and wireup a cable for the COM2 port and try that.

My goal with this Is not to manage my inverter from homeassistant but to receive metrics for my kiosk tablets and automations in HA and Better handle the energy stored in the batteries.

Gnarfoz commented 6 days ago

I'm not sure what your IP scan showed, but neither of those RJ45 connectors is an Ethernet port. Refer to page 42 of the manual. The DRM port is indeed for connecting a device controlling the inverter according to the requirements set by the power company. The other port is for connecting a battery, which you seem to have, so that's why it's in use.

The WiNet-S dongle does two things: it feeds data to Sungrow's iSolarCloud so it has something to show you, and it offers Modbus TCP access for local use. Depending on your inverter model, the data available via Modbus might vary. Refer to the most recent Modbus register specification as of October 2024 for details.

Regarding the app: your installer is lying to you. The iSolarCloud app and website are for use by owners of Sungrow solar installations. It shows things like energy production, consumption, power, earnings, etc. Things any solar power operator should have access to. How else would you know anything about your installation's performance? iSolarCloud offers customer and installer privilege levels and nothing the customer role can do should jeopardize your warranty (which is offered by Sungrow, not your installer, keep that in mind). Your installer can (and probably should) retain installer-level access to your installation. Only they can adjust important / dangerous parameters. It's possible that your installer is (wrongly) operating your installation as if it was his own installation, or they have multiple customer installations in the same account, so giving you access would also give you access to other customer's installations. Whatever the reason may be: this is your device and you are owed access to it. Make them set it up for you, you paid for it. Make them set up an "owner" type account in iSolarCloud for you / with you (or create the account yourself), and have them set this account as the owner of your installation. They'll use their installer code to add themselves to the installation with installer-level access. You can always kick them out later, if that becomes necessary. You can even make an installer account for yourself and share your installation from your owner account to your installer account, granting you full access. Not recommended unless You Know What You Are Doing™️, though. Further reading: https://en.sungrowpower.com/productDetail/987/cloud-platform-isolarcloud https://www.isolarcloud.eu/ https://play.google.com/store/apps/details?id=com.isolarcloud.manager

The COM2 port encompasses the two RJ45 connectors (DRM & battery) as well as the two pin blocks. Check page 42 (PDF page 52) of the manual to learn more. Just wiring up a cable to pins A1 + B1 would not be enough. You would need a RS485 to Ethernet converter like for example this one (or similar): https://www.waveshare.com/RS232-485-TO-ETH-for-EU.htm

MattiaPette commented 6 days ago

Hi, thank you so much for taking the time to write this. I am indeed settling things with my installer and as for the account usage I will probably set them up as installer access account and me as owner as it the right thing to do (i paid for it I might as well use it). I'm going to just ignore the fact that I will have limited warranty as it's not true at all.

Correct me if I'm wrong, for this project I can't just use the modbus tcp rj45 connector at the bottom of the WiNet-S dongle and I need to buy that adapter (I think I have one laying around from an old work project, I might give it a shot), connect the two pins A1 + B1 and ground to feed into the adapter, use a standard ethernet cable to connect to the device to my network and use the IP address in the integration configuration.

Gnarfoz commented 6 days ago

Correct me if I'm wrong, for this project I can't just use the modbus tcp rj45 connector at the bottom of the WiNet-S dongle [...]

Despite what the big warning on the README of this project says, I would at least give this a try. Recent firmware versions of the WiNet-S dongle have improved its Modbus behavior at least a bit. It's possible that not all registers are available. Depending on if/which registers are missing, that might be irrelevant (stuff like serial numbers), annoying (things like energy counters, you could implement those yourself in Home Assistant by deriving the data from the power values), or deal-breaking (basic things like inverter running state that are required to know what the device is doing). Modbus TCP should be available on the WiNet-S's IP address on port 502, regardless of if the WiNet-S connects to your network via Wi-Fi or Ethernet. It think it's actually able to connect via Wi-Fi and Ethernet at the same time, but don't quote me on that. ;-)

Using an adapter and tapping directly into the inverter of course bypasses any issues or limitations the WiNet-S might have, at the cost of a bit of time spent tinkering. One note when dealing with Sungrow connectors / plugs: use appropriate wire ferrules to terminate the wires that you plug into the connector. Just like on your initial photo for ports A2/B2.