Jump to content

SunSynk - Inverter Monitoring


Bloubul7
 Share

Recommended Posts

Good day All,

Over the past couple of months I have received numerous requests to share my NodeRed flows used for monitoring the status of the SunSynk inverter.  My initial idea was to package all of the flows into an easy to use package and user interface, however my work loads have not provided me the luxury of time to play around and make it a fool proof system. 

Please note that the use of these flows are at your own discretion with no liability to either myself, this site nor any members of this site.  Do not attempt implement these flows if you are unfamiliar with the working of the ModBus protocol or basic programming.

Brief overview of the flows:

  • LoadShedStatus - This flow determines the loadshedding status through a webscraper.  I use this information to trigger a secondary set of settings to the inverter in case of load shedding.
  • ModBusRead - This flow is responsible for reading information from the Inverter via the Modbus Flex getter
  • ModBusWrite - This flow is responsible for writing settings back to the inverter via the Modbus flex getter
  • Inverter Monitoring - This flow is responsible for obtaining all of the inverter monitoring values.  The values are then send to Home Asssistant via MQTT as well as logged to an InfluxDB for monitoring via Grafana
  • SSFormRead - This flow reads the current system settings from the inverter and display it via the NodeRed UI
  • SSFormWrite - This flow writes any changes made to the system settings via the NodeRed UI back to inverter
  • SSDSRead - This flow reads the "Default Settings" from storage and displays it via the NodeRed UI.  I use the "Default Settings" to store my optimal system settings when there is no Load Shedding.
  • SSDSWrite - This flow writes the "Default Settings" from the storage to the Inverter.  The flow is also triggered automatically from the LoadShedding status flow
  • SSLSRead - This flow reads the "Load Shedding Settings" from storage and displays it via the NodeRed UI.  I use the "Default Settings" to store my optimal system settings when there is no Load Shedding.
  • SSLSWrite - This flow writes the "Load Shedding Settings" from the storage to the Inverter.  The flow is also triggered automatically from the LoadShedding status flow
  • TimeMode - This flow triggers different settings on different days of the week.  My PV Solar is currently not big enough to carry my whole house, I utilize this flow to feed electricity back into the non-essential loads on the days which my domestic worker is not working.  This helps me to optimize my savings on certain days of the week while maintaining healthy battery levels.

NodeRed Palettes required for the flows:

  • node-red-contrib-actionflows
  • node-red-contrib-influxdb
  • node-red-contrib-modbus
  • node-red-contrib-queue-gate
  • node-red-contrib-schedex
  • node-red-contrib-simple-gate
  • node-red-dashboard

The next couple of posts have been reserved to further expand on the hardware requirements and basic set up of the monitoring.

The idea of sharing my flows is to contribute to the community, let us keep this going as a community project by assisting and contributing to project.

flows (5).json sunsynk_modbus.docx

Link to comment
Share on other sites

Hi @Bloubul7, have you tried to read multiple SunSynk inverters that are connected in parallel via a single RS485 connection?  Theoretically you should just be able to read the modbus address configured on each inverter, but I'm asking if you have tried it before.

Link to comment
Share on other sites

Hi Denarius,

That is exactly what I was thinking! I am playing with that right now. 

I have done this, but the Node-Red does not connect to the inverter, my expectation was that it would not work as you do not have a RS485 link between the inverters.

For this to work you might want to add an additional RS485 cable from the slave inverter to the same RS485 to USB converter.

What I will be doing is adding another USB converter and then running this separately via the same Node-Red.

@Bloubul7, thanks for all the hard work. This is working on my side, just go the PI communicating with Master inverter today and the Node-Red links works perfectly (once I made an edit or two on the influxDB server settings!).

 

Link to comment
Share on other sites

Okay, so I am head banging here against a port auto closing:

"Serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)"

Using a direct access python program I end up with a "closed" port of some read error. 

It worked well with Python and then edited Node-Red and once launched it worked for a while and then "timeout" was received on the inverter2... Then port closed.

So @Bloubul7, what would you say is the issue here (in short when you get to experiment please include Parallel in the experiments!)? 

 

 

 

Link to comment
Share on other sites

19 hours ago, Rautenk said:

Hi Denarius,

That is exactly what I was thinking! I am playing with that right now. 

I have done this, but the Node-Red does not connect to the inverter, my expectation was that it would not work as you do not have a RS485 link between the inverters.

For this to work you might want to add an additional RS485 cable from the slave inverter to the same RS485 to USB converter.

What I will be doing is adding another USB converter and then running this separately via the same Node-Red.

