Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Home Assistant Sunsynk modbus project

Featured Replies

Hello all,

I'm pretty convinced the answers to my questions are on this forum somewhere but I can't find them so if anyone could point me in the right direction it would be appreciated. 

I've been watching this youtube video (below). This seems such a simple straight forwards way of achieving what I want. I currently access the sunsynk API to get my inverter data in to home assistant but it is very slow and even though you can change the refresh rate to min 60 seconds it can still take a few minutes to update and sometimes doesn't update at all. So direct to to RS485 modbus port is my goal.   This video explains  everything nicely and looks the part but is for a Solax inverter.   Does any one know if the same thing has been done for sunsynk ? (ie no node red or MQTT etc) ?   Even though the integration is for Solax inverters I'm thinking the only difference would be the addresses of the parameters ? The other end of the sytem at the inverter I'm thinking the module should just be plug and paly bar providing external power as the Solax inverter seems to include power rails on its RJ45 port but SunSynk doesn't.   Has this been done already (as mentioned 100% sure it has somewhere) ?  Thanks for reading 

 

  • Replies 62
  • Views 13k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • It seems there are issues with that module https://kellerza.github.io/sunsynk/guide/wiring  

  • I have played with this converter that is working and cheap from micro robotics  https://www.robotics.org.za/communication-wireless-Industrial/serial-to-ethernet-converters/USR-DR302 You can

  • https://github.com/slipx06/Sunsynk-Home-Assistant-Dash/blob/main/ESPHome-1P-Sunsynk-Deye.yaml This is the single phase inverter yaml I was using it with this       Here is exa

Posted Images

  • Author

I ordered one of those wave share modules as shown in the video. Did all the setting up on the network side of it and it communicates over my network no probs, The power light and link light are on as expected.  It also has an ACT led which I assume is the active led flashing every time the inverter gets interrogated.  This LED doesn't light and I'm guessing it is because the commands being sent to it are wrong due to the integration in home assistant being for a Solax. Does anyone know if I'm on the right track here ? The other two big unknowns (to me) is what socket on the invertor to put the RJ45 plug in (I've tried the ones labelled Can , RS485 and Meter the bottom two are labelled parallel 1 and parallel 2 so I didn't try them)  I thought the RS485 port would be the correct one.  Also on the Wave share you have  RS485A , RS485B and GND but which cables do I connect to these.  From the SunSynk manual I found Appendix A that showed on the inverter there is two rs485A pins and two Rs485B pins I've tried pin 1, 2 and 3 on the inverter to the waveshare module and 3 7 and 8 but nothing changes or flashes etc.  So I'm a bit stuck now as I'm not sure where to focus my attention. Maybe even if the wiring was spot on I wouldn't see any ACT led flash due to the commands being gobbledygook or maybe the commands are ok enough to get a connection but the wiring is wrong.. or they are both ok but wrong port... hmmmm or something else completely.     Any suggestions ?  Thanks 

SS3.6Ports.jpg

waveshare_modbus.jpg

Sunsynk_rs485_pinout.png

  • Author

Arrg crap... A day and £22 wasted there then. I thought rs485 was a pretty standard thing and any rs485 module should work for that bit of the project... Thanks for highlighting  this you have probably saved me another few days of inane fiddling.. 

 

  • Author

I don't wan to use a USB module as I have to leave the factory USB dongle connected.  Off to look for another ethernet to RS485 gadget then. I see from that link there are three tested ones which sound good but are a bit pricey if brought new especially as I don't have a great deal of confidence at this moment that I'll get it going as I'd like to try and go direct as in the video with the solax rather than MQTT or node red etc.. I can't add anymore learning curves at the moment or I'll never get it going. 🙂  

Did you connect to that Waveshare device via a web browser? I assume there are some settings to be set on it. If you did, did you see any settings for the serial like baud rate, parity, etc?

  • Author

yes I connected to it via a web browser and put in all the details that had worked for the Solax in the you tube video. I couldn't find what parameters to set in for the Sunsynk.  The only thing I changed was the baud rate.  I swapped it from the 19200 to 9600 as I saw 9600 mentioned on the modbus sheet for sunsynk 

WaveshareSettings1.png

WaveshareSettings2.png

I assume you did setup your Home Assistant to connect to that ID and also the port of the Waveshare device.

I apologize for asking questions for things you might have done already but this topic is quite interesting because I am also interested in working with Sunsynk ModBus. Unfortunately I do not have access to a TCP-To-RS485 device yet.

  • Author

No probs asking questions. I’ll be only too happy to here a question I hadn’t thought of.  A bit worrying the site linked above states it doesn’t work though….

49 minutes ago, Perfo said:

A bit worrying the site linked above states it doesn’t work though

I do not see where it says that your device does not work.

