Sunsynk + Home Assistant

**v1.4.1**
**Updates**

- Improve AUX flow
- Nearly all card entities are clickable if associated with a valid Home Assistant entityID
 
Looking very nice indeed! Thank you @Slip

Couple of sensor equivalents I couldn't find on the Deye (solarman):
  • batdischargeday_71
  • batchargeday_70
  • inverter_load_freq_192
And then grid_status_194 returns "On-grid"

View attachment 1522649
Got to the same place as you but even after looking back at the previous posts can't for the life of me figure this out. Mind sharing your card config? My HA knowledge ain't the best

@Slip great work on this!
 
Thanks! I found kosmik's fix for the battery and frequency issues. Is there anything for the grid status?
I got a template translation sensor for that one, can post code if you like. Same for the inverter status.

Here

YAML:
sensors:
  sunsynkcard_gridstatus:
    friendly_name: Gridstatus
    value_template: |
      {% if is_state('sensor.solarman_grid_connected_status', 'On-Grid') %}
        1
      {% else %}
        0
      {% endif %}
  sunsynkcard_inverterstatus:
    friendly_name: InverterStatus
    value_template: |
      {% if is_state('sensor.solarman_running_status', 'Stand-by') %}
        0
      {% elif is_state('sensor.solarman_running_status', 'Self-Checking') %}
        1
      {% elif is_state('sensor.solarman_running_status', 'Normal') %}
        2
      {% elif is_state('sensor.solarman_running_status', 'Fault') %}
        4
      {% endif %}

My settings for the card using solarman

YAML:
type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: 'no'
inverter:
  modern: 'yes'
  colour: '#959595'
battery:
  energy: 11000
  shutdown_soc: 20
  invert_power: 'no'
  colour: pink
  show_daily: 'yes'
solar:
  show_solar: 'yes'
  colour: orange
  show_daily: 'yes'
load:
  colour: '#5fb6ad'
  show_daily: 'yes'
  show_aux: 'no'
grid:
  colour: '#5490c2'
  show_daily: 'yes'
  no_grid_colour: red
entities:
  use_timer_248: 'no'
  priority_load_243: 'no'
  batchargeday_70: sensor.solarman_daily_battery_charge
  batdischargeday_71: sensor.solarman_daily_battery_discharge
  loadday_84: sensor.solarman_daily_load_consumption
  gridday_76: sensor.solarman_daily_energy_bought
  solarday_108: sensor.solarman_daily_production
  inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
  inverter_load_freq_192: sensor.solarman_load_frequency
  inverter_out_164: sensor.solarman_current_l1
  inverter_out_175: sensor.solarman_inverter_l1_power
  inverter_load_grid_169: sensor.solarman_internal_ct_l1_power
  pv2_power_187: sensor.solarman_pv2_power
  pv1_power_186: sensor.solarman_pv1_power
  battery_voltage_183: sensor.solarman_battery_voltage
  battery_soc_184: sensor.solarman_battery_soc
  battery_out_190: sensor.solarman_battery_power
  ess_power: sensor.solarman_total_load_power
  grid_external_power_172: sensor.solarman_external_ct_l1_power
  pv1_v_109: sensor.solarman_pv1_voltage
  pv1_i_110: sensor.solarman_pv1_current
  pv2_v_111: sensor.solarman_pv2_voltage
  pv2_i_112: sensor.solarman_pv2_current
  grid_status_194: sensor.sunsynkcard_gridstatus
  inverter_status_59: sensor.sunsynkcard_inverterstatus
  aux_power_166: 'no'
 
Last edited:
Got to the same place as you but even after looking back at the previous posts can't for the life of me figure this out. Mind sharing your card config? My HA knowledge ain't the best

@Slip great work on this!
I see Kosmik has shared his. Did you manage to come right?
 
Last edited:
I got a template translation sensor for that one, can post code if you like. Same for the inverter status.

Here

YAML:
sensors:
  sunsynkcard_gridstatus:
    friendly_name: Gridstatus
    value_template: |
      {% if is_state('sensor.solarman_grid_connected_status', 'On-Grid') %}
        1
      {% else %}
        0
      {% endif %}
  sunsynkcard_inverterstatus:
    friendly_name: InverterStatus
    value_template: |
      {% if is_state('sensor.solarman_running_status', 'Stand-by') %}
        0
      {% elif is_state('sensor.solarman_running_status', 'Self-Checking') %}
        1
      {% elif is_state('sensor.solarman_running_status', 'Normal') %}
        2
      {% elif is_state('sensor.solarman_running_status', 'Fault') %}
        4
      {% endif %}

