Power Flow Card Plus šŸš€

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.

Hi All

Iā€™ve just come across a strange happening that I canā€™t seem to figure out - itā€™s probably some simple that Iā€™ve inadvertently done/not done (Iā€™m still new on HA!).

The latest update to the PFC+ (v 0.2.1) allowed up to 4 ā€˜individualā€™ entities. I added my 4 entities and it works just fine via the Chrome browser and the HA application on my macMini. However when I view the card on my mobile devices (iphone and ipad) via the HA Companion App the card doesnā€™t show the ā€˜individualā€™ entities. It does if I run HA via Chrome on these devices.

Iā€™m running HA Core version 2024.4.0, Front End 20240403.1.

Not sure whatā€™s going on as I was able to successfully view 2 ā€˜individualā€™ entities in the previous version of PFC+.

Hereā€™s the screen shot from the Chrome browserā€¦
Chrome - screenshot

ā€¦and from the iphoneā€¦

I tried removing two of the individuals from the code and it still didnā€™t show any of the ā€˜individual entitiesā€™. I have refreshed the browser cache and restarted HA during testing of this all to no avail.

Any help really appreciated. Great work on the card BTW!

type: custom:power-flow-card-plus
entities:
  home:
    color_icon: true
  grid:
    icon: mdi:transmission-tower
    name: Grid
    color_icon: true
    entity:
      consumption: sensor.solax_grid_pos
    display_state: one_way_no_zero
  solar:
    icon: mdi:solar-power-variant
    entity: sensor.solax_inverter_ac_power
    color: yellow
    color_icon: true
  individual:
    - entity: sensor.smart_plug_3_power
      name: Water
      icon: mdi:water-pump
      color_icon: true
      color: chartreuse
      display_zero: true
      display_zero_state: true
    - entity: sensor.pool_pump_and_chlorinator_power
      name: Pool+Chlorinator
      icon: mdi:pool
      color_icon: true
      color: deepskyblue
      display_zero: true
      display_zero_state: true
    - entity: sensor.ac_power_total
      name: AirCon
      icon: mdi:air-conditioner
      color_icon: true
      color: paleturquoise
      display_zero: true
      display_zero_state: true
    - entity: sensor.other_appliances_total
      name: Appliances
      icon: mdi:home-circle-outline
      color_icon: true
      color: moccasin
      display_zero: true
      display_zero_state: true
w_decimals: 0
kw_decimals: 2
min_flow_rate: 0.9
max_flow_rate: 6
watt_threshold: 10000
clickable_entities: true
title: Power Flow

How did you make the circles bigger anyways? For me the second info gets stuck in the circles, they are too small.

Ok seems to be fixed now, not a PFC+ problem at all. I moved some of my sensors into the template file format and now all four individual entities are shown. I think if thereā€™s a problem with the individual entity sensor(s) then the card just shows the grid, Solar and house circles.

sensor:
  - name: "mains_reverse"
    unit_of_measurement: "W"
    state: >
        {% if is_state('binary_sensor.mains_direction', 'off') %}
          {{ states('sensor.mains_power') * 1 }}
        {% else %}
          0
        {% endif %}
  - name: "mains_forward"
    unit_of_measurement: "W"
    state: >
        {% if is_state('binary_sensor.mains_direction', 'on') %}
          {{ states('sensor.mains_power') * 1 }}
        {% else %}
          0
        {% endif %}

If anyone else ends up with the same issue using a forward reverse ct this is what will get you out of trouble.
thanks @wattmatters for starting me off and sorry for the very slow replyā€¦ working away will do that

1 Like