A few things that I think should be important
 

  1. I would use pins 1,2,3 at the inverter side of the RJ45 plug
  2. Make sure the that pin 1 at the inverter side goes to B at the Waveshare, pin 2 to A and pin 3 to GND
  3. Plug the RJ45 plug into BMS 485 port on inverter
  4. Set your inverter to use CAN on on Battery Setup > Batt Type. I am thinking that if it is set to RS485 then it might interfere with your test.
  5. Set your inverter's ModBus to an ID of "01" and use that same ID on Home Assistant
  6. Use the Port (not Dest Port) that was setup in Waveshare to setup Home Assistant along with the Waveshare's IP Address
  7. According some other posts you need to restart the inverter.

Is there a Sunsynk repository in Home Assistant?

For now that is all I can think of. Hopefully I will start my RS485 project soon

Edited by TheMac

  • Author

Ok, I’ll give this a bash tomorrow.   If you click on the link going to the site that states it doesn’t work there’s a line of txt under the first option that says something like “waveshare also do an rs485 to the ethernet converter , but this doesn’t work” 

1 minute ago, Perfo said:

Ok, I’ll give this a bash tomorrow.   If you click on the link going to the site that states it doesn’t work there’s a line of txt under the first option that says something like “waveshare also do an rs485 to the ethernet converter , but this doesn’t work” 

Maybe @kellerza can provide more info on what the issue with that adapter is

  • Author
  1. I would use pins 1,2,3 at the inverter side of the RJ45 plug -   Done
  2. Make sure the that pin 1 at the inverter side goes to B at the Waveshare, pin 2 to A and pin 3 to GNDcc- Done
  3. Plug the RJ45 plug into BMS 485 port on inverter  - there isn't a BMS 485 socket just the rs485 socket ( the middle on in the picture)  I'm assuming I use the rs485 port 
  4. Set your inverter to use CAN on on Battery Setup > Batt Type. I am thinking that if it is set to RS485 then it might interfere with your test. No option to select this. Possibly due to there not being a can485 and canmod socket on this inverter ie I'm not sure if the BMS on this can use Can bus. The battery is set to no batt and the active box unticked.
  5. Set your inverter's ModBus to an ID of "01" and use that same ID on Home Assistant - Done - they were both on 03 before.. 
  6. Use the Port (not Dest Port) that was setup in Waveshare to setup Home Assistant along with the Waveshare's IP Address - Done 502 
  7. According some other posts you need to restart the inverter. - Done

Is there a Sunsynk repository in Home Assistant? Not that I know of. I've seen the ones that use the API and am currently running one of those which works very well bar the internet related problems and speed. thus my swap to direct..

 

Still no Act light and no devices or entities show up in the SolaXpower integration.  

IMG_20240114_135803.jpg

  • Author

Well a step forward.  I've downloaded a generic Modbus tester called Modbus Poll.  I put the little bit of info I know in to it and pressed connect. 

It seems to connect ok and fetch some sort of data with the ACK LED on the adapter flashing every second (the poll time I set up) .

Any clues as to how I would interpret the Modbus protocol for sunsynk to retrieve a particular value ? If I can do that then the thing is working it just needs the right requests.. Well I say 'just needs' but how to do that in HA is still a mystery..

modbuspoll.png

  • Author

I believe Modbus is a core integration in HA. I'm looking at the document on it but it isn't clicking at the moment.  Could anyone offer a good starting point for this ?  for example where do I stick the Yaml code they give in their examples ?  I've attached the Modbus protocols and register list for SunSynk but a lot of it is in Chinese.

sunsynk_modbus.docx

Edited by Perfo

  • Author

I think I went through all the posts with SunSynk but couldn't find any doing it this way. If you happen to see one then it would be most helpful. I've just bricked my HA fiddling with the config yaml and trying to add in my own modbus file...grrrr...

Thanks for the file... 

  • Author

hmmm On HA If I click on check configuration the circle thing comes up and just stays like that forever..   Any clues as to how I may interrogate a register on the sunsynk with this Modbus malarkey.. I've written (copied and pasted bits from the HA site) 

made a file called modbus.yaml containg the following 

# Example yaml: full tcp-rtu connection
modbus:
  - name: modbus_hub
    type: rtuovertcp
    host: 192.168.1.250
    port: 502
    sensors:
      - name: Sensor1
        unit_of_measurement: °C
        slave: 1
        address: 008  

    delay: 0
    message_wait_milliseconds: 30
    timeout: 5

I then added 

modbus: !include modbus.yaml   in to my configuration.yaml .

What do I do with it ? Where would my sensor1 show up ?   I think 008 should be for the rated power... 

 

 

Edited by Perfo

  • Author

That module USR-DR302 is indeed reasonable from AliExpress (£10 GBP + £5 delivery)  . have you seen (or had a go yourself of course)   this being used on a SunSynk inverter ?  

Excellent Idea about using Slipx's yaml if it is Modbus over ethernet then it shouldn't care what device it's talking to (ie my adapter or an esp32)  as long as it conforms to the Modbus protocols.. I'll go and have a loo at that.. 

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.