Sungrow Winet-S addon for newer inverters

There’s a few Sungrow integrations already, however all the current ones struggle with newer inverters like the SH8.0RS and SH10RS which don’t provide some key information over their modbus interface.

My integration gets all the key metrics from the inverter via the Winet-S dongle’s internal Websocket API every 10 seconds and sends them to Home Assistant via MQTT with automatic discovery.

It can be combined with the existing modbus integrations for full control of the inverter.

7 Likes

Thanks Nick, your addon saved the day for me with my SH10RS and WiNet-S2.

I had ananas open (a modbus testing software) manually trying different modbus addresses from the semi-secret modbus pdf when I eventually found your link to your addon. Saved me whole lot of time. Thank you so very much. I was struggling with bohdan-s/SunGather.

I have a couple of opportunities for improvement (not critical but if u have time):

  • I have a hybrid inverter but no battery yet, and option to turn off reading battery related data would be nice.
  • I only have 1 phase so optionally turning off the reads for phases 2 and 3.

Not essential by any means, just giving possible options.

I have blocked the isolarcloud / sungrow servers in the DNS so firmware updates shouldn’t be able to be pushed to the inverter or WiNet-S2.

1 Like

Thanks! I’m glad it’s working for you.

The addon actually does (nearly) no processing or hard coding of what parameters it pulls. Rather you’ll notice the parameters you see in Home Assistant are exactly what the Winet web interface shows.
I went for this approach since it seems Sungrow inverters are quite inconsistent from model to model. :slight_smile: This way it automatically adapts.

Unfortunately this means there isn’t a good way to know when a parameter isn’t used since the Winet UI shows it anyway. I probably wouldn’t want to try hard coding a list in as that would get messy.

1 Like

No problem at all Nick, I totally understand where you are coming from.

I’m updating to V1.6 right now :slight_smile:

1 Like

Hi Nick
i am using the SG10RS inverter, and i cant seen to get the entities to show up.
i am assuming its my mqtt url? my mqtt is an addon in the homeassistant and i have a seperate mqtt user too.
any help would be nice, i have already pulled enough of my hair. :wink:

Hi @hadi1

Does the addon’s logs seem to indicate it’s working and connected to MQTT? The logs should indicate if there’s any issue talking to MQTT.

From there it’s using MQTT Discovery. If Home Assistant is talking to MQTT correctly then out of the box it should automatically discover the new sensors.

1 Like

Hey NickS,

Just wanted to say thanks for your hard work!
I was able to get all my input register polling off modbus and onto this.
It was the final straw for me to migrate my HA from a docker on my overworked synology into a HAOS VM on my Proxmox server. The addon is great :slight_smile:

I notice that a lot of other addons are available stand-alone for those of us that use container install, is that something that would be possible with your addon too? Just out of interest, won’t be needing it myself at least!
Cheers,

Frankyman

No problem @frankyman . :slight_smile: I’ve pushed a new version that includes a Docker compose file and a sample .env file which can be used to more easily run it standalone.

Let me know if you have any issues. It’s a tiny bit more complicated than normal just because it needs to know the right architecture for the base image, it looks like HA doesn’t make multiarch base images. :frowning:

Hey @NickS, cheers for the quick reply!
I tested out your standalone docker container and it worked with minimal effort :slight_smile:
I had trouble cloning the repository initially but realised I had to clone the whole home-assistant-repo, not just winet-extractor. I’m sure someone else who is stuck on a container HA install will find it useful!

Nick, this is awesome.

I’ve used a combination of SunGather (both directly and via its add-on, which doesn’t have a pleasant way of customising the registers it publishes to MQTT), Modbus directly (a la mkaiser’s register definitions), and my own half-complete solution.

This is phenomenally straight-forward and out of the box. Truly splendid work. I still need to use direct Modbus integration for some registers and for setting/manipulating, but this still greatly simplifies the bespoke code necessary.

This feels like a really good starting place for any Hass user newly integrating their Sungrow system.

:clap:

Note: One caveat that people may experience is that the WiNet-S web interface won’t work while this is running, due to its limit of 1 WebSocket connection. Temporarily stopping the add-on is the workaround which seems pretty acceptable to me, given how infrequently the web interface should be necessary.


