Power Flow Card Plus - Self-Sufficient Info

Hi,

i´m using the Power Flow Card Plus to track my solar, battery and grid production/consumption.
Now i´m looking for a way, to show the self-sufficiently percentage in the secondary Info from the Home bubble.
29-11-_2023_16-34-01

I know that there is a gauge card for that, but i only want the percentage value.
What do i need to calculate the percentage? Does anyone know the formula for that and how i build an entity with that?

Cheers,
Andreas

Have you been able to solve your question?
Where do you get the self-sufficiency from?
I know it’s on the energy dashboard, but it’s no “stand alone” entity AFAIK.

Thanks.
NCO

Self-sufficiency as a percentage value can be calculated as “over time” or “instant”. Difference is energy vs power, formula is largely the same.

Over time = Energy produced (solar + battery) / Energy consumed * 100

Instant = Power produced / power consumed * 100

For the instant part, which I’m using:

configuration.yaml:

# Instant Self-Sufficiency

template:
  - sensor:
      - name: "Instant Self Sufficiency"
        unique_id: "instant_self_sufficiency"
        unit_of_measurement: "%"
        state: >
          {% set house_power = states('sensor.solarnet_power_load_consumed') | float %}
          {% set solar_power = states('sensor.solarnet_power_photovoltaics') | float %}
          {% set battery_power = states('sensor.solarnet_power_battery_discharge') | float %}
          {% set grid_power = states('sensor.solarnet_power_grid_import') | float %}
          {% if house_power == 0 %}
            0
          {% else %}
            {{ ((solar_power + battery_power) / house_power) * 100 }}
          {% endif %}
        availability: >
          {{ states('sensor.solarnet_power_load_consumed') not in ['unknown', 'unavailable'] and
             states('sensor.solarnet_power_photovoltaics') not in ['unknown', 'unavailable'] and
             states('sensor.solarnet_power_battery_discharge') not in ['unknown', 'unavailable'] and
             states('sensor.solarnet_power_grid_import') not in ['unknown', 'unavailable'] }}

Then, how you represent the sensor value in a card / dashboard is up to you.

You can include it as secondary info in the House section in the PowerFlow Card Plus, or have it’s own card - entirely up to you.

I have it both ways - and my card for it is using mini-graph-card:

type: custom:mini-graph-card
entities:
  - entity: sensor.instant_self_sufficiency
name: Instant Self Sufficiency
icon: mdi:information-box
color_thresholds:
  - value: 20
    color: '#fff000'
  - value: 50
    color: '#ffff00'
  - value: 80
    color: '#00ff00'
line_color: '#00aaff'
line_width: 3
show:
  fill: fade
  points: true
  legend: true
  labels: true
point_size: 1
hours_to_show: 8
points_per_hour: 3

Obviously, adjust parameters to your liking.

Thanks for your answer.
But my problem with your solution is, that i don´t have a sensor that gives me my house consumption power.
The only place where i can see my house consumption is in the Power Flow Card and to my knowledge, that value is somehow calculatet in the background and not a seperate sensor i can use for other stuff.