@Bloubul7, thanks for all the hard work. This is working on my side, just go the PI communicating with Master inverter today and the Node-Red links works perfectly (once I made an edit or two on the influxDB server settings!).

 

Have you tried changing the Unit-ID under the Flex-Getter?

image.png.103203e3cabf9fcdcf715bb33be52079.png

Unfortuantely I only have a single unit, can't test out the parralel functionality 

Link to comment
Share on other sites

1 hour ago, Bloubul7 said:

Have you tried changing the Unit-ID under the Flex-Getter?

image.png.103203e3cabf9fcdcf715bb33be52079.png

Unfortuantely I only have a single unit, can't test out the parralel functionality 

Jip, I have done that and had no luck (it continued monitoring the Main inverter). I am assuming that should I have had both inverters on the same USB-Serial converter this would have worked. As I am still unsure if the parallel connection would allow one to pull data from the slave inverter vir this. The reason for this argument is that a Wi-Fi dongle is required per inverter. If you could pull the data from slaves, I would have assumed the dataloggers would be able to do this (and thus only 1 logger required).

Then I changed the Inverter Monitoring coding to also reflect "unit" 1, but once I did that the communications crashed completely. Got no response from the flex-getter (or rather from the inverter), kept getting error messages and timeouts.

What I am going to do is try and run two parallel Node-Reds (Basically copy everything in the Node-Red, add a 2 to it and see if it works).

I found that one of my cables broke off at the converter, so that could explain a bit on why the slave was acting up when having its own converter...

*edit, I am using a cheap converter around R35 for the thing, but it works! (QinHeng Electronics HL-340 USB-Serial adapter)

Edited by Rautenk
Link to comment
Share on other sites

2 hours ago, Rautenk said:

What I am going to do is try and run two parallel Node-Reds (Basically copy everything in the Node-Red, add a 2 to it and see if it works)

Success, I now have both of my inverters using the Node-Red set up, As noted in the quote. I ended up copying the Modbus read and the inverter monitoring, added a two to everything.

If you change the "unit-id" it messes up the communication so the unit ID remained "1" but the "device" used (port) was changed to the correct one. 

I am getting a feeling having the RS485 connected onto the same converter will not work, something is not lekker with the RS485 modbus addressing on these units.

I wrote a small python script to read the Modbus address register, this came back as "1" on both, despite my inverters being master slave (address 1 and 2) on the inverter itself. So this would mean that the modbus addressing on the parallel system connection is not the same as the RS485 connection! 

 

image.thumb.png.a09bfe879c352774e61cebe6e21c7de7.png

Link to comment
Share on other sites

  • 2 weeks later...
On 2021/04/01 at 11:00 AM, Rautenk said:

Success, I now have both of my inverters using the Node-Red set up, As noted in the quote. I ended up copying the Modbus read and the inverter monitoring, added a two to everything.

If you change the "unit-id" it messes up the communication so the unit ID remained "1" but the "device" used (port) was changed to the correct one. 

I am getting a feeling having the RS485 connected onto the same converter will not work, something is not lekker with the RS485 modbus addressing on these units.

I wrote a small python script to read the Modbus address register, this came back as "1" on both, despite my inverters being master slave (address 1 and 2) on the inverter itself. So this would mean that the modbus addressing on the parallel system connection is not the same as the RS485 connection! 

 

image.thumb.png.a09bfe879c352774e61cebe6e21c7de7.png

Hi Rautenk,

