Synsync Power Flow Card with Victron

I thought I’d show and tell about a nice custom Sunsync Power Flow card with my Victron values. Most of the stuff we can get from a GX with one or two ‘massaged’ template sensors. Not too bad if I say so myself.

image

3 Likes

Well done! Home Assistant seems to be the standard of the future, I would not surprised to see more and more hardware vendors support it out the box. This seems to be the space where the geeks are playing these days

Ok, so I forked the original github card and played around a bit. I’ve made a V1.0.0 release available if anyone wants to play around with this card.

Just a few notes:

  1. I am not a programmer, I’m mostly a HW guy. Javascript what?
  2. You can assume this is ‘abandon-ware’ as it was a learning experience for me so don’t expect fixes if something doesn’t work. If I see something, and I have time, and can replicate it, I might put some effort into it.
  3. This is just me playing around. If you want official support, contact the upstream owner as he DOES fix his code - I might sync my fork with his if I see he has fixes or enhancements I want.
  4. My setup is a Multi with heavy loads on ACOut2 so all my effort was on the AUX output of this card.
  5. Use the README file, it explains everything. If you are unsure, play around - you can’t break anything.

See a sample below. Some values are wrong as they are only for display purposes (EG. Essential load1 & 2 power values). I don’t have anything on Essential Loads with a power meter to show ‘real’ values.

image

Hi, I love this Card for the Victron, Do you have Sample code to connect to Victron?

I am not 100% sure what you mean by ‘sample code’. If you pull modbus values from your GX and created sensors in HA then those sensors can be used for this card if they provide the required information. It’s a manual process unfortunately but I am sure there are many examples of HA modbus sensor configs available if you search a bit.

Thanks for Response, sorry was not clear. The Victron Entities you where using. Otherwise I need to go through each one separately and try figure it out.

Example, what is the Victron Entities you where using in your Card Yaml Code
entities:
use_timer_248: switch.sunsynk_toggle_system_timer
priority_load_243: switch.sunsynk_toggle_priority_load
day_battery_charge_70: sensor.sunsynk_day_battery_charge
day_battery_discharge_71: sensor.sunsynk_day_battery_discharge
ect.

Yes, unfortunately everyone is different so you will have to create each one that you plan to use. From your example I made comments below.
The battery power comes from the standard Battery Power value. This was done a while ago and there might be better ways to do it but I took the Battery Power (in W) converted the + values to Charged Power and the - values to Discharged Power sensors. I then used the Integral method to create energy_gained and energy_spent sensors.

Oh, and to add to the Battery stuff. I then used an automation to save the daily battery values in HA into an input_number helper (to survive reloads).

Something like at 00:00 save the values and then calculate the new values based on the current vs saved values as per below. It really gets very long-winded and doesn’t always work, especially when load-shedding hits at 00:00 then the values are not saved correctly - I still have to figure that out. Here is my sensor that calculates daily values.

      - name: "Battery Energy Charge - Today"
        unit_of_measurement: kWh
        unique_id: 'battery_energy_charge_today'
        state_class: total
        device_class: energy
        state: >
            {% if has_value('input_number.battery_energy_gained_saved_today') and
                  has_value('sensor.energy_gained') and
                  states('input_number.battery_energy_gained_saved_today') != None and
                  states('sensor.energy_gained') != None %}
                {% set start_value = states('input_number.battery_energy_gained_saved_today')|int %}
                {% set current_value = states('sensor.energy_gained')|float * 100 %}
                {{ (current_value - start_value)|float /100 }}
            {% else %}
               None
            {% endif %}

Thanks let me start Playing

Hi @djagerif

Do you have the mapping of the sunsynk entities to victron entities?

I used to have a Sunsynk at my previous place and helped slipx with the testing and bug fixing of the original sunsynk power flow card.

Now I’m onto victron via modbusTCP and there are so many entities available, it’s hard to know what’s what. Could you share the yaml of your card please?


@jacauc I don’t have a direct mapping between the two. This card is fairly old, the source card has evolved to include many more inverters which you might want to check out. I can however provide you with my configuration which should assist in determining this entities go where. The below is what I use.

Note that I use the AUX/AC-Out2 for non essential loads, you might have the inverter connected differently.

type: custom:sunsynk-power-flow-card-ve
cardstyle: full
show_solar: "yes"
panel_mode: "no"
temp_unit: C
decimal_places: 2
inverter:
  colour: "#0089b6"
  modern: "yes"
  autarky: "no"
  use_victron: "true"
  auto_scale: true
