Home Assistant,  Sunsynk,  Sunsynk Add-on

SolarSynk Add-on

Install the Add-on

Inside Home Assistant go to Settings –> Add-on –> Ass-on Store.
In the top right corner click the 3 dots and select Repositories.

SolarSynk is not part of the Home Assistant Add-on community so you need to add the Repositorie.

The Reposoty can be added by adding the URL and clicking Add

https://github.com/martinville/solarsynkv2

It has now been added so you can close that screen

Refresh the Add-on Store screen till you can see the SolarSynk Add-on at the bottom of the page

Click on the Add-on then click Install to install it.

After the installation you need to set “Start on boot” and “Watchdog”.

Now go into Configuration and add the details below in the GUI (Do not edit in yaml as it did not work for me with the Long-Lived Access Token.

sunsynk_user: "sunsynk@chriswilmot.co.uk"
sunsynk_pass: "SUPERSECRETPASSWORD"
sunsynk_serial: "0123456789"
Home_Assistant_IP: 192.168.1.1
Home_Assistant_PORT: 8123
HA_LongLiveToken: "HOME ASSISTANT LONG-LIVED ACCESS TOKEN"
Refresh_rate: 300
Enable_HTTPS: false
Enable_Verbose_Log: false

To get a Long-Lived Access Token click your name in Home-Assistant
Select Security at the top

Scroll down to Long-Lived Access Tokens

Click Create Token and give it an appropriate name

Copy the Access Token and add it to HOME ASSISTANT LONG-LIVED ACCESS TOKEN

Save the settings then go back to the info tab and start the Add-on

Now go to the Log Tab and check it is working

If it is working you will see the following in the log page

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started

------------------------------------------------------------------------------
-- SolarSynk - Log
------------------------------------------------------------------------------
Script execution date & time: 15/04/2024 19:03:16
Verbose logging is set to: false
HTTP Connect type: http
Getting bearer token from solar service provider's API.
Bearer Token length: 27
Sunsynk Server API Token: cOwOQBhUoOkWEnRtAt3SSh4yv1w
Refresh rate set to: 60 seconds.
Note: Setting the refresh rate lower than the update rate of SunSynk is pointless and will just result in wasted disk space.

Fetching data for serial: 0123456789
Cleaning up old data.
Please wait while curl is fetching input, grid, load, battery & output data...
------------------------------------------------------------------------------
Inverter Information
Brand: Deye
Status: Normal
Max Watts: 3600
Plant ID: 123456
Plant Name: My Plant
Inverter S/N: 0123456789
------------------------------------------------------------------------------
Data fetched for serial 0123456789. Enable verbose logging to see more information.

Now in Home Assistant go to Settings –> Devices & Services and select the Entities Tab

Filter for solarsynk and you will see all the new entities.

Install Power Flow Card

Go to HACS (If you have not installed HACS and need help click HERE)

Select Front End

Then Explore & Download Repositories

Search for sunsynk-ower-flow-card and select it

Click Download in the bottom right

Then Download again

Click Reload to reload the screen and allow it to be used in Home Assistant

Create PV Total

This Add-on is missing the PV total when you have more than 1 string

See the Add Entities Post then add the code below to the configuration.yaml

sensor:
  platform: template
  sensors:
    solarsynk_inverter_total_pv_power:
      friendly_name: "Solarsynk Inverter Total PV Power"
      unit_of_measurement: W
      device_class: power
      value_template: "{{ states('sensor.solarsynk_0123456789_pv1_power')| float +  states('sensor.solarsynk_0123456789_pv2_power')| float }}"

Create a Dashboard

In Home-Assistant go to Settings –> Dashboards and click Add Dashboard

Select New dashboard from scratch

Give your new dashboard a name and select an icon

Now in the side menu, you will see an item with the name you provided above

Click the new dashboard and select the pencil in the top right

Click Add Card at the Bottom right

Search for Manual card (You can edit this in the GUI but the code is below for you to just copy & paste)

Remove type: ” and replace it with the code below

type: custom:sunsynk-power-flow-card
dynamic_line_width: true
max_line_width: 3
cardstyle: full
panel_mode: true
large_font: true
show_solar: true
inverter:
  modern: true
  colour: black
  autarky: power
  model: sunsynk
battery:
  energy: 5320
  shutdown_soc: 20
  invert_power: true
  colour: '#918aff'
  show_daily: true
  animation_speed: 6
  max_power: 4500
  full_capacity: 95
  empty_capacity: 25
  show_remaining_energy: true
  charge_colour: '#238b21'
solar:
  dynamic_colour: true
  auto_scale: true
  colour: '#43d448'
  show_daily: true
  mppts: 2
  animation_speed: 9
  max_power: 4000
  pv1_name: South
  pv2_name: South
load:
  dynamic_colour: true
  colour: '#fbaeae'
  show_daily: true
  show_daily_aux: false
  show_aux: false
  invert_aux: false
grid:
  export_colour: green
  colour: red
  show_daily_buy: true
  show_daily_sell: true
  no_grid_colour: '#a40013'
  show_nonessential: false
  invert_grid: false
  animation_speed: 8
  max_power: 3600
entities:
  grid_connected_status_194: sensor.solarsynk_inverter_grid_connected_status
  use_timer_248: sensor.solarsynk_inverter_use_timer
  day_battery_charge_70: sensor.solarsynk_inverter_day_battery_charge
  day_battery_discharge_71: sensor.solarsynk_inverter_day_battery_discharge
  day_load_energy_84: sensor.solarsynk_inverter_day_load_energy
  day_grid_import_76: sensor.solarsynk_inverter_day_grid_import
  day_grid_export_77: sensor.solarsynk_inverter_day_grid_export
  day_pv_energy_108: sensor.solarsynk_inverter_day_pv_energy
  inverter_voltage_154: sensor.solarsynk_inverter_grid_voltage
  load_frequency_192: sensor.solarsynk_inverter_inverter_frequency
  inverter_current_164: sensor.solarsynk_inverter_inverter_current
  inverter_power_175: sensor.solarsynk_inverter_load_power
  grid_power_169: sensor.solarsynk_inverter_grid_power
  pv1_power_186: sensor.solarsynk_inverter_pv1_power
  pv2_power_187: sensor.solarsynk_inverter_pv2_power
  pv3_power_188: none
  pv4_power_189: none
  pv_total: sensor.solarsynk_inverter_total_pv_power
  pv1_voltage_109: sensor.solarsynk_inverter_pv1_voltage
  pv1_current_110: sensor.solarsynk_inverter_pv1_current
  pv2_voltage_111: sensor.solarsynk_inverter_pv2_voltage
  pv2_current_112: sensor.solarsynk_inverter_pv2_current
  pv3_voltage_113: none
  pv3_current_114: none
  pv4_voltage_115: none
  pv4_current_116: none
  battery_voltage_183: sensor.solarsynk_inverter_battery_voltage
  battery_soc_184: sensor.solarsynk_inverter_battery_soc
  battery_power_190: sensor.solarsynk_inverter_battery_power
  battery_current_191: sensor.solarsynk_inverter_battery_current
  essential_power: sensor.solarsynk_inverter_load_power
  grid_ct_power_172: sensor.solarsynk_inverter_grid_power
  inverter_status_59: sensor.solarsynk_inverter_overall_state
  remaining_solar: null
  battery_temp_182: sensor.solarsynk_inverter_battery_temperature
  radiator_temp_91: sensor.solarsynk_inverter_ac_temperature
  dc_transformer_temp_90: sensor.solarsynk_inverter_dc_temperature
  prog1_time: sensor.solarsynk_inverter_prog1_time
  prog1_capacity: sensor.solarsynk_inverter_prog1_capacity
  prog1_charge: sensor.solarsynk_inverter_prog1_charge
  prog2_time: sensor.solarsynk_inverter_prog2_time
  prog2_capacity: sensor.solarsynk_inverter_prog2_capacity
  prog2_charge: sensor.solarsynk_inverter_prog2_charge
  prog3_time: sensor.solarsynk_inverter_prog3_time
  prog3_capacity: sensor.solarsynk_inverter_prog3_capacity
  prog3_charge: sensor.solarsynk_inverter_prog3_charge
  prog4_time: sensor.solarsynk_inverter_prog4_time
  prog4_capacity: sensor.solarsynk_inverter_prog4_capacity
  prog4_charge: sensor.solarsynk_inverter_prog4_charge
  prog5_time: sensor.solarsynk_inverter_prog5_time
  prog5_capacity: sensor.solarsynk_inverter_prog5_capacity
  prog5_charge: sensor.solarsynk_inverter_prog5_charge
  prog6_time: sensor.solarsynk_inverter_prog6_time
  prog6_capacity: sensor.solarsynk_inverter_prog6_capacity
  prog6_charge: sensor.solarsynk_inverter_prog6_charge
  energy_cost: sensor.grid_energy_out_daily_cost_cost
  solar_sell_247: input_boolean.grid_export_enabled

Please feel free to play around with the above to give you the best result appropriate for your enviroment.
The instructions can be found HERE

In the code section and press CTRL & F or CMD & F on Mac
find: _inverter_
Replace with: _YOUR INVERTER_SN_
In the code section and press CTRL & F or CMD & F on Mac
find: _inverter_
Replace with: _YOUR INVERTER_SN_

Then click Replace All button

The end result will look something like this.

Leave a Reply

Your email address will not be published. Required fields are marked *