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