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.

SunSynk Logger Integration into Home Assistant

Featured Replies

19 minutes ago, -cK- said:

Trying to figure out why the monthly card isn't populating because to me it looks like it is pointing to the daily totals and if I understand slipx correctly it should update daily and then at the end of the month you end up with your montly total?

Any ideas what the issue might be

image.thumb.png.3d4881e5e27b4481a1af26b3e08f92b2.png

image.thumb.png.8ca4cb053a6063373a470dd2dad7cd22.png

Have you tried creating a monthly view for just one sensor?

type: custom:plotly-graph
view_layout:
  grid-area: daily
entities:
  - entity: sensor.daily_pv_power_kwh
    statistic: sum
    name: |
      $fn ({ ys,meta }) =>
        "Solar" + "" + "(" +ys[ys.length - 1]+"kWh)"
    period: month
    type: bar
    texttemplate: '%{y}'
    filters:
      - delta
    marker:
      color: rgb(255, 155, 48)
hours_to_show: 12M
title: Daily PV Power
refresh_interval: 600
defaults:
  yaxes:
    fixedrange: true
layout:
  legend:
    bgcolor: rgba(0,0,0,0)
    itemsizing: constant
    font:
      size: 11
  height: 410
config:
  displayModeBar: false
  scrollZoom: false

image.thumb.png.e8eb174a6c8670e6d0530d24e20e996e.png

** Ignore the graph Title

Edited by slipx

  • Replies 948
  • Views 131.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • randomfool
    randomfool

    I am making good progress on converting slip06x excellent dashboard to work with Gary's brilliant work on gathering the data from the latest Sunsynk inverters remotely. Will publish the dashboard

  • @Gary Waterworth   Did a quick YouTube video on how to install your software and to get the data into HASS, no cards or anything so very basic.  Please let me know what you guys think of my first

  • randomfool
    randomfool

    Ok here goes; caveats to begin with - I am no HA expert, in fact I only discovered HA a few weeks ago through Gary's post and his subsequent links to slip06x dashboard, so my ability to provide "suppo

Posted Images

@-cK- Thanks yes, I've updated the long life token.  

The first error is at Plant ID the last is at get bearer token account or password error with multiple errors between the two. 

4/23/2023, 8:09:37 PMnode: Setup Global Varsfunction : (error)
"Plant ID"
4/23/2023, 8:09:37 PMnode: Setup Global Varsfunction : (error)
"Inv 1 SN"
4/23/2023, 8:09:37 PMnode: Create Request for Loginfunction : (error)
{ _msgid: "76d442807dc196e1", url: "https://api.sunsynk.net/oauth/…", payload: object }
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Logger Not Online - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Input) - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Grid) - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Load) - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Flow) - Error With Data "
4/23/2023, 8:09:38 PMnode: Get Bearer Tokenfunction : (error)
{ state: "Account or password error", data: object }

If I set it to a Month I get nothing

image.thumb.png.f6e8387b182770467ff7d7d304d8debd.png

If I set it to Day or Week I get data

image.thumb.png.e48e143d637e64ff8f69e9d36246f287.png

image.thumb.png.ad056876bf19b929c905d15194908e7b.png

Trying the first suggestions did kick out this:

image.thumb.png.a1cb30d13c47dc59bb88e6c5488ac095.png

  • Key 'entities.0.statistic' is not expected or not supported by the visual editor.
  • Key 'entities.0.period' is not expected or not supported by the visual editor.
  • Key 'entities.0.type' is not expected or not supported by the visual editor.
  • Key 'entities.0.texttemplate' is not expected or not supported by the visual editor.
  • Key 'entities.0.filters' is not expected or not supported by the visual editor.
  • Key 'entities.0.marker' is not expected or not supported by the visual editor.
  • The provided value for 'entities.0' is not supported by the visual editor. We support (string) but received ({"entity":"sensor.sunsynk_load_today","statistic":"sum","name":"$fn ({ ys,meta }) =>\n \"Solar\" + \"\" + \"(\" +ys[ys.length - 1]+\"kWh)\"\n","period":"month","type":"bar","texttemplate":"%{y}","filters":["delta"],"marker":{"color":"rgb(255, 155, 48)"}}).
  • The provided value for 'hours_to_show' is not supported by the visual editor. We support (number) but received ("12M").
  • Key 'defaults' is not expected or not supported by the visual editor.
  • Key 'layout' is not expected or not supported by the visual editor.
  • Key 'config' is not expected or not supported by the visual editor.

