Jump to content

SunSynk Logger Integration into Home Assistant


Gary Waterworth

Recommended Posts

Energy-Jason
This post was recognized by Energy-Jason!

Gary Waterworth was awarded the badge 'Superstar' and 25 points.

Hi All...

This is something I have been working on for a while based on my own work with some information gathered from others on this forum and probing what is available.

I have spent the last few days cleaning things up so that they can be easily imported into new environments 

There is a node red flow and a set of templates provided. 

Most plant/inverter information is available as a few main sensors with a lot of attributes on each 

Files etc are available on: https://github.com/gdwaterworth/Home-Assistant---E-Linter-Logger---Sunsynk

I have a seperate set of flows for updating the Sunsynk Settings, but these are NOT NOOB friendly. Also going through a lot of change atm

I have mainly been using those to ensure I always have battery soc available etc with the huge load shedding we have.

 

The current SunSynk Dongle is currently rebranded from e-linter.com.

http://e-linter.com/smart-energy/magpie

 

According to their about us, there are a few companies of invertors that are customers of theirs. Apparently compatible with the following invertors

image.thumb.png.96a7068cbb0f8483d6907c038d447f7d.png

image.thumb.png.6f3219a21f5c841ac8ec748b8888fbb4.png

image.thumb.png.0e946590a6620d29c8571cc5590d65b8.png

 

 

The quickest way to check would be to try login to https://pv.inteless.com/ and see if you can login to there. It may be you are actually using a rebranded dongle.

If so then this set of flows should get your invertor stats.

 

Edited by Gary Waterworth
New Repo
Link to comment
Share on other sites

  • 2 weeks later...

@Gary Waterworth Thank you so much for this - really appreciate your efforts! I have a couple of questions, more because I'm a NodeRed n00b - you've mentioned to add the templates.txt to the configuration.yaml file; however, I'm unsure which YAML file you're referring to. Is this under /config/?

Once that is complete, do these show up as entities or somewhere else in the HA UI?

Any ideas?

Edited by thedotlair
Link to comment
Share on other sites

7 hours ago, thedotlair said:

@Gary Waterworth Thank you so much for this - really appreciate your efforts! I have a couple of questions, more because I'm a NodeRed n00b - you've mentioned to add the templates.txt to the configuration.yaml file; however, I'm unsure which YAML file you're referring to. Is this under /config/?

Once that is complete, do these show up as entities or somewhere else in the HA UI?

Any ideas?

Once everything is done there will be a number of new entities.

There are about 7 core entities that will have a number of attributes for each of the load/input/output/grid/battery components of data from the logger

I have recreated the git repo to correctly reflect and will be adding better instructions with time

Unfortunately this one is not that noob friendly as it is not a integration you just go and add.

There are 2 components :

Gather - This just goes and gathers information from the logger website and makes it available for use. This is fairly straight forward to implement.

Automation - These are flows and code I have developed to manage soc and timer use for load balancing. This is not that straight forward as it has hard dependencies on other integrations . Weather being one of them

 

Edited by Gary Waterworth
Link to comment
Share on other sites

Thank for all the work @Gary Waterworth

Looks like a great option to connect Homer Assistant to your Sunsynk inverter.

I have a few questions on the configuration as I am no code monkey 🙂 

Can you tell me what data has to be added/changed in the templates.txt file before it is added into the configuration.yaml file. 

I am assuming your sunsynk.net username and password and your inverter serial number do I have to add any other values? 

 

 

 

Link to comment
Share on other sites

5 hours ago, Sc00bs said:

Thank for all the work @Gary Waterworth

Looks like a great option to connect Homer Assistant to your Sunsynk inverter.

I have a few questions on the configuration as I am no code monkey 🙂 

Can you tell me what data has to be added/changed in the templates.txt file before it is added into the configuration.yaml file. 

I am assuming your sunsynk.net username and password and your inverter serial number do I have to add any other values? 

 

 

 

Leave Inverter Serial Blank - It will populate from the 1st in the list

and the plant id

