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

  • Author

Hmm that one is in my automation script. I will look tomorrow and move it to the gather scripts

I have allready created a login on the "new" area site and think I have it figured out. I did a quick run earlier and all seemed ok. Will wait for them to move my proper account accross, but I think I have the major work done.

Did a whole lot of changes today to put all the gather url's in one place and configurable. So any changes needed should be easy now. 

Edited by Gary Waterworth

  • Replies 948
  • Views 131.6k
  • 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

3 minutes ago, Gary Waterworth said:

Hmm that one is in my automation script. I will look tomorrow and move it to the gather scripts

I have just added some of your automation scrips for Timer/SOC setting based on sun/weather. It is working well :)

Now I just need to create a toggle to force grid charge ON and ignore the timer settings for special circumstances. We do not have load shedding (yet) here in the UK.

Edited by randomfool

  • Author
Just now, randomfool said:

I have just added some of your automation scrips for Timer/SOC setting based on sun/weather.
Now I just need to create a toggle to force grid charge ON. We do not have load shedding (yet) here in the UK.

Yeah it is a pain here

Just keep in mind that all of this is done on my own and not approved by sunsynk/e-linter :)

One more question Gary...

splix06 linked a nice dashboard layout on his github.

223529017-0702437a-d12e-475a-8695-b617d8da4d97.png

I am trying to recreate something like this, but I keep coming unstuck as every time I use one of the "total" sensors it is a cumulative sensor which creates a compounding ladder view if that makes any sense.

  • Author
35 minutes ago, randomfool said:

One more question Gary...

splix06 linked a nice dashboard layout on his github.

223529017-0702437a-d12e-475a-8695-b617d8da4d97.png

I am trying to recreate something like this, but I keep coming unstuck as every time I use one of the "total" sensors it is a cumulative sensor which creates a compounding ladder view if that makes any sense.

 

Yes those forever totals are best for the energy graphs

There are daily and weekly totals as well in the main sensors in the attributes. Will have to try see how those graphs are being generated.

There are also ways to pull in the sunsynk graph data as well. Same as what I did for the temperature data.

Will look at it when I have some time

Edited by Gary Waterworth

46 minutes ago, Gary Waterworth said:

 

Yes those forever totals are best for the energy graphs

There are daily and weekly totals as well in the main sensors in the attributes. Will have to try see how those graphs are being generated.

There are also ways to pull in the sunsynk graph data as well. Same as what I did for the temperature data.

Will look at it when I have some time

Thank you.

Does the Free Forecast.Solar account provide enough information or do you require an trial account with API key? sensor.calculated_current_solar_pred is not working, which causes the solar prediction card to N/A.image.thumb.png.ccfd0e02a112ab60037f6099be771b1c.png

image.png.b00d258e2228174847236968b3a94d35.png

logs shows this:-

2023-03-20 13:48:42.233 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ ((float(states('sensor.power_production_now_2')) * 1 ) + (float(states('sensor.power_production_now')) * 1 ))|float }}' but no default was specified') while processing template 'Template("{{ ((float(states('sensor.power_production_now_2')) * 1 ) + (float(states('sensor.power_production_now')) * 1 ))|float }}")' for attribute '_attr_native_value' in entity 'sensor.calculated_current_solar_pred'

Unsure if this is related but reading online, it states "Starting in version 2021.12.0, you must specify the default value. If you don’t, and float cannot convert the value, it will be reported as an error message and the template will fail."

 

Edited by randomfool

  • Author

Actually Found a very quick answer for you using Apex Charts :)

Try this example. The long term statistics are available.

I dont see the point in making a parrallel system

Documentation : https://github.com/RomRider/apexcharts-card

type: custom:apexcharts-card
graph_span: 20day
stacked: true
yaxis:
  - id: first
    decimals: 1
    min: 0
span:
  end: day
header:
  show: true
  title: 20 Day Graph
  show_states: true
  colorize_states: true
all_series_config:
  stroke_width: 4
  opacity: 1
  group_by:
    func: diff
    duration: 1day
  show:
    legend_value: false