You can still edit your config in YAML.

Edited by -cK-

4 minutes ago, slipx said:

Looks like you don't have enough data points, only a couple of days so you just have to wait.

Okay thought so after seeing the days and weeks working, patience was never my virtue 😁

 

Edited by -cK-

image.png.875d7ce811cbc87ff80bbc941a9e4b02.png

@SteveRCT just recheck your login credentials to be sure in the configuration file is correct both login and password. 

To me it looks like the login is failing but I'm not the expert.  If those are correct best would be to see if @Gary Waterworth pops in to assist you.  Might need to send him some debug info if it is not a simple resolution to the problem.

Where in the flow is it that it is not moving forward:

image.thumb.png.887b9bbe0bb72c231fd727fb543ded73.png

  • Author
1 hour ago, SteveRCT said:

@-cK- Thanks yes, I've updated the long life token.  

The first error is at Plant ID the last is at get bearer token account or password error with multiple errors between the two. 

4/23/2023, 8:09:37 PMnode: Setup Global Varsfunction : (error)
"Plant ID"
4/23/2023, 8:09:37 PMnode: Setup Global Varsfunction : (error)
"Inv 1 SN"
4/23/2023, 8:09:37 PMnode: Create Request for Loginfunction : (error)
{ _msgid: "76d442807dc196e1", url: "https://api.sunsynk.net/oauth/…", payload: object }
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Logger Not Online - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Input) - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Grid) - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Load) - Error With Data "
4/23/2023, 8:09:37 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Flow) - Error With Data "
4/23/2023, 8:09:38 PMnode: Get Bearer Tokenfunction : (error)
{ state: "Account or password error", data: object }

Hi

Based on this : 

4/23/2023, 8:09:37 PMnode: Create Request for Loginfunction : (error)

{ _msgid: "76d442807dc196e1", url: "https://api.sunsynk.net/oauth/…", payload: object }

You have used the region 2 node red flows. This wont work if you are still logging onto Region 1

Region 2 logs into https://api.sunsynk.net

Region 1 logs into : https://pv.inteless.com

I seem to recall you said you tested on region 1

I havent fully tested Region 2 yet as my plants have not been moved 😕 so I have nothing to test against. I have been a bit quiet on development until mine have moved 

Use teh one on this link : https://github.com/gdwaterworth/Home-Assistant---E-Linter-Logger---Sunsynk/blob/Stable-Release/E-Linter (Region 1) Region Compatible Flows/Gather Files/SunSynk Gather Flow.json

 

Edited by Gary Waterworth

  • Author
1 hour ago, slipx said:

You can also check using the statistics graph?

image.thumb.png.9465ca4f20b2ce4498cb88fa7bd9b8ac.png

Just some notes on the best attributes to use for statistics . 

Dont use the "today" ones. They reset sometimes at odd hours and it screws with the stats.

This is a royal PITA and I have spent too much time trying to make the today ones work.

One of a few quirks I have found with data from the sunsynk website.

Use the "forever" increasing ones that never reset like ( examples ):

They will have *total* in the name  

image.png.15df8b1498f11ab77291d4af69d14bee.png

 

image.png.9500afc8bf22fffec3986ab523e4ab8d.png

When you create the template that uses them. To setup as a energy ( statistic ) do it like this : 

  - sensor:
      - name: "Sunsynk Battery etotaldischg"
        state_class: total_increasing
        unique_id: "sensor.sunsynk_battery_etotaldischg"
        device_class: energy
        unit_of_measurement: kWh
        state: >
            {{state_attr('sensor.sunsynk_battery', 'etotaldischg')|float}}

