Power Distribution card

hello, any way to set up the distribution in W instead of KW ?

You can use the setting watt_threshold for that. As soon as the value is above that, it will convert to kW. So the larger watt_threshold, the longer it will display W instead.

2 Likes

Thanks!!!

Hi @ulic

First-off: thank you for a wonderful and lean card. This actually looks amazingly ‘core’ :wink:
Only discovered it today, and already seems as if it has always been there. Very nice indeed!

Using it in a swiper to save some space and for full disclosure, this is the first attempt, a straight and plain power-distribution card. Out of the box. :

type: entities
title: 'Energie: verbruik - levering'
card_mod:
  style: |
    .card-header {
      font-weight: 400;
      font-size: 20px;
      color: {% if states('sensor.netto_verbruik')|int(default=0) < 0 %} var(--primary-color)
             {% else %} var(--text-color-off)
            {% endif %};
      padding: 0px 12px;
      margin: 0px 0px 16px 0px;
      background: {% if states('sensor.netto_verbruik')|int(default=0) < 0 %} gold
                  {% else %} var(--background-color-off)
                  {% endif %};
    }
entities:
  - type: custom:swipe-card
    cards:
      - type: custom:hui-element
        card_type: energy-distribution
#        title: Energy distribution
    #    link_dashboard: true
        card_mod: &mod
          style: |
            ha-card {
              box-shadow: none;
              margin: -8px -8px 0px -8px;
            }
      - type: custom:power-flow-card
    #    dashboard_link: /energy
#        title: Power distribution
        card_mod: *mod
    #      class: class-header-margin
        entities:
          grid:
            consumption: sensor.grid_power_consumption
            production: sensor.grid_power_production
          solar: sensor.zp_actuele_opbrengst

  - type: custom:hui-element
    card_type: glance
    card_mod:
      style: |
        ha-card {
          box-shadow: none;
          margin: -8px -16px 0px -16px;
        }
    entities:
      - sensor.levering_of_verbruik
      - entity: sensor.zp_actuele_opbrengst
        name: Solar production
      - entity: sensor.calculated_bruto_verbruik
        name: Bruto verbruik

  - !include /config/dashboard/includes/include_verbruik_actueel_apex.yaml
  - entity: input_select.apex_span

Aug-02-2022 15-29-49

Please let me ask (ofc I searched buit dont think it’s there): can we name: the entities in the entities object? As you can see I have some (template) sensors in the grid below the swiper, and Id like the distribution card to have the same naming.

second, and that might me more of a suggestion going forward:
why not name the energy-link just like the energy-card uses? Its a tiny bit confusing to have the exact same functionality named link_dashboard: true in the core card, and dashboard_link: /energy in your card

lastly, instead of having that link (which is not particularly nice to look at) why no allow to action: tap_action . Currently these cards do nothing when clicked, and I feel that would be very nice to have.

Actions - Home Assistant would be awesome.
Ware this is not available in core either (yet…) see: energy distribution panel: add tap and hold action · Discussion #10045 · home-assistant/frontend · GitHub
Other than that: perfect!
thx again

3 Likes

Bit offtopic, but can you please share the include_verbruik_actueel_apex.yaml and input_select.apex_span files? That graph is really looking great especially with the span :+1:

Not at the office now, but I posted it some time ago in the Apex card thread. Search for it and you’ll easily find it?

This would be it ApexCharts card - A highly customizable graph card - #1495 by Mariusthvdb

1 Like

Can you please chare you template to calculate the different sensors used. Thanks!

Thanks for the work on this @ulic it looks stunning!

Is there a way I can stretch the height of the card to make it fill 100% of the available viewport space?

The card was built using the design of the built-in Energy Cards as a base and last time I checked they didn’t work that way either. Right now I don’t have any plans on adding that feature.

1 Like

Thanks @ulic I was able to stretch (and magnify) it using 🔹 Card-mod - Add css styles to any lovelace card :slight_smile:

1 Like

You’ll see from my screen shot above that I have a white line running between Grid and Battery, but this will never happen.

In the screen shot from @ulic in the first post that line isn’t present.

How do I remove this line from my card? :thinking:

How do you do that? which values of styles?

I would like to reduce size of my power flow:
Capture

2 Likes

Hello, I am trying to start the power flow card, I would like to know how to make the card appear in Watts, thanks

You can use the watt_threshold setting to configure when watts or kilowatts will be shown.

Sorry for the delay in replying @Plouf34

First, I installed the Card-Mod: 🔹 Card-mod - Add css styles to any lovelace card

Then I edited the dashboard I wanted to change:

Then I selected the Edit in the bottom left corner:

Then I edited the code from this:

type: custom:power-flow-card
kw_decimals: null
w_decimals: 0
watt_threshold: 999
min_flow_rate: 3
max_flow_rate: 10
entities:
  battery_charge: sensor.lux_battery
  battery:
    consumption: sensor.lux_battery_discharge_live
    production: sensor.lux_battery_charge_live
  grid:
    consumption: sensor.lux_power_from_grid_live
    production: sensor.lux_power_to_grid_live
  solar: sensor.lux_solar_output_live

To this (note the extra card_mod section at the bottom):

type: custom:power-flow-card
kw_decimals: null
w_decimals: 0
watt_threshold: 999
min_flow_rate: 3
max_flow_rate: 10
entities:
  battery_charge: sensor.lux_battery
  battery:
    consumption: sensor.lux_battery_discharge_live
    production: sensor.lux_battery_charge_live
  grid:
    consumption: sensor.lux_power_from_grid_live
    production: sensor.lux_power_to_grid_live
  solar: sensor.lux_solar_output_live
card_mod:
  style: |
    ha-card {
      padding-top: 205px;
      width: 1060px;
      height: 700px;
     transform: scale(1.8);
      }

You can play with the CSS values and tailor it for your own requirements @Plouf34

1 Like

Very useful card, love it!
I’ve been trying to use conditions within it, to achieve the following:

  1. Include Solar and Grid, while there’s Solar production, but
  2. Only include Grid when Solar production is offline.

I have a entity for the state of the inverter, and in that the value is 2 if it’s offline and 1 if it’s online.
I can create a condition based on that, but can not get that to work with which entities are selected for this card (solar and/or grid). Maybe I’m too novice with YAML.

Is this even possible with this card, and if so, can someone please help me understand how conditional entity rows would work in this case? Thank you!

Hi there.

Apologies for what is probably an excrutiatingly short sighted question. I’m new to this.
I cant get the dashboard to work. What I have done is

  1. Installed HACS on my homeaaistant OS, running on a Pi4
  2. Installed the card via HACS
  3. Copied the first “example usage” from the Github page
  4. Gone into an existing dashboard, edited it and added a card
  5. Scrolled down to the bottom of the pop-up and chose “manual”
  6. Pasted the example usage code into the card configuration:
type: custom:power-flow-card
entities:
  battery: sensor.battery_in_out
  battery_charge: sensor.battery_percent
  grid: sensor.grid_in_out
  solar: sensor.solar_out 

All looks good, but the card doesnt seem to have anything flowing through it. All the values stay at zero. I’ve rebooted the pi

Any advice gratefully received.

thanks

danyul

You must use your own sensor entities, not the sample ones.

1 Like

Thank you. So I can only choose entries from the list that appears in the sensors list in the overview in home assistant?

@Plouf34 was that of any use?