color_list:
  - cyan
  - blue
  - red
series:
  - entity: sensor.sunsynk_grid_total
    type: column
    name: Grid
  - entity: sensor.sunsynk_pv_total
    type: column
    name: PV
  - entity: sensor.sunsynk_load_total
    type: line
    name: Load

Edit : Added some more params so day = cal day

Edited by Gary Waterworth

  • Author
10 minutes ago, randomfool said:

Thank you.

Does the Free Forecast.Solar account provide enough information or do you require an trial account with API key? sensor.calculated_current_solar_pred is not working, which causes the solar prediction card to N/A.image.thumb.png.ccfd0e02a112ab60037f6099be771b1c.png

image.png.b00d258e2228174847236968b3a94d35.png

logs shows this:-

homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ ((float(states('sensor.power_production_now_2')) * 1 ) + (float(states('sensor.power_production_now')) * 1 ))|float }}' but no default was specified

2023-03-20 13:48:42.233 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ ((float(states('sensor.power_production_now_2')) * 1 ) + (float(states('sensor.power_production_now')) * 1 ))|float }}' but no default was specified') while processing template 'Template("{{ ((float(states('sensor.power_production_now_2')) * 1 ) + (float(states('sensor.power_production_now')) * 1 ))|float }}")' for attribute '_attr_native_value' in entity 'sensor.calculated_current_solar_pred'

 

 