NB 

state_class: total_increasing --> This then takes teh difference between the start and end measurement time to get the ammount used. 

Always make sure you convert the string to a float :) Been caught like this to often where I think it is dealing with a number when it isnt.

Always give it a unique ID. You end up with funny entity crap sometimes when you dont 

 

Edited by Gary Waterworth

  • Author
1 hour ago, -cK- said:

Okay thought so after seeing the days and weeks working, patience was never my virtue 😁

 

To check if you are getting data 

Development tools -> Stasistics -> Click on icon for entity

Will only see an icon like this for state class: total_increasing. 

You can use this to fix errors etc

image.thumb.png.c5da90f7c69736075d37594f3240c1cf.png

Should see some collected data points

image.png.2d5c000067db23ff597d0a1f08e247dc.png

 

Edited by Gary Waterworth

2 hours ago, -cK- said:

Okay thought so after seeing the days and weeks working, patience was never my virtue 😁

 

I think you'll just need to wait as slip06x said.

I've made quite a few improvements to mine since I posted the modified slip06x dashboard above. I'll upload it when I'm done.

I've added grid export for those who use that and Included some costs. I've also changed the layout about a bit to suit my needs more with octupus energy dashboards.

I've also got a basic automation working now with octupus energy for anyone who uses it.

Octupus also offer a feed in tariff based on half hourly prices for the subsequent day. So if there is an arbitrage opportunity where you earn more on the export than the cost of import I plan to automatically charge for 15 mins then turn on grid export based on battery soc levels e.g bring it in at 15p export it at 35p, profit 20p....I have done some very noddy stats but plan to create an arbitrage P&L apex chart using the import/export data and costs from the agile card. Might end up not being worth it, but time will tell. My noddy calculations tell me it will cover the standing charge costs.

 

 

 

Edited by randomfool

Thank you so much Gary, much appreciated I'll test today as I get home today. 

FYI I have 2x 5.5kw Sunsynk inverters in my plant i see on the wiki you were interested in debug info. I'll be happy to share once I'm up and running

  • Author
3 hours ago, SteveRCT said:

Thank you so much Gary, much appreciated I'll test today as I get home today. 

FYI I have 2x 5.5kw Sunsynk inverters in my plant i see on the wiki you were interested in debug info. I'll be happy to share once I'm up and running

Thanks 

 

The main sensors should eb fully populated, just keep in mind that the calculated ones dont cater for dual invertors atm. You may have to play a lot 

1 hour ago, slipx said:

You should also check out Plotly Graphs. 

image.png.78a2bfa9a1f0bd750bc1e14bc72345b9.png

Thanks will probably end up with a few custom Apex and Plotly cards spread out over a few dashboards using bits and pieces extracted from all of the above resources.  Testing out what works best for me and and eliminating what does not. 👍 I like things a bit more compartmentalized 😉

 

  

@Gary Waterworth Good eve, just got home to test the fix. I have copied the .json from the link you shared earlier.

I receive the exact same issue. You mention that because of the call to api.sunsynk that I may be using the region 2 json file, but same problem. I noticed this in the region 1 json (global.set(\"SS.url.hostname\",\"https://api.sunsynk.net\") ;\n global.set(\"SS.url.hostname\",\"https://pv.inteless.com\");\n\n ) should i delete the global.set(\"SS.url.hostname\",\"https://api.sunsynk.net\") ;\n  part? no clue what /n or /n/n means I don't code. 🙈

4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Plant ID"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Inv 1 SN"
4/24/2023, 4:49:55 PMnode: Create Request for Loginfunction : (error)
{ _msgid: "59b05ad2da75b68b", url: "https://api.sunsynk.net/oauth/…", payload: object }
4/24/2023, 4:49:55 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Logger Not Online - Error With Data "
4/24/2023, 4:49:55 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Input) - Error With Data "
4/24/2023, 4:49:55 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Grid) - Error With Data "
4/24/2023, 4:49:56 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Load) - Error With Data "
4/24/2023, 4:49:56 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Flow) - Error With Data "
4/24/2023, 4:49:56 PMnode: Get Bearer Tokenfunction : (error)
{ state: "Account or password error", data: object }
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Plant ID"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Inv 1 SN"
4/24/2023, 4:50:40 PMnode: Create Request for Loginfunction : (error)
{ _msgid: "79e91da1f3957eaf", url: "https://api.sunsynk.net/oauth/…", payload: object }
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Logger Not Online - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Input) - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Grid) - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Load) - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Flow) - Error With Data "
4/24/2023, 4:50:41 PMnode: Get Bearer Tokenfunction : (error)
{ state: "Account or password error", data: object }
  • Author