I also have 2 units in parallel, just to confirm, do you have 2 x USB to RS485, so one connection goes to Master, let say on /dev/ttyUSB0 and the other to the slave on /dev/ttyUSB1? And then running 2 node-red configs, one for each of the inverters? I have mine connected to the Master, but I have 1 x MPPT on Master and 2 x MPPT on the slave, but I only see the one on the Master. On another note, how the (*&*#^#&*^#&^ do you get from this

msg.payload = { 
    'fc': 3, 
    'unitid': 1, 
    'address': 186, 
    'quantity': 1 }; 
msg.topic = "Solar_PV1_Power"
return msg;

to the correct part of the Synsynk_modbus document please?!

My Mandarin is failing me big time....

Thanks for the awesome info on this

 

Link to comment
Share on other sites

So, I have two devices. Yes /dev/ttyUSB0 and /dev/ttyUSB1.

 

What i did on the NodeRed is the following:

image.png.1ef4fc568a966ec4632989bc051eaf26.png

Copied the config inside NodeRed and made alterations:

image.thumb.png.7b14f5079f0d16f45b4f00bef5e92d0f.png

Then on the modbus details, added another server:

image.png.8ae993ed6a913d66f2a702e1aab0b438.png

 

Note the only change here is the device, do NOT change the ID:

image.png.1e25d35e91af151b8b2b19d5c5074351.png

 

Then on the MPPT1 and 2 issue:

image.png.07d4f213744f743c7b8cf2b066d753d7.png

image.png.6e3c9eaef3b9b712142e8d6518d44363.png

 

Note that the original posted by BlouBul only have the 1 MPPT log not both. 

As for the "correct" part of that Sunsynk docment... Well, I wrote a simple Python program that was able to read the modbus and changed the modbus address until I found the right ones! That is perhaps the most simplistic of Modbus mapped document I have seen in some time. The wording(description) and the outputs does not always match up to what we in the western world would expect...

image.png.c990f9ff29fe8b8e7160cb7b4a658d83.png

 

 

Link to comment
Share on other sites

You also need to be aware that if you use all of Bloubul7's flows it can change the settings of your inverter as he set it up to change his inverter settings when there is load shedding automatically. 

You only need the ModbusRead & Inverter monitoring flows to be able to read the data. 

 

Link to comment
Share on other sites

What readings would be different between the two inverters?

I would think that it would only really be the readings from the MPPT controllers, otherwise everything else would be controlled by the master and I would guess would bbe the same, just thinking out loud? 🙂 

Link to comment
Share on other sites

Just waiting for the other USB RS485, I agree, should only be the MPPT readings that I would need from the slave, I did disable the other flows, just using the ModbusRead & Inverter monitoring flows

Link to comment
Share on other sites

Woohooo, Bloubul7,  I have finally worked out how to access your Dashboards in Node Red, they look frikkin awesome!! 

Untitled.thumb.png.b7db9271d014f811c00b0e0972fddf9f.png

 

Everything at the moment in my Dashboards is set to 0.

 

Can I read in the current settings from my Inverter and then save them  in one of the Dashboards to be written again at a later stage?

I am assuming that that is what the Read button is for, am just a bit nervous of overwriting my Inverter settings as I have no idea what I am doing 🙂   

Edited by Sc00bs
Link to comment
Share on other sites

Posted (edited)

Hi,

Yes, reading the settings will retrieve the current settings from the inverter and populate the dashboard.  You can then make changes if you like and press write settings to push back the changes to the inverter.

Some explanation on the different dashboards:

  • System Settings - Provides you with the ability to read and write the live settings from the inverter
  • Default Settings - This stores a set of default settings to the file system on Pi.  This was utilized to store my non-loadshedding settings.  These settings are automatically pushed to the inverter based on the loadshedding status
  • Loadshedding Settings - This stores a set of loadshedding settings to the file system on Pi.  This was utilized to store my loadshedding settings.  These settings are automatically pushed to the inverter based on the loadshedding status
  • Time Mode - I use the Time Mode to trigger feeding back into my non-essential loads on certain days of the week.  Due to my solar setup currently being undersized to power the entire house on days when my domestic worker (higher loads due to washing, tumble dryer, ironing etc) is here, this allows me to save some additional power on the alternate days by feeding back into the non-essentials.

A note for everybody else, if you want to access the dashboards then go to the following address http://[your pi's IP]:1880/ui

Edited by Bloubul7
Link to comment
Share on other sites

  • 1 month later...
Posted (edited)

Got the cable connected to inverter RS485 port, port 2+7 and 1+8 of the other end of the cable connected to by USB-RS485 converter and it's connected to my PI running Node-Red.

 

Clean node-red installation, with the required pallettes installed and the flows from Bloubul imported and deployed.

 

Trying to configure my modbus-client, but it cycles very quickly between init, connected, timeout etc... Any ideas here?

 

image.thumb.png.00f3d3874f767f7aae8f290f16b113da.png

Occasionally also seeing: Modbus Failure On State sending Get More About It By Logging

Edited by jacauc
Link to comment
Share on other sites

Firstly, make sure that you disable the Flows that Bloubul did to write setting back to your inverter otherwise you may end up with your inverter settings being changed.

You only want to have the ModbusRead &  Inverter monitoring flows enabled.

Then I would disable all of the queries being sent except perhaps the SOC query and see if you are getting the data back using the debug option on the SOC.

If you are getting the data there then I would check in the InfluxDB to see if the data is being sent there.

I created another flow with all of the downloadable variables that I could find, it includes some that were not in Bloubuls flow and have attached it.

flows (2).json

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...