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.

Connect Home Assistant with Sunsynk

Featured Replies

  • Author

As far as the storage goes. The add-on it self does not store any information. It downloads a JSON string, parses the information and then submits it to HA entities via the Home Assistant's API and then deletes the file again when its done.

Any entity created by the addon is temporary and will disappear by it self when you reboot. Once you post to an entity that that was removed after a reboot, it will simply come back again (With historical data)

The addon does not use any templating. It simply uses the API to send data to HA.

 

Its simple actually.

Example of the battery voltage being sent to Home assistant.
The $Variables are replaced with the config you provide in the add-on config screen and obviously the actual value of the entity $battery_voltage comes from sunsynk.net

curl -s -k -X POST -H "Authorization: Bearer $HA_LongLiveToken" -H "Content-Type: application/json" -d '{"attributes": {"device_class": "voltage", "state_class":"measurement", "unit_of_measurement": "V", "friendly_name": "Battery Voltage"}, "state": "'"$battery_voltage"'"}' $HTTP_Connect_Type://$Home_Assistant_IP:$Home_Assistant_PORT/api/states/sensor.solarsynk_"$inverter_serial"_battery_voltage $EntityLogOutput

 

I will take a look to see what's possible with the configuration screen to select the type of system. The script for this is just a bash script and I'm not using any proper coding languages so when it comes to managing conditional statements and loops things become a little unconventional and super tedious and turns into a spaghetti mess 😀

The reason doing it this way is to make sure that there are ZERO dependencies. Linux environments tend to rely on library upon library. Fortunately a default docker has just enough to accomplish this add-on without having to install extra stuff.

With regards to the unique ID.

Although the "friendly name" is not unique the entity ID has the serial number of the inverter embedded

See below

$HTTP_Connect_Type://$Home_Assistant_IP:$Home_Assistant_PORT/api/states/sensor.solarsynk_"$inverter_serial"_battery_voltage


It's probably a good idea to embed the site name into the friendly name.  But once I do that everyone who is using this addon may have to remap their cards. But its possible that cards don't care about the friendly name as long as the entity ID remains the same.

 

 

 

 

Edited by MartinViljoen

  • Replies 97
  • Views 24.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • MartinViljoen
    MartinViljoen

    I made a major change to this add-on which resulted to a change in the entity names. Therefore I copied it over to a new repository and versioned it v2. The new version supports multiple inverters.

  • MartinViljoen
    MartinViljoen

    Update 2.1.8 now available. https://github.com/martinville/solarsynkv2 This update lets you send  inverter settings back to your inverter via HA -> SunsynkCloud -> Your inverter If you st

  • Giving it a go quickly. Worked well and recommend for someone not wanting to go through the whole node red process.

Posted Images

14 hours ago, MartinViljoen said:

Anyone care to vote ?

...

What's you opinion ?

 

I'd say that a single source repository is going to be easiest to maintain.

However, it feels like there is maybe a different way of achieving this.

Keep in mind I know nothing about HA development, but I'd be surprised if there isn't a way to have optional entities. Maybe determined by the config?

Also, I'm not sure of the difference between Add-ons and Integrations.

But Most other things of this type (Octopus, MyEnergi, Hive) are Integrations in HA, do they work differently? Maybe they have better control of the entities?

Edited by jJasG

  • 2 months later...

Hello Martin.

Thanks so much for this great integration for SS inverters! :)
I can now write settings to my 12kW 3p inverter from HA thanks to your response to my email and link to this page! 👏
This helps me a lot and I can now automate a few parameter settings to my needs.  

Thanks so much for your great work! 🤩
All the best from Norway.
Jon B
 

  • 3 weeks later...

Hi Martin.

 

The Addon works so well. Thank you for your work and time on this.

 

I have however just logged into my HA and I see none of my sensors are polling now. 

 

It was perfect for 2 or 3 days.

 

See image attached. 

 

What could be the cause of this ?

 

 

Screenshot_20240715_135150_Home Assistant.jpg

  • Author

I'm not sure.

Perhaps the following may help you identify the issue.
The entities where data is posted to are all static. If you reboot they will disappear (History remains though) until the add-on post to them again they will come back along with the history.
 

So could it be that your HA server was rebooted ? and the addon was not set to start automatically and at the time you looked at the entities ?

On your screenshot its also showing that your HA app is disconnecting , is everything stable with your network ?

Hi all,

just one note. My auto-generated password for the Sunsynk portal contained a 

"

which made it impossible for the addon to connect. Took me some time to figure that one out and actually read my password for once. 

  • 1 month later...

Hello,

I have recently had my solar and inverter installed and am looking into how best to control the system with HA. Just moved to Octopus Flux, so would be interested in controlling charge/disharge rates and times - similar as can be done with the 'SmartDeyeDongle v4' - https://www.youtube.com/watch?v=IktkBl3inTA&ab_channel=SmartHomeIntegrations

Is it possible to set up similar control with this add on? I've used HA for a year or so (mostly for linking devices from different brands), but never ventured too much into custom automations. I've installed the add on, and it appears entities are being read correctly, but I'm struggling with how to write settings to the inverter.