Perhaps simply disabling these entities after they’re created is the way to go. I haven’t yet tested if this works well through restarts, since I’m aware that MQTT entities are kinda special in that they need to be re-defined each time (and I haven’t checked if any kind of a unique_id is used for each entity to carry over overrides).

Hi All,

Does this addon still work? I have not been able to get my inverter working on HA.

Hi @matthewbayard yep it should be working correctly. You can file a issue on the Github repo and post your logs and we can see what’s not working for you.

1 Like

Thanks for implementing this integration. Tried other cloud-based integrations, but it did not work (GoSungrow). Was thinking of connecting RS485 module to connector, but found Winet-S2 web interface by accident by opening invertor IP address in browser and was googling for it.

Whole setup took 10 minutes for SG10RT. Some entities shown “Unknown” but I think it’s because sun is down. Will post an update tomorrow

Thanks again :slight_smile:

BTW, I also asked solar installer to add Shelly 4PM switch to my water heater tank, so I can switch it on during daylight hours. My heater is 3.5kW, and switch has 4 16A channels with total load of 40A so two channels connected in parallel to split load.
Having integration with invertor allows me to go step further and switch it on only if there is enough energy produced to cover all other loads.

Hi Nick,
I left a message on Github. Is there a way to have two inverters? I have an SG5 and SH5. Can I edit a .yaml?

1 Like

@DaveWal not currently, but I can probably add support relatively easily just by providing two IPs and using the same user/pass for both. :slight_smile:

1 Like

I tried to setup your Winet Extractor to work with my Sungrow devices (SH5.0RT & SBR096) - unfortunately without success.
Here is what I’ve done so far:

  • Setting up an mqtt broker in home assistant
  • adding a user simulacrum with a password to the broker
  • configure the integration with the user and password
    – Server: core-mosquitto
    – Port: 1883
    – User: simulacrum
    – Password: [my password]
  • installing your Winet exctractor
    – winet_host: 192.168.178.151
    – mqtt_url: mqtt://simulacrum:[my password]@core-mosquitto
    – winet_user: admin
    – winet_pass: [my web password for admin, changed from the default pw8888]
    –poll_intervall: 10

This is an excerpt from the log:

Node.js v20.15.1
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started

> cli
> node build/src/index.js

2024-08-13 09:44:05 info: Connected to MQTT broker 
node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND http
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketErrorListener (node:_http_client:500:9)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -3007,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'http'
}

Node.js v20.15.1
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Any idea?

Interesting approach. I used a single channel shelly that turns a single pole contactor on. The contactor is rated for the full Hot Water System current.

I set up automations to check how much power is being fed into the grid before turning the HWS on, and turn it off again if the purchased power goes over a value. To ensure I dont have cold showers on rainy days, I installed the ‘MeasureIt’ addon and run an automation to check that the hot water system has had at least 90mins of power by 2pm, or turn the HWS on again (for an extra 90mins) and ensure it is turned off by 3:30pm. Time of Use Power from 4-9pm is expensive so I defiantly don’t want the HWS on during that time.

Hi Nick, thanks for making this. It’s excellent. I had no problems setting it up using Docker. I made a couple of adjustments for it to fit into my workflow (used my own docker compose file).

Here’s my setup:

  • Sungrow SH50RS
  • 9.6kW battery
  • WiNet S
  • Home Assistant Container on a Raspberry Pi 4, with Docker images for Mosquitto and Winet-S Extractor

Couple of tidbits:

  • I accidentally plugged my Home Assistant port (8123) into the MQTT port (1883). There were no errors logged, but obviously no connection to Mosquitto either. I fixed that and it was fine.
  • I would like to know total load in my house - I think it’s a combination of Total Active Load Power and Total Backup Power. Total Active Power is (I think) a combination of those and Total Export Active Power, but I’m not sure. For now I’ve made a helper which combines those two. I respect your decision to pass unmodified data through from the websocket to the MQTT module.
  • The Winet-S module can be used to configure query parameters. Would it be possible to integrate these into Home Assistant? I’m thinking it’s probably a bit out of scope for this project as (I believe) MQTT is read-only.

Thanks again for making such an awesome tool.

Hi Nick, just started getting this installed and setup. Just wondering if it was possible to add a second inverter to add the kWs together?

Thanks, Josh