Power Flow Card Plus 🚀

I overwrite the units in the secondary config section.


Is this this outcome you are after?

I found that only works if the input sensor values are measuring kWh.

e.g. if the input sensor value is 300 Wh then choosing kWh in the config will show it as 300 kWh and not 0.3 kWh.

It works differently to the power number display.

e.g 999 W is shown as 999 W but 1050 W is displayed at 1.05 kW (at whatever decimal precision level is chosen). The unit conversions seem automated with the power numbers but not with the secondary display values.

See my power card above, look at the Solar circle. The two inputs are W for primary and Wh for secondary. The W are auto converted to kW when they go past 999 W but the Wh value remains as Wh, there is no conversion to kWh.

Had various things cranking today during a tariff free period.

ezgif.com-video-to-gif-converter (5)

I notice a couple of things:

i. I’m getting a negative value for household consumption. Not sure what’s going on there. Need to look into it a bit more.

ii. The EV shows power in kW (in the same way grid, solar and battery do) once it exceed 999 W but the water heater and home are still showing power in W. All sensor units used are W.

Also sometimes one of the individual circles just disappears, in this case the water heater:

When I set the individual circle “Display Zero State” to on and save, it does not stick. Indeed several of the options do not save.

+1 … water would be very nice to have on the card !!
Thanks for the good work !

Have you considered to make both your cards part of the official HA release eventually? It feels like everyone should see the amazing work you do.

How did you get this working, just adding an extra “individual3:” in the code editor or as an manual yalm or what?

I am running the “v0.2.0-beta” version, i created it from scratch several times but i feel like i am doing something wrong because the 3th or 4th entity is not showing up at all (also breaks the visual editor but that was expected i guess).

The visual editor in beta works for me but a number of features of it are not. Same with the yaml, can add code lines without it adding the feature to the card (e.g. secondary data).

The yaml for adding individual entries is a different format in the beta. Here is my current yaml:

type: custom:power-flow-card-plus
entities:
  battery:
    entity: sensor.battery_power
    state_of_charge: sensor.battery_state_of_charge
    invert_state: true
    color_value: true
    color_circle: true
    display_state: one_way_no_zero
  grid:
    entity: sensor.power_real_fronius_meter_2_http_192_168_0_201
    color_icon: true
    color_circle: true
    display_state: one_way_no_zero
    name: Grid
    color_value: true
  solar:
    entity: sensor.pv_power_total_combined
    display_zero_state: true
    name: Solar
    color_value: true
    color_icon: true
    secondary_info:
      entity: sensor.daily_pv_output_total
      unit_of_measurement: Wh
      decimals: 0
      color_value: true
    color:
      - 255
      - 162
      - 0
  fossil_fuel_percentage:
    state_type: power
    entity: sensor.co2_signal_grid_fossil_fuel_percentage
    color_value: true
    color_icon: true
    name: Low Carbon
    color:
      - 0
      - 179
      - 3
    icon: mdi:leaf
    use_metadata: false
    unit_white_space: false
    display_zero_state: true
    display_zero: true
  home:
    name: Home
    subtract_individual: true
    secondary_info:
      unit_of_measurement: Wh
    icon: mdi:home-group
    override_state: true
    use_metadata: false
  individual:
    - entity: sensor.input_01_water_heater
      name: Water Heater
      icon: mdi:water-boiler
      unit_of_measurement: W
      color:
        - 255
        - 115
        - 0
    - entity: sensor.input_10_garage_ev
      name: EV
      icon: mdi:car-outline
      secondary info:
        entity: sensor.ev_soc
        unit_of_measurement: null
    - entity: sensor.input_02_ducted_aircon
      name: Ducted AC
      icon: mdi:air-conditioner
    - entity: sensor.cottage
      name: Cottage
      icon: mdi:home-outline
clickable_entities: true
display_zero_lines:
  mode: show
  transparency: 50
  grey_color:
    - 189
    - 189
    - 189
use_new_flow_rate_model: true
w_decimals: 0
kw_decimals: 1
min_flow_rate: 0.75
max_expected_power: 10000
min_expected_power: 1
watt_threshold: 1000
transparency_zero_lines: 0
max_flow_rate: 6

Firstly i really like the card but i have a ct on my house with a forward and reverse binary sensor. is there anyway to split this into 2 sensors as the energy is always a positive value regardless of the direction