Only ones you should need are the login and password

 

Link to comment
Share on other sites

3 hours ago, Sc00bs said:

Seem to be missing the plant ID and plant list data for some reason 

image.png.164ded129f95fd9d67889b9509e667c2.png

Everything else is successful 

 

Put a debug node on the output of the "get plant list" and also link the output of the create request for getting plant info to the debug node as well

Just direct message me the output from the debug console . The Error is because the web call is not successful

It will stop anything else down the chain not executing

I suspect the node before is not being updated correctly : sensor.sunsynk_serial_number as that is used for that call

Did you install and configure the additional palette : node-red-contrib-hass with a long life token

 

Documentation for that addon is here :

https://flows.nodered.org/node/node-red-contrib-hass

Information of getting a long lived token is here :

https://community.home-assistant.io/t/how-to-get-long-lived-access-token/162159

 

 

Edited by Gary Waterworth
Link to comment
Share on other sites

If you are looking for these for the energy dashboard, rather use the "forever" totals. It is a lot more stable from a reset pov

Also dont use the sunsynk_flow sensor value as much as possible. I find those are the most unstable

I will have a look at the events :) I dont currently pull them but I can.

Export data is a lot more tricky, will have a look at it, but will need to see how to parse it into a sensor.

Daily totals are in the attributes for each main sensor, you can just create additional sensors in the templates :

image.thumb.png.42f76be9aea3650c2233a74a6dae1faa.png

sunsynk_grid

sunsynk_input

sunsynk_output

sunsynk_load

sunsynk_battery

 

Edited by Gary Waterworth
Link to comment
Share on other sites

Ah, i hadn't looked at the template file properly so i only just realised you are creating new sensors using the attributes of other sensors, makes sense now!

In which case i think we already have the export date under "sensor.sunsynk_grid", it's the etodayTo and etotalTo attributes, isn't it?

Link to comment
Share on other sites

10 hours ago, cp2023 said:

I'm also going to change "Sunsynk Grid Total" to use etotalFrom instead of just total, as this going to 1dp rather than just integer values. Unless there's a reason not to?

  - sensor:
      - name: "Sunsynk Grid Total"
        state_class: total_increasing
        device_class: energy
        unit_of_measurement: kWh
        state: >
            {{state_attr('sensor.sunsynk_grid', 'total')|int}}

You can remove the |int and change it to float ( if I remember correctly ) 

The main things needed for the energy dashboard is the 

        state_class: total_increasing
        device_class: energy
        unit_of_measurement: kWh

The main thing is you have to change it from a string to a value. Many ways to skin that cat.

total actually comes from etotalFrom in the gather code. This is a legacy thing caused by me and part of my converting from what I had before to these flows and not wanting to lose the historical data I had. These flows have gone through more than a few rewrites :) and I havent fully removed all of my old legacy stuff.

The nice thing with the way I populate the attributes is that you can manipulate them any which way you want/need with templates.

Also adding a 2nd invertor is not hard. It is basically copy and pasting a portion of the flows and creating a few more template entities. 

   msg.payload.attributes.total = parseInt(msg.payload.data.etotalFrom);
   msg.payload.attributes.volt = msg.payload.data.vip[0].volt;
   msg.payload.attributes.current = msg.payload.data.vip[0].current;

image.png.67c68c081929cfc48a125292d2bc389f.png

 

 

 

Edited by Gary Waterworth
Link to comment
Share on other sites

On 2023/02/22 at 9:02 PM, cp2023 said:

Also, what about export data, can't find that either.

so been doing some https decoding and the export (operation) data can be available.

Also the data for all the daily/month/yearly graphs is can be available.

Will have a look at more indepth requirements for apex graphs to decide how to bring this data into sensors

Just depends on what the use case is. It is going to be a bit of a pita getting it into a usable form in HA

 

image.thumb.png.2ecc5d8c791f0d835c3f8c1836590895.png

 

image.png.199b3380cc41815edc00c8538a6a2595.png

Edited by Gary Waterworth
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.

×
×
  • Create New...