My settings for the card using solarman

YAML:
type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: 'no'
inverter:
  modern: 'yes'
  colour: '#959595'
battery:
  energy: 11000
  shutdown_soc: 20
  invert_power: 'no'
  colour: pink
  show_daily: 'yes'
solar:
  show_solar: 'yes'
  colour: orange
  show_daily: 'yes'
load:
  colour: '#5fb6ad'
  show_daily: 'yes'
  show_aux: 'no'
grid:
  colour: '#5490c2'
  show_daily: 'yes'
  no_grid_colour: red
entities:
  use_timer_248: 'no'
  priority_load_243: 'no'
  batchargeday_70: sensor.solarman_daily_battery_charge
  batdischargeday_71: sensor.solarman_daily_battery_discharge
  loadday_84: sensor.solarman_daily_load_consumption
  gridday_76: sensor.solarman_daily_energy_bought
  solarday_108: sensor.solarman_daily_production
  inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
  inverter_load_freq_192: sensor.solarman_load_frequency
  inverter_out_164: sensor.solarman_current_l1
  inverter_out_175: sensor.solarman_inverter_l1_power
  inverter_load_grid_169: sensor.solarman_internal_ct_l1_power
  pv2_power_187: sensor.solarman_pv2_power
  pv1_power_186: sensor.solarman_pv1_power
  battery_voltage_183: sensor.solarman_battery_voltage
  battery_soc_184: sensor.solarman_battery_soc
  battery_out_190: sensor.solarman_battery_power
  ess_power: sensor.solarman_total_load_power
  grid_external_power_172: sensor.solarman_external_ct_l1_power
  pv1_v_109: sensor.solarman_pv1_voltage
  pv1_i_110: sensor.solarman_pv1_current
  pv2_v_111: sensor.solarman_pv2_voltage
  pv2_i_112: sensor.solarman_pv2_current
  grid_status_194: sensor.sunsynkcard_gridstatus
  inverter_status_59: sensor.sunsynkcard_inverterstatus
  aux_power_166: 'no'
Thanks for this. Is there a reason you're not using running_status as is?
 
Thanks for this. Is there a reason you're not using running_status as is?
Because the text descriptions don't match @Slip s ones for direct integration. So all it does is remap the Solarman text ones to the correct enum integers which his card then interprets.
 
I got a template translation sensor for that one, can post code if you like. Same for the inverter status.

Here

YAML:
sensors:
  sunsynkcard_gridstatus:
    friendly_name: Gridstatus
    value_template: |
      {% if is_state('sensor.solarman_grid_connected_status', 'On-Grid') %}
        1
      {% else %}
        0
      {% endif %}
  sunsynkcard_inverterstatus:
    friendly_name: InverterStatus
    value_template: |
      {% if is_state('sensor.solarman_running_status', 'Stand-by') %}
        0
      {% elif is_state('sensor.solarman_running_status', 'Self-Checking') %}
        1
      {% elif is_state('sensor.solarman_running_status', 'Normal') %}
        2
      {% elif is_state('sensor.solarman_running_status', 'Fault') %}
        4
      {% endif %}

My settings for the card using solarman

YAML:
type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: 'no'
inverter:
  modern: 'yes'
  colour: '#959595'
battery:
  energy: 11000
  shutdown_soc: 20
  invert_power: 'no'
  colour: pink
  show_daily: 'yes'
solar:
  show_solar: 'yes'
  colour: orange
  show_daily: 'yes'
load:
  colour: '#5fb6ad'
  show_daily: 'yes'
  show_aux: 'no'
grid:
  colour: '#5490c2'
  show_daily: 'yes'
  no_grid_colour: red
entities:
  use_timer_248: 'no'
  priority_load_243: 'no'
  batchargeday_70: sensor.solarman_daily_battery_charge
  batdischargeday_71: sensor.solarman_daily_battery_discharge
  loadday_84: sensor.solarman_daily_load_consumption
  gridday_76: sensor.solarman_daily_energy_bought
  solarday_108: sensor.solarman_daily_production
  inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
  inverter_load_freq_192: sensor.solarman_load_frequency
  inverter_out_164: sensor.solarman_current_l1
  inverter_out_175: sensor.solarman_inverter_l1_power
  inverter_load_grid_169: sensor.solarman_internal_ct_l1_power
  pv2_power_187: sensor.solarman_pv2_power
  pv1_power_186: sensor.solarman_pv1_power
  battery_voltage_183: sensor.solarman_battery_voltage
  battery_soc_184: sensor.solarman_battery_soc
  battery_out_190: sensor.solarman_battery_power
  ess_power: sensor.solarman_total_load_power
  grid_external_power_172: sensor.solarman_external_ct_l1_power
  pv1_v_109: sensor.solarman_pv1_voltage
  pv1_i_110: sensor.solarman_pv1_current
  pv2_v_111: sensor.solarman_pv2_voltage
  pv2_i_112: sensor.solarman_pv2_current
  grid_status_194: sensor.sunsynkcard_gridstatus
  inverter_status_59: sensor.sunsynkcard_inverterstatus
  aux_power_166: 'no'