This is an example of what I mean, except in this case the aircon circle disappears, then the cottage moves up to take the aircon’s spot and also changes colour:

You’ll probably need to create a new template sensor which returns a positive value in one direction and a negative value for the reverse direction.

Something like the following in your yaml.config file but use the right sensors as input.

A big disclaimer - I am lousy at yaml, so there is every probability I have the syntax wrong. Hopefully others can correct it, this is more about indicating the sort of thing you can do.

template:
  - sensor:
      - name: "NewPowerSensor"
        unit_of_measurement: "W"
        state: >
          {% if states('sensor.mainsdirection')|= "FORWARD"}
            {{ states('sensor.mainspower') }}
          {% else %}
            {{ states('sensor.mainspower') * -1 }}
          {% endif %}

Of if you want two separate sensors, one for import, one for export then you can do something like in this post:

template:

  • sensor:
    • name: “Mains Consumption”
      unit_of_measurement: “W”
      state: >
      {% if states(‘sensor.mains_direction’)|‘FORWARD’ %}
      {{ states(‘sensor.mains_power’) }}
      {% else %}
      0
      {% endif %}
    • name: “Mains Production”
      unit_of_measurement: “W”
      state: >
      {% if states(‘sensor.mains_direction’)| ‘REVERSE’ %}
      {{ -1 * states(‘sensor.mains_power’)| }}
      {% else %}
      0
      {% endif %}

Thats i tried there but it spat this back at me
im sure its a simple thing but i know nothing about yaml so im really going copy paste and fudge.

do you use a float for something that only has forward reverse? my gut tells me float should be for an undefined number

thanks for the help

Logger: homeassistant.config
Source: config.py:623
First occurred: 14:53:58 (4 occurrences)
Last logged: 15:00:37

  • Invalid config for ‘template’ at configuration.yaml, line 26: invalid template (TemplateSyntaxError: expected token ‘end of statement block’, got ‘string’) for dictionary value ‘sensor->0->state’, got ‘{% if is_states('sensor.mains_direction') “FORWARD”}\n {{ states('sensor.mains_power') }}\n{% else %}\n {{ states('sensor.mains_power') * -1 }}\n{% endif %}\n’
  • Invalid config for ‘template’ at configuration.yaml, line 26: invalid template (TemplateSyntaxError: expected token ‘name’, got ‘string’) for dictionary value ‘sensor->0->state’, got “{% if states(‘sensor.mains_direction’)|‘FORWARD’ %}\n {{ states(‘sensor.mains_power’) }}\n{% else %}\n 0\n{% endif %}\n”

yaml is very picky about syntax, spacing etc and your pasted code has dots points where dashes should be. Try pasting it inside the code wrappers so people can see what it looks like:
Screen Shot 2024-04-05 at 5.42.38 am

even so, I am not the guy really to be advising on yaml, hopefully someone else here can help you get it right.

This vard has been amazing. I configured it this morning but unfortunately i still see some Solar Generation that is not coming on the Tesla App or the iSolar cloud app. Any reasons why and how i can make this right ?

Hi,
Very new to this and already love PFC+ . Thanks for the great efforts.

Do you intend to implement, or can you already set up two or more arrays that either feed into a master array and onward or directly. I would love to see my east west array live, but i can’t seem to work this out.

I use data from local via the modbus and seem to have 248 entities as a result on my Solax system. More presumably when my EV charger is finally connected.

I want to later do tariff comparisons. If anyone knows of any existing work done on this let me know.

Thanks

Nice update. Wasn’t dificult to migrate my config. I do need to work out why my card-mod theme isn’t styling the title though.


.

I thought this would do it:

  card-mod-theme: day
  card-mod-card: |

    h1.card-header {
      font-size: 20px;
      font-weight: 300;
      letter-spacing: 0px;
    }

Hi All,

I just discovered this card and i think it’s great ! thank you for the hard work.

However i ned some help configuring it as i’ve spent 2 hours on it and can’t make it work properly.

The card looks like this:

the problems i have are:

  1. Fossilis fuel % sensor which on the card shows 0 W is in fact:

  1. The water sensor which on the card shows 100.000 m3 is in fact:

  1. At irrigation there should be another sensor as secondary info but it does not show at all.

  2. House: i have a secondary sensor which looks correct but the unit does not show at all. It should show 26.4 kWh

  3. Solar: Secondary sensor shoud show kWh as unit, the value is correct.