1 minute ago, SteveRCT said:

@Gary Waterworth Good eve, just got home to test the fix. I have copied the .json from the link you shared earlier.

I receive the exact same issue. You mention that because of the call to api.sunsynk that I may be using the region 2 json file, but same problem. I noticed this in the region 1 json (global.set(\"SS.url.hostname\",\"https://api.sunsynk.net\") ;\n global.set(\"SS.url.hostname\",\"https://pv.inteless.com\");\n\n ) should i delete the global.set(\"SS.url.hostname\",\"https://api.sunsynk.net\") ;\n  part? no clue what /n or /n/n means I don't code. 🙈

4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Plant ID"
4/24/2023, 4:49:55 PMnode: Setup Global Varsfunction : (error)
"Inv 1 SN"
4/24/2023, 4:49:55 PMnode: Create Request for Loginfunction : (error)
{ _msgid: "59b05ad2da75b68b", url: "https://api.sunsynk.net/oauth/…", payload: object }
4/24/2023, 4:49:55 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Logger Not Online - Error With Data "
4/24/2023, 4:49:55 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Input) - Error With Data "
4/24/2023, 4:49:55 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Grid) - Error With Data "
4/24/2023, 4:49:56 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Load) - Error With Data "
4/24/2023, 4:49:56 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Flow) - Error With Data "
4/24/2023, 4:49:56 PMnode: Get Bearer Tokenfunction : (error)
{ state: "Account or password error", data: object }
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"PlantID Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Invertor 1 Set"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Plant ID"
4/24/2023, 4:50:40 PMnode: Setup Global Varsfunction : (error)
"Inv 1 SN"
4/24/2023, 4:50:40 PMnode: Create Request for Loginfunction : (error)
{ _msgid: "79e91da1f3957eaf", url: "https://api.sunsynk.net/oauth/…", payload: object }
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Logger Not Online - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Input) - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Grid) - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Load) - Error With Data "
4/24/2023, 4:50:40 PMnode: Calc Last Update Time & General Status Checkfunction : (error)
"Input(Flow) - Error With Data "
4/24/2023, 4:50:41 PMnode: Get Bearer Tokenfunction : (error)
{ state: "Account or password error", data: object }

Let me look at this later 

Wonder if I got the uploads mixed up 

 

  • Author
4 minutes ago, Gary Waterworth said:

It may have been me, I was working on region 2 as well. 

I have reuploaded region 1 with a small change 

Try it and then send me a screenshot. The create login node should now show which host it is using 

Also dont try edit the json 

Far easier to edit in node red

I've purposefully redacted the user and pswd.  I can see the change you made but for some reason it's still screaming for api.sunsynk, even if I try changing the url in the textbox

  • Author

Remove teh url in that box. It is setup elsewhere. Show me a screenshot and debug without any changes being made. It doesn't help trying to change those http requests. They are setup in the coding. The authentication doesnt work the way you have tried either.

That is also the wrong url for region 1.

To double check you did import the template into your configuration.yaml as well ? 

Edited by Gary Waterworth

@Gary WaterworthI managed to get it all working I had to comment api.sunsynk and change pvinteless to uncommented in the 1st node all seems to be working really well now I can see mostly everything.  just assessing now about the 2 inverters and if it is tracking.

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.