If I can't, then I guess i'll buy the SmartDeyeDonglev4 and replace the exisitng Sunsynk dongle, although it seems a shame when control can be done through the Sunsynk and there's a 2 week delivery on the new dongle!

Hello,

I have recently had my solar and inverter installed and am looking into how best to control the system with HA. Just moved to octopus flux, so would be interested in controlling charge/disharge rates and times - similar as can be done with the 'SmartDeyeDongle v4' - https://www.youtube.com/watch?v=IktkBl3inTA&ab_channel=SmartHomeIntegrations

Is it possible to set up similar control with this add on? I've used HA for a year or so (mostly for linking devices from different brands), but never ventured too much into custom automations. I've installed the add on, and it appears entities are being read correctly, but I'nm struggling with how to write settings to the inverter.

If I can't, then I guess i'll buy the SmartDeyeDonglev4 and replace the exisitng Sunsynk dongle, although it seems a shame when control can be done through the Sunsynk and there's a 2 week delivery on the new dongle!

  • 2 weeks later...
  • Author
On 2024/09/06 at 3:00 AM, SunsynkDongler2 said:

Hello,

I have recently had my solar and inverter installed and am looking into how best to control the system with HA. Just moved to octopus flux, so would be interested in controlling charge/disharge rates and times - similar as can be done with the 'SmartDeyeDongle v4' - https://www.youtube.com/watch?v=IktkBl3inTA&ab_channel=SmartHomeIntegrations

Is it possible to set up similar control with this add on? I've used HA for a year or so (mostly for linking devices from different brands), but never ventured too much into custom automations. I've installed the add on, and it appears entities are being read correctly, but I'nm struggling with how to write settings to the inverter.

If I can't, then I guess i'll buy the SmartDeyeDonglev4 and replace the exisitng Sunsynk dongle, although it seems a shame when control can be done through the Sunsynk and there's a 2 week delivery on the new dongle!

Hi its possible to change settings using this addon, i just havent had the time to create documentation for it. Will try my best to create an example for you tomorrow evening. 

  • 3 weeks later...
On 2024/09/16 at 6:58 PM, MartinViljoen said:

Hi its possible to change settings using this addon, i just havent had the time to create documentation for it. Will try my best to create an example for you tomorrow evening. 

Hi Martin,

I am very interested in this too. I have tried to change one thing as a test and it didn’t work. I tried to change the grid 5 charge to true using {“prog5_charge”: “true”}  I’m so close but need a little extra tuition 

  • 2 weeks later...

@MartinViljoen,

 

Firstly, great add-on. Works wonders, but....

As an Add-on it works and I managed to sort out my father-in-law's queries, but this does require an always-on server set up and if you are like me and not running RaspberryPI it is a hassle.

I use a qNAP home server that runs the Home Assist, this is quite a nice setup and has an online time of nearly 100% at this stage. The problem here is that it only runs HA core, this does not allow for Add-ons... (Unless someone can help me here on how to do it, then easy!)

The question here is, is it possible to change the Add-on configuration to an integration? This would allow some like myself to do an "integration" as opposed to going the add-on route? This would allow users of HACS to also use this... 

 

 

  • Author
8 hours ago, Rautenk said:

@MartinViljoen,

 

Firstly, great add-on. Works wonders, but....

As an Add-on it works and I managed to sort out my father-in-law's queries, but this does require an always-on server set up and if you are like me and not running RaspberryPI it is a hassle.

I use a qNAP home server that runs the Home Assist, this is quite a nice setup and has an online time of nearly 100% at this stage. The problem here is that it only runs HA core, this does not allow for Add-ons... (Unless someone can help me here on how to do it, then easy!)

The question here is, is it possible to change the Add-on configuration to an integration? This would allow some like myself to do an "integration" as opposed to going the add-on route? This would allow users of HACS to also use this... 

 

 

Thank you for the feedback. I must mention that I'm not as familiar with Home Assistant as most people so I don't know the lingo yet 🙂
I.E when you say "is it possible to change the Add-on configuration to an integration?" In terms of Home assistant what is the difference ? Are integrations "installable" from an external source ?

From a user perspective, would it be inconvenient to run an ESP32 plugged into a USB port on your qNAP? Not specifically a qNAP any usb port to provide power to an eSP32 will do even a cellphone charger will work.

 

Example:
Here I have an ESP32 which basically replicates what the addon does but externally. It simply grabs the data from the sunsynk cloud via Wifi and then pushes it to HA via HA's Entity API (HTTP) I'm sure the core version of HA allows you to populate entities via API

spacer.png
 

Its running right now as we speak.

spacer.png

+

Edited by MartinViljoen

  • Author
On 2024/10/06 at 10:59 AM, Iain s said:

Hi Martin,

I am very interested in this too. I have tried to change one thing as a test and it didn’t work. I tried to change the grid 5 charge to true using {“prog5_charge”: “true”}  I’m so close but need a little extra tuition 