Thanks for sharing. Just a heads up that this wont work for the latest version of the card. There have been changes to the attributes used under grid as well as the essential and non-essential sensors
 
I updated my yaml with your changes and rebooted but it's still not

I see Kosmik has shared his. Did you manage to come right?
which yaml? You need to either edit the deye_hybrid.yaml in the custom controls directory or copy that one and dump its contents in a new one called custom_parameters.yaml and add the sensors. Don't forget to change the integration to then read from that config.

This is my custom one until they complete the PR.

Had to save as txt extension for the forum but obviously use yaml. Needs to be located in /custom_components/solarman/inverter_definitions
 

Attachments

which yaml? You need to either edit the deye_hybrid.yaml in the custom controls directory or copy that one and dump its contents in a new one called custom_parameters.yaml and add the sensors. Don't forget to change the integration to then read from that config.

This is my custom one until they complete the PR.

Had to save as txt extension for the forum but obviously use yaml. Needs to be located in /custom_components/solarman/inverter_definitions
Sorry, that was a posting error. Been posting on my phone and when I switched to the laptop there was some residual text I missed. Oops. Everything is working great this side
 
Thanks for sharing. Just a heads up that this wont work for the latest version of the card. There have been changes to the attributes used under grid as well as the essential and non-essential sensors
Here's my current config which is working on 1.4.2. I did need to define sensor.sunsynkcard_gridstatus as per @Kosmik's earlier posts.

Code:
type: custom:sunsynk-power-flow-card
cardstyle: lite
panel_mode: 'no'
inverter:
  modern: 'yes'
  colour: '#959595'
battery:
  energy: 9600
  shutdown_soc: 10
  invert_power: 'no'
  colour: pink
  show_daily: 'yes'
solar:
  show_solar: 'yes'
  colour: orange
  show_daily: 'yes'
  mppts: two
load:
  colour: '#5fb6ad'
  show_daily: 'yes'
  show_aux: 'no'
  invert_aux: 'no'
grid:
  colour: '#5490c2'
  no_grid_colour: '#a40013'
  show_daily_buy: 'yes'
  show_daily_sell: 'yes'
  show_nonessential: 'no'
entities:
  use_timer_248: 'no'
  priority_load_243: 'no'
  batchargeday_70: sensor.solarman_daily_battery_charge
  batdischargeday_71: sensor.solarman_daily_battery_discharge
  loadday_84: sensor.solarman_daily_load_consumption
  grid_buy_day_76: sensor.solarman_daily_energy_bought
  grid_sell_day_77: sensor.solarman_daily_energy_sold
  solarday_108: sensor.solarman_daily_production
  inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
  inverter_load_freq_192: sensor.solarman_load_frequency
  inverter_out_164: sensor.solarman_current_l1
  inverter_out_175: sensor.solarman_inverter_l2_power
  inverter_load_grid_169: sensor.solarman_load_l1_power
  pv1_power_186: sensor.solarman_pv1_power
  pv2_power_187: sensor.solarman_pv2_power
  pv3_power_188: sensor.pv3_power
  pv4_power_189: sensor.pv4_power
  battery_voltage_183: sensor.solarman_battery_voltage
  battery_soc_184: sensor.solarman_battery_soc
  battery_out_190: sensor.solarman_battery_power
  essential_power: sensor.solarman_total_load_power
  nonessential_power: none
  grid_external_power_172: sensor.solarman_total_grid_power
  pv1_v_109: sensor.solarman_pv1_voltage
  pv1_i_110: sensor.solarman_pv1_current
  pv2_v_111: sensor.solarman_pv2_voltage
  pv2_i_112: sensor.solarman_pv2_current
  pv3_v_113: sensor.dc3_voltage
  pv3_i_114: sensor.dc3_current
  pv4_v_115: sensor.dc4_voltage
  pv4_i_116: sensor.dc4_current
  grid_status_194: sensor.sunsynkcard_gridstatus
  inverter_status_59: sensor.solarman_running_status
  aux_power_166: sensor.aux_output_power
 