The full code is:

type: custom:power-flow-card-plus
entities:
  grid:
    entity: sensor.smart_meter_63a_real_power
    invert_state: false
    use_metadata: false
    color_value: true
  solar:
    entity: sensor.solarnet_power_photovoltaics
    icon: mdi:solar-panel-large
    display_zero_state: true
    color_value: true
    color_icon: false
    use_metadata: false
    invert_state: false
    secondary_info:
      template: >-
        {{ (states('sensor.solarnet_energy_day') | float / 1000) | round(1)
        }}      
      decimals: 0
      color_value: false
      unit_of_measurement: kWh
  fossil_fuel_percentage:
    icon: mdi:pine-tree
    entity: sensor.electricity_maps_grid_fossil_fuel_percentage
    color_icon: true
    display_zero_state: true
    display_zero: true
    secondary_info:
      entity: sensor.electricity_maps_co2_intensity
      display_zero: true
      display_zero_state: true
      accept_negative: false
      unit_of_measurement: CO2
  home:
    secondary_info:
      template: >-
        {{ (states('sensor.solarnet_energy_day') | float / 1000 +
        states('sensor.froniusimport') | float / 1000 -
        states('sensor.froniusexport') | float / 1000) | round(1) }}
      decimals: 1
      unit_white_space: true
      color_value: true
      icon: ''
      display_zero: false
  individual:
    - entity: sensor.1405_power
      name: Pool Heater
      icon: mdi:heat-pump-outline
      inverted_animation: true
    - entity: sensor.1404_power
      name: Pool Pump
      icon: mdi:pump
      inverted_animation: true
    - entity: sensor.waterdaily
      name: Water
      icon: mdi:water-pump
      color: '#71bec4'
      color_icon: true
      display_zero: true
      inverted_animation: true
      unit_of_measurement: mÂł
      w_decimals: 0
    - entity: sensor.629_power
      name: Irrigation
      icon: mdi:pump
      inverted_animation: true
      display_zero: true
      color_icon: true
      secondary_info:
        entity: sensor.456_power
        display_zero: true
clickable_entities: true
display_zero_lines:
  mode: show
  transparency: 50
  grey_color:
    - 189
    - 189
    - 189
use_new_flow_rate_model: true
w_decimals: 0
kw_decimals: 2
min_flow_rate: 2
max_flow_rate: 6
max_expected_power: 15000
min_expected_power: 0.01
watt_threshold: 1000
transparency_zero_lines: 0
disable_dots: false

As i’m not very skilled with YAML please help me tidy up the code so the issues are solved.

Thank you !!!

I figured out some of the issues, resulting in

image

Still need help on the fossil fuel and water :slight_smile:

After the last update of the card (yesterday) my Shelly EM used to control the EV charge can’t be recognized.

I can set up an individual for other shelly or other entities, but not for the Shelly. It worked until yesterday.

I tried to set directly or in the yaml editor, no difference.

So i managed to solve almost all the issues:

But the display error at Water still eludes me. Same sensor set as secondary info displays the value correctly.

    - entity: sensor.waterdaily
      name: Water
      icon: mdi:water-pump
      color: '#71bec4'
      color_icon: false
      display_zero: true
      display_zero_state: true
      accept_negative: false
      inverted_animation: true
      unit_of_measurement: mÂł
      decimals: 1
      secondary_info:
        entity: sensor.waterdaily
        name: Water
        icon: mdi:water-pump
        color: '#71bec4'
        display_zero: true
        display_zero_state: true
        accept_negative: false
        inverted_animation: true
        unit_of_measurement: mÂł
        decimals: 1

@flixlixlix any idea why this is happening please ?

Cheers

Hello everyone!

First of all thank you so much for this amazing Card! Very good work!

Just to let you know, since the last major update I realized two issues:

  1. The circles and the lines do not fit perfectly anymore (see red markings)
  2. The line of the first individual entity is not colored correctly (see blue marking)

EDIT: As soon as you color the icon of the first individual entity the line gets colored too ?!

EDIT 2: Zero lines of individual entities are not greyed out correctly.