I have an east and west set of panels configured. if you only have one set of panels you will need to change that template :

  - sensor:
      - name: "Calculated Current Solar Pred"
        unique_id: "sensor.calculated.current.solar.pred"
        state: >
         {{  float(states('sensor.power_production_now')   }}

Edited by Gary Waterworth

Thank you to all who have made this integration possible.

Comparing this (based on the wifi dongle) to the integration approaches based on the RS485 to USB or ESPHome devices, how quickly are the data available?

 

 

Updated 👌

Thanks everyone for the cards gonna try them and see what works best for me 👍

Dumb question time, but in the original iteration there was a node where you added the long lived access token (update sensor.sunsynk_access_token) to get things working.  I don't see it anymore or I'm looking over it.  Is it perhaps renamed or no longer relevant?

Just asking as the wiki still refers to it.  My stuff do work but that is because I just imported the new code and left the localhost settings un-ticked, so assuming all my stuff just got left as is when I got the warning during import.  Just thinking about it from the viewpoint of someone that needs to setup from scratch, it might be a bit confusing or am I just confusing myself 🤷‍♂️

15 minutes ago, -cK- said:

Updated 👌

Thanks everyone for the cards gonna try them and see what works best for me 👍

Dumb question time, but in the original iteration there was a node where you added the long lived access token (update sensor.sunsynk_access_token) to get things working.  I don't see it anymore or I'm looking over it.  Is it perhaps renamed or no longer relevant?

Just asking as the wiki still refers to it.  My stuff do work but that is because I just imported the new code and left the localhost settings un-ticked, so assuming all my stuff just got left as is when I got the warning during import.  Just thinking about it from the viewpoint of someone that needs to setup from scratch, it might be a bit confusing or am I just confusing myself 🤷‍♂️

Yeah its still required and available.

Edited by randomfool

Also minor update to hide the log errors for a few of the sensors, you need to update the configuration.yaml sensors as follows (I did them all just for completeness)

float

requires updating to:

float(0)

HA requires a default value.

Edited by randomfool

  • Author

You can set the 

1 hour ago, -cK- said:

Updated 👌

Thanks everyone for the cards gonna try them and see what works best for me 👍

Dumb question time, but in the original iteration there was a node where you added the long lived access token (update sensor.sunsynk_access_token) to get things working.  I don't see it anymore or I'm looking over it.  Is it perhaps renamed or no longer relevant?

Just asking as the wiki still refers to it.  My stuff do work but that is because I just imported the new code and left the localhost settings un-ticked, so assuming all my stuff just got left as is when I got the warning during import.  Just thinking about it from the viewpoint of someone that needs to setup from scratch, it might be a bit confusing or am I just confusing myself 🤷‍♂️

Let me check. Latest itteration doesnt need the sensor.sunsynk_access_token. It now uses context variables. I have done a ton of changes in the last few days to make it easier for when region 2 drops so that I dont have to change url's etc in a lot of places. I think I have everything needed, just need to run more tests when my login is migrated over.

There is a slight "annoyance" now, when you restart HA. you need 2 runs to get all of the data. So either 2 minutes or trigger twice. But after that everything is normal. There some nice technical reasons to tolerate this.

You may be thinking of the HA long lived token which you update in the web call.

Let me just check the wiki and refer back to another one that still exists :D

Edited by Gary Waterworth

Yea noticed the 2 runs when I first deployed the update and was thinking to myself oh no am I going to get stuck again mid way then saw everything firing up with with a big sigh of relief 😅

See you updated the wiki for us newbies, perfect👌

Edited by -cK-

  • Author
1 hour ago, randomfool said:

Also minor update to hide the log errors for a few of the sensors, you need to update the configuration.yaml sensors as follows (I did them all just for completeness)

float

requires updating to:

float(0)

HA requires a default value.

Dont do this. Live with the errors. This breaks long term statistics when you restart..

I have looked at a way to save values between restarts. Still looking into it.

Ask me I know :D. Remembered after the fact why I prefered them being an error to being 0 when you restarted lol

Busy fixing my energy stats now

image.png.0601da637a132be23a7bae7bb3a17427.png

Also end up with stuff like this :

If you dont set defaults then you just have a gap

image.png.17f0d1ea8dc668d1ebc28f1e83995efb.png

 

Edited by Gary Waterworth

1 hour ago, Gary Waterworth said:

Dont do this. Live with the errors. This breaks long term statistics when you restart..

I have looked at a way to save values between restarts. Still looking into it.

Ask me I know :D. Remembered after the fact why I prefered them being an error to being 0 when you restarted lol

Busy fixing my energy stats now

image.png.0601da637a132be23a7bae7bb3a17427.png

Also end up with stuff like this :

If you dont set defaults then you just have a gap

image.png.17f0d1ea8dc668d1ebc28f1e83995efb.png

 

Thanks for the explanation. I'll revert the changes and ignore the errors, although so far I haven't spotted any anomalies. 

2 hours ago, randomfool said:

Thanks for the explanation. I'll revert the changes and ignore the errors, although so far I haven't spotted any anomalies. 

Is there a way to mute a warning in ha? This one occurs all the time.

2023-03-21 23:24:13.682 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for sensor.sunsynk_temp_data exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

Edited by randomfool

  • Author
3 hours ago, randomfool said:

Is there a way to mute a warning in ha? This one occurs all the time.

2023-03-21 23:24:13.682 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for sensor.sunsynk_temp_data exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

Ok that is the ac Dc temperature graph data I pull in from the website. Will disable that in a few hours and see how I can handle it differently

  • Author
1 hour ago, Gary Waterworth said:

Ok that is the ac Dc temperature graph data I pull in from the website. Will disable that in a few hours and see how I can handle it differently

Removed the temp graph data that is retrieved from the website.

Created 2 new sensors so that historical data will get updated normally

Changed AC DC Temperature card.

 

In case you have extra data ( Should be purged after 10 days anyway ) . Install the SQLLite Web addon

Then run this query

DELETE FROM states WHERE entity_id="sensor.sunsynk_temp_data";

Edited by Gary Waterworth

8 hours ago, Gary Waterworth said:

Thanks Gary. Have to say I wouldn't of known where to begin but working on this setup for HA has opened a whole new world for me to explore with home automation. Its genuinely really impressive. 

Now I need to work out how to automatically enable grid export mode based on a timer, in the UK its profitable to take from the grid overnight when its cheap then export the battery in the morning, profiting the difference. I'd probably tie this into the weather so would only do this if it was a sunny/partly sunny day when I knew PV would subsequently recharge the battery and provide my home requirements as it would otherwise be a false economy.

 

Edited by randomfool

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.