battery:
  energy: 10000
  shutdown_soc: 30
  show_daily: "yes"
  invert_power: "yes"
  colour: WhiteSmoke
  warn_colour: DarkOrange
  animation_speed: 4
  max_power: 6200
  tail_current: 8
  empty_capacity: 20
  auto_scale: true
solar:
  show_daily: "yes"
  pv1_name: RS450-1
  pv2_name: 150/35
  pv3_name: RS450-2
  mppts: three
  max_power: 7545
  animation_speed: 8
  colour: "#eeb246"
  auto_scale: true
  dynamic_colour: true
load:
  show_daily: "yes"
  show_aux: "yes"
  aux_loads: two
  aux_name: Non Essential
  aux_colour: "#42ae5d"
  aux_off_colour: red
  aux_load1_name: Main Geyser
  aux_load1_icon: mdi:water-boiler
  aux_load2_name: Sec. Geyser
  aux_load2_icon: mdi:water-boiler
  colour: "#2d7895"
  max_power: 8000
  animation_speed: 5
  load1_name: Fridge
  load1_icon: mdi:fridge
  load2_name: Freezer
  load2_icon: mdi:coolant-temperature
  additional_loads: None
  auto_scale: true
grid:
  show_daily_buy: "yes"
  show_daily_sell: "yes"
  show_nonessential: "no"
  additional_loads: None
  colour: "#b83726"
  animation_speed: 10
  max_power: 15000
  auto_scale: true
entities:
  aux_connected_status: sensor.ac_out_2_relay_status
  aux_load1: sensor.geyser_energy_200l_power
  aux_load2: sensor.geyser_energy_150l_power
  aux_power_166: sensor.corrected_l3_power
  use_timer_248: "no"
  dc_transformer_temp_90: sensor.victron_min_soc_unless_grid_fails
  priority_load_243: "no"
  inverter_voltage_154: sensor.inverter_voltage_out
  load_frequency_192: sensor.inverter_frequency
  inverter_current_164: sensor.inverter_current_out
  inverter_power_175: sensor.total_output_power
  grid_connected_status_194: sensor.grid_connection_status
  inverter_status_59: sensor.inverter_status_message
  day_battery_charge_70: sensor.battery_energy_charge_today
  day_battery_discharge_71: sensor.battery_energy_discharge_today
  battery_voltage_183: sensor.freedomwon_battery_voltage
  battery_soc_184: sensor.freedomwon_battery_soc
  battery_power_190: sensor.battery_power
  battery_current_191: sensor.freedomwon_battery_current
  battery_temp_182: sensor.freedomwon_battery_temperature
  battery_shutdown_soc: sensor.victron_min_soc_unless_grid_fails
  grid_power_169: sensor.inverter_power_total_for_synsync_card
  day_grid_import_76: sensor.utility_meter_import
  day_grid_export_77: sensor.utility_meter_export
  grid_ct_power_172: sensor.grid_power_ct_for_synsync_card
  day_load_energy_84: sensor.load_energy_consumed_today
  essential_power: sensor.essential_power
  nonessential_power: none
  day_pv_energy_108: sensor.solcast_pv_forecast_forecast_today
  remaining_solar: sensor.solcast_pv_forecast_forecast_remaining_today
  pv1_power_186: sensor.pv_smartsolar_mppt_rs_450_100_power_tracker_0
  pv2_power_187: sensor.pv_smartsolar_mppt_150_35_power
  pv3_power_188: sensor.pv_smartsolar_mppt_rs_450_100_power_tracker_1
  pv4_power_189: none
  pv1_voltage_109: sensor.pv_smartsolar_mppt_rs_450_100_voltage_tracker_0
  pv1_current_110: sensor.pv_smartsolar_mppt_rs_450_100_current_tracker_0
  pv2_voltage_111: sensor.pv_smartsolar_mppt_150_35_voltage
  pv2_current_112: sensor.pv_smartsolar_mppt_150_35_current
  pv3_voltage_113: sensor.pv_smartsolar_mppt_rs_450_100_voltage_tracker_1
  pv4_voltage_115: none
  pv3_current_114: sensor.pv_smartsolar_mppt_rs_450_100_current_tracker_1
  pv4_current_116: none
  pv_total: sensor.pv_total_power
  environment_temp: sensor.house_de_jager_temperature