Last edited:
I would suggest you change
YAML:
inverter_load_grid_169: sensor.solarman_load_l1_power
inverter_out_175: sensor.solarman_inverter_l2_power
to
YAML:
inverter_load_grid_169: sensor.solarman_total_load_power
inverter_out_175: sensor.solarman_total_power

I'd like to add this to the github and template sensors once confirmed working.
 
yeah I havent updated my card yet, trying to get my paradox up and running at the mo. MQTT being a pain.
 
I would suggest you change
YAML:
inverter_load_grid_169: sensor.solarman_load_l1_power
inverter_out_175: sensor.solarman_inverter_l2_power
to
YAML:
inverter_load_grid_169: sensor.solarman_total_load_power
inverter_out_175: sensor.solarman_total_power

I'd like to add this to the github and template sensors once confirmed working.
Ok, I've updated as follows:

Code:
type: custom:sunsynk-power-flow-card
cardstyle: lite
panel_mode: 'no'
inverter:
  modern: 'yes'
  colour: '#959595'
battery:
  energy: 9600
  shutdown_soc: 10
  invert_power: 'no'
  colour: pink
  show_daily: 'yes'
solar:
  show_solar: 'yes'
  colour: orange
  show_daily: 'yes'
  mppts: two
load:
  colour: '#5fb6ad'
  show_daily: 'yes'
  show_aux: 'no'
  invert_aux: 'no'
grid:
  colour: '#5490c2'
  no_grid_colour: '#a40013'
  show_daily_buy: 'yes'
  show_daily_sell: 'yes'
  show_nonessential: 'no'
entities:
  use_timer_248: 'no'
  priority_load_243: 'no'
  batchargeday_70: sensor.solarman_daily_battery_charge
  batdischargeday_71: sensor.solarman_daily_battery_discharge
  loadday_84: sensor.solarman_daily_load_consumption
  grid_buy_day_76: sensor.solarman_daily_energy_bought
  grid_sell_day_77: sensor.solarman_daily_energy_sold
  solarday_108: sensor.solarman_daily_production
  inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
  inverter_load_freq_192: sensor.solarman_load_frequency
  inverter_out_164: sensor.solarman_current_l1
  inverter_out_175: sensor.solarman_total_power
  inverter_load_grid_169: sensor.solarman_total_load_power
  pv1_power_186: sensor.solarman_pv1_power
  pv2_power_187: sensor.solarman_pv2_power
  pv3_power_188: sensor.pv3_power
  pv4_power_189: sensor.pv4_power
  battery_voltage_183: sensor.solarman_battery_voltage
  battery_soc_184: sensor.solarman_battery_soc
  battery_out_190: sensor.solarman_battery_power
  essential_power: sensor.solarman_total_load_power
  nonessential_power: none
  grid_external_power_172: sensor.solarman_total_grid_power
  pv1_v_109: sensor.solarman_pv1_voltage
  pv1_i_110: sensor.solarman_pv1_current
  pv2_v_111: sensor.solarman_pv2_voltage
  pv2_i_112: sensor.solarman_pv2_current
  pv3_v_113: sensor.dc3_voltage
  pv3_i_114: sensor.dc3_current
  pv4_v_115: sensor.dc4_voltage
  pv4_i_116: sensor.dc4_current
  grid_status_194: sensor.sunsynkcard_gridstatus
  inverter_status_59: sensor.solarman_running_status
  aux_power_166: sensor.aux_output_power

sunsynk_card.png
 
A small idea that would help people with smaller setups (Like mine, where i dont have solar at all).
In a scenario where i set:
Code:
show_solar: 'no'
it should not complain about missing attributes for anything solar related (Such as mppts, show_daily, pv*_*. I had a ton on breaking configs for something i dont need :crying:

Might also make sense when their are entities that are straight "display" entities and not used in calculations to make these optional too. So instead of having to put a entity value of "none", rather allow me to leave the entity out completely. Would allow for future changes where you add entities to be non-breaking changes
 
A small idea that would help people with smaller setups (Like mine, where i dont have solar at all).
In a scenario where i set:
Code:
show_solar: 'no'
it should not complain about missing attributes for anything solar related (Such as mppts, show_daily, pv*_*. I had a ton on breaking configs for something i dont need :crying:

Might also make sense when their are entities that are straight "display" entities and not used in calculations to make these optional too. So instead of having to put a entity value of "none", rather allow me to leave the entity out completely. Would allow for future changes where you add entities to be non-breaking changes
Will see if I can make that smarter :thumbsup:
 
Top
Sign up to the MyBroadband newsletter
X