SkillAgentSearch skills...

Sunsynk Home Assistant Dash

Home Assistant Dashboard to display Inverter information. ESPHome configuration to collect inverter sensor data via modbus

Install / Use

npx skills add slipx06/Sunsynk-Home-Assistant-Dash

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Inverter Home Assistant Dashboard

Home Assistant Dashboard to display Inverter data and Energy Usage.

Requires the following:

Cards:

  • Flexible Horseshoe Card (https://github.com/AmoebeLabs/flex-horseshoe-card). If this does not load see https://github.com/AmoebeLabs/flex-horseshoe-card/issues/88#issuecomment-2145334978
  • Sunsynk Power Flow Card (https://github.com/slipx06/Sunsynk-Home-Assistant-Power-Flow-Card)
  • Layout Card (https://github.com/thomasloven/lovelace-layout-card)
  • Plotly Graph Card (https://github.com/dbuezas/lovelace-plotly-graph-card)

Integrations:

Screenshots

image image image image

Installation

Data can be collected from the inverter using the RS485 port. There are a number of different ways to do this but I'm using an ESP32 chip running ESPHome. See Hardware and Wiring Guide below and ESPHome-1P-Sunsynk-Deye.yaml

Create a new view on your current Dashboard and set the view type to Panel (1 card) as shown below:

image

You can then edit the Dashboard (using the code editor) and paste the contents of the Dashboard. You'll need to adjust all the sensor names to match yours and install the necessary custom components.

Demo

layout_card

Hardware and Wiring Guide

Disclaimer: Proceed with caution. Working with electrical equipment carries inherent risks. If you are unsure about any step, consult a qualified professional. The author is not responsible for any damage to equipment or injury. ALWAYS consult your specific inverter's manual and VERIFY ALL voltages and polarities with a multimeter before making connections.

Required Components & Tools:

  • ESP-based board (e.g., AtomS3 Lite M5 Stack)
  • RS485 to TTL Converter (e.g., M5Stack Tail485, which accepts 12V)
  • Standard Ethernet Patch Cable (Cat5e or Cat6)
  • Tools: Wire strippers, wire cutters, small screwdriver (for terminal blocks), multimeter (essential for voltage/polarity checks).

Powering Your ESP Board & RS485 Converter:

  • The M5Stack AtomS3 Lite with Tail485 converter example accepts 12V input.
  • Many inverters provide an onboard 12V DC power source.
  • Consult your inverter's manual to locate a suitable 12V DC output and its Ground (GND) terminal. BEFORE CONNECTING ANYTHING: Use a multimeter to verify the output is indeed 12V DC (or the voltage your converter expects). Confirm the correct polarity of the 12V (+) and GND (-) terminals. Incorrect voltage or polarity can permanently damage your components.

Preparing the Ethernet Cable for RS485 Data:

  • Connect one end of the Ethernet cable to your inverter's RS485 port (this might be labeled RS485, BMS, Meter, etc. – check your manual).
  • Consult your inverter's manual to identify which pins on its port correspond to RS485 A+, RS485 B- as well as the pins for +12V (or other voltage) and GND. Note these down.
  • Carefully cut off the connector from the other end of the Ethernet cable.
  • Strip back about 1-2 inches (2-5 cm) of the outer jacket to expose the 4 twisted pairs of wires.
  • Using a standard Ethernet cable pinout diagram (e.g., T568B, easily found online) and the pin information from your inverter's manual, identify the colored wires that correspond to your inverter's RS485 A+, RS485 B- signals.

Connecting to the RS485 Converter (e.g., Tail485):

  • Connect the wire you identified as RS485 A+ (from the Ethernet cable) to the 'A' (or 'A+') terminal on your RS485 converter.
  • Connect the wire you identified as RS485 B- (from the Ethernet cable) to the 'B' (or 'B-') terminal on your RS485 converter.
  • Connect dedicated wires from the inverter's verified 12V and GND terminals to the VIN and GND of the RS485 converter.

Example Wiring: Solark 15K Inverter

Pinout

image

image

From the above picture, port 15 goes to the 12V port on the tail485, while port 16 goes to the Gnd.

InverterWiringDiagram

Additional Info

Added remaining battery time. You will need to add the following template sensor

- platform: template
  sensors:
    battery_cap:
      friendly_name: "Battery Capacity"
      value_template: >
        {% set grid_online = states('binary_sensor.sunsynk_grid_connected_status') %}
        {% if grid_online  == 'off'%}
          {{ states('sensor.sunsynk_battery_capacity_shutdown') | int }}
        {% else %}
          {% set now = strptime(as_timestamp(now()) | timestamp_custom('%H:%M'), '%H:%M') %}
          {% set sellTime1 = strptime(states('sensor.sunsynk_time_slot_1'), '%H:%M') %}
          {% set sellTime2 = strptime(states('sensor.sunsynk_time_slot_2'), '%H:%M') %}
          {% set sellTime3 = strptime(states('sensor.sunsynk_time_slot_3'), '%H:%M') %}
          {% set sellTime4 = strptime(states('sensor.sunsynk_time_slot_4'), '%H:%M') %}
          {% set sellTime5 = strptime(states('sensor.sunsynk_time_slot_5'), '%H:%M') %}
          {% set sellTime6 = strptime(states('sensor.sunsynk_time_slot_6'), '%H:%M') %}
          {% if now >= sellTime1 and now < sellTime2 %}
            {{ states('number.sunsynk_prog1_capacity') | int }}
          {% elif now >= sellTime2 and now < sellTime3 %}
            {{ states('number.sunsynk_prog2_capacity') | int }}
          {% elif now >= sellTime3 and now < sellTime4 %}
            {{ states('number.sunsynk_prog3_capacity') | int }}
          {% elif now >= sellTime4 and now < sellTime5 %}
            {{ states('number.sunsynk_prog4_capacity') | int }}
          {% elif now >= sellTime5 and now < sellTime6 %}
            {{ states('number.sunsynk_prog5_capacity') | int }}
          {% elif now >= sellTime6 or now < sellTime1 %}
            {{ states('number.sunsynk_prog6_capacity') | int }}
          {% else %}
            {{ states('sensor.sunsynk_battery_capacity_shutdown') | int }}
          {% endif %}
        {% endif %}
    soc_battery_time_left:
      friendly_name: "Battery Depletion Seconds"
      unit_of_measurement: Seconds
      value_template: >
        {% set state = states('sensor.sunsynk_battery_power') | int %}
        {% set cap = states('sensor.battery_cap') | float %}
        {% if state == 0 -%}
        {{ ((((states('sensor.sunsynk_battery_soc') | float - cap) /100) * 15960) / (1) * 60 * 60 ) | timestamp_custom('%s', 0) }}
        {%- else -%}
        {{ ((((states('sensor.sunsynk_battery_soc') | float - cap) /100) * 15960) / (states('sensor.sunsynk_battery_power') | float) * 60 * 60 ) | timestamp_custom('%s', 0) }}
        {%- endif %}
    soc_battery_time_left_friendly:
      friendly_name: "Battery Depletion Time"
      value_template: >
        {% set state = states('sensor.sunsynk_battery_power') | int %}
        {% if state > 0 -%}
        {%- set time = states('sensor.soc_battery_time_left') | int %}
        {%- set minutes = ((time % 3600) // 60) %}
        {%- set minutes = '{} minutes'.format(minutes) if minutes > 0 else '' %}
        {%- set hours = ((time % 86400) // 3600) %}
        {%- set hours = '{} hours, '.format(hours) if hours > 0 else '' %}
        {%- set days = (time // 86400) %}
        {%- set days = '{} day, '.format(days) if days > 0 else '' %}
        {{ 'Less than 1 minute' if time < 60 else days + hours + minutes }}
        {%- else -%}
        {{ 'Charging' }}
        {%- endif %}
    battery_charging_time_left:
      friendly_name: "Battery Charging Time Left"
      unit_of_measurement: Seconds
      value_template: >
        {% set power = states('sensor.sunsynk_battery_power') | float %}
        {% set soc = states('sensor.sunsynk_battery_soc') | float %}
        {% set cap = states('sensor.battery_cap') | float %}
        {% if power < 0 %}
          {% if soc < cap %}
            {{ ((((cap - soc) / 100) * 15960) / (-power) * 60 * 60) | int }}
          {% else %}
            {{ ((((100 - soc) / 100) * 15960) / (-power) * 60 * 60) | int }}
          {% endif %}
        {% else %}
          0
        {% endif %}
    battery_charging_time_left_friendly:
      friendly_name: "Battery Charging Time"
      value_template: >
        {% set state = states('sensor.sunsynk_battery_power') | int %}
        {% if state < 0 -%}
          {%- set time = states('sensor.battery_charging_time_left') | int %}
          {%- set minutes = ((time % 3600) // 60) %}
          {%- set minutes = '{} min'.format(minutes) if minutes > 0 else '' %}
          {%- set hours = ((time % 86400) // 3600) %}
          {%- set hours = '{} hrs, '.format(hours) if hours > 0 else '' %}
          {%- set days = (time // 86400) %}
          {%- set days = '{} day, '.format(days) if days > 0 else '' %}
          {{ 'Floating' if time < 60 else days + hours + minutes }}
        {%- else -%}
          {{ 'Discharging' }}
        {%- endif %}
    markdown_battery_charge_time_left:
      friendly_name: "Markdown Battery Charging Time"
      value_temp

Related Skills

View on GitHub
GitHub Stars225
CategoryDevelopment
Updated5h ago
Forks62

Security Score

85/100

Audited on Aug 8, 2026

No findings