I havent forgotten about this.
There is a small issue. The Sunsynk api does not like it if you try updating a single setting. It seems it wants you to update a batch of settings. Also the Automation and scenes screen is limited to a certain amount of characters not allowing you to post the entire set of settings due to the character limitation in HA. Not sure how to get around this yet.

Hence I started working on an external "Add-on less" solution that runs on an ESP32 as mentioned in the post before this one.

 

Hi Martin

I have 2 inverters, and followed your guide. The log file said I need to create a helper for both, which I did. Now it says the helpers have no values.

I have replaced my inverter SN with the 3 x's for this post

Entity does not exist! Manually create it for this inverter using the HA GUI in menu [Settings] -> [Devices & Services] -> [Helpers] tab -> [+ CREATE HELPER]. Choose [Text] and name it [solarsynk_xxx_inverter_settings]
Settings pushback system aborted. Note this is not an error, setting up inverter settings push back is optional. It just means you omitted this part of the setup.

Helper entity input_text.solarsynk_xxx_inverter_settings has no value. Therefore no inverter setting will be sent for change.

Updating Helper: input_text.solarsynk_xxx_inverter_settings with: unknown
{
  "code": 500,
  "msg": "Internal Server Error",
  "data": null,
  "success": false
}

Regards

Edited by DoubleP
adding extra information

  • Author

Hi , The reason for creating the helper is so that you have a place to store and tell the addon which settings you want to send to the inverter.

If you set the helper to JSON {"batteryCap": "100"} it will update the settings and set the battery capacity to 100 
After it reads the value of the helper it will then clear it out so that on the next loop it will not send the setting again.

Typically you have some automation which gets triggered based on certain conditions which will then set the value that you want to send to the inverter.

 

Be warned though, HA helper values have a character limit and many settings cannot just be sent on their own it needs to be sent with other settings else it will simply not be applied. In some cases this exceeds the character limit of the helper which then makes it impossible to update some settings.

 

Example of some settings I just sent.

spacer.png

 

 

  • 2 weeks later...
  • 2 weeks later...
  • Author

My setup unfortunately does not have an essential load, So it don't have a way to include it. 
I was able to add MPPT3 , MPPT4 , Phase 2 and Phase 3 because someone on the forum was kind enough to share their credentials so that I can extract the data points.


 

  • Author
23 hours ago, GreenFields said:

UPS power is the essential load I would have thought.

I dont think so. But I just added UPS power now as well.

Added the following 
 

2024/11/13

Version "2.1.19" - Added more entities Load UPS PowerL1 Load UPS PowerL2 Load UPS PowerL3 Load UPS Total Power

 

 

 
I started using this add on yesterday but keep getting this in the logs. I am still able to view the values in homeassistant. 
I also changed the update interval in the add-on and the gateway to 60s but still only getting new values every 5 to 6 minutes don't know if this has something to do with it. 
Thank you
 
Data fetched for serial ******. Enable verbose logging to see more information.
jq: error: syntax error, unexpected end of file, expecting FORMAT or QQSTRING_START or '[' (Unix shell quoting issues?) at <top-level>, line 1:
.data.
jq: 1 compile error
/run.sh: line 160: [: ==: unary operator expected
jq: error: syntax error, unexpected end of file, expecting FORMAT or QQSTRING_START or '[' (Unix shell quoting issues?) at <top-level>, line 1:
.data.
jq: 1 compile error
/run.sh: line 175: [: ==: unary operator expected
  • Author
12 hours ago, Rapt0rx said:
 
I started using this add on yesterday but keep getting this in the logs. I am still able to view the values in homeassistant. 
I also changed the update interval in the add-on and the gateway to 60s but still only getting new values every 5 to 6 minutes don't know if this has something to do with it. 
Thank you
 
Data fetched for serial ******. Enable verbose logging to see more information.
jq: error: syntax error, unexpected end of file, expecting FORMAT or QQSTRING_START or '[' (Unix shell quoting issues?) at <top-level>, line 1:
.data.
jq: 1 compile error
/run.sh: line 160: [: ==: unary operator expected
jq: error: syntax error, unexpected end of file, expecting FORMAT or QQSTRING_START or '[' (Unix shell quoting issues?) at <top-level>, line 1:
.data.
jq: 1 compile error
/run.sh: line 175: [: ==: unary operator expected

Thanks, I fixed the error. If you update it will hopefully not show the error anymore.

With regards to the update rate. You also have to set the update rate to 60s on the sunsynk portal. 

7 hours ago, MartinViljoen said:

Thanks, I fixed the error. If you update it will hopefully not show the error anymore.

With regards to the update rate. You also have to set the update rate to 60s on the sunsynk portal. 

Thank you. 

I changed the update time here .sunsynk.net/device/gateway

Is there another place it needs to be changed. 

On 2024/11/13 at 5:41 PM, MartinViljoen said:

I dont think so. But I just added UPS power now as well.

Added the following 
 

2024/11/13

Version "2.1.19" - Added more entities Load UPS PowerL1 Load UPS PowerL2 Load UPS PowerL3 Load UPS Total Power

 

 

Cool - thank you.
I now have essential power (UPS total power) and with a bit of arithmetic non-essential load too.

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.