Power Distribution card

No problem.

Hopefully this formats OK, I’m only on mobile.

The / 1000 part is to show the sensor data in kW instead of W.

Their could be redundant commands in there as I’ve been fiddling with it a bit over the past few days.

type: custom:apexcharts-card
graph_span: 24h
apex_config:
  chart:
    height: 175%
span:
  end: minute
header:
  show: true
  title: Power 24 hours
  show_states: false
  colorize_states: true
series:
  - entity: sensor.solar_power_corrected_1m
    name: Generation
    stroke_width: 1
    extend_to: now
    curve: smooth
    fill_raw: last
    transform: return x / 1000;
    unit: kW
    float_precision: 2
    show:
      legend_value: false
  - entity: sensor.grid_net_power_1m
    name: Grid Net
    type: area
    invert: true
    stroke_width: 1
    extend_to: now
    curve: smooth
    fill_raw: zero
    transform: return x / 1000;
    unit: kW
    float_precision: 2
    show:
      legend_value: false
  - entity: sensor.envoy_current_power_consumption
    name: Consumption
    invert: true
    stroke_width: 1
    extend_to: now
    fill_raw: last
    transform: return x / 1000;
    unit: kW
    float_precision: 2
    curve: smooth
    show:
      legend_value: false
  - entity: sensor.twcmanager_2679_charger_load_w
    name: EV Charger
    type: area
    curve: stepline
    invert: true
    stroke_width: 1
    fill_raw: zero
    extend_to: now
    transform: return x / 1000;
    unit: kW
    float_precision: 2
    show:
      legend_value: false
  - entity: sensor.hot_water_system_supply_switch_0_power
    name: Hot Water
    color: green
    type: area
    curve: stepline
    invert: true
    stroke_width: 1
    fill_raw: zero
    extend_to: now
    transform: return x / 1000;
    unit: kW
    float_precision: 2
    show:
      legend_value: false
yaxis:
  - id: first
    decimals: 0
    apex_config:
      tickAmount: 6
      forceNiceScale: true
      title:
        text: kW

3 Likes

No, it doesn’t currently support that. I’m pretty busy right now, but you’re welcome to open a feature request or submit a pull request. I’m not sure how that works on the energy card, so I’m not sure the math that needs to be done.

I was also using the tesla-style-card but yours does fit in more in the default lovelace style. Thanks for the development.


As for your formula for the speed of the dots: maybe you can figure out what the Tesla-style card does. The flow of the dots there is very dynamic.

1 Like

thats a good idea Tesla-style card has the flowing balls at the right speeds - this mod is amazing though and have switched to it

does this support - EV charging like the Tesla card?

No, it does not.

Thanks, I’ll put a feature request on the github. I wouldn’t have a clue how to do a pull request or make my own changes - no dev skills beyond writing some dodgy templates and yaml for HA!

Probably a dumb question, but how can I select the time-range for the card? I have it working but would like to select just todays view. The screenshot shows the total (and I just connect the solar energy meter, so comparison is off).

Thanks!

image

Also, i am using DSRM P1 energy production/consumption so I am getting two sensors (sensor.energy_consumption_tarif_1 and sensor.energy_consumption_tarif_2). Is there a way of adding them both without creating a new sensor?

This card is designed for instantaneous readings to be displayed, not long-term readings. Your consumption readings appear to be long-term readings which aren’t suitable for this card. That’s why this card doesn’t have date ranges or any way to select historical data; it’s intended for showing the power flow at this moment only.

1 Like

Clear, will create the required template sensor for daily results. Thanks!

You don’t have to, that’s where the energy dashboard comes in.

Yes, but I would only like to use parts of the energy dashboard on my love-lace frontend. Now using utility_meter

utility_meter:
  solar_energy_daily:
    source: sensor.pm_st_solar_energy
    cycle: daily
    name: "Solar daily"

If there are other/better ways to do it, keen to learn!

Cheers!

As @kpfleming says this card is for instantaneous readings, ie power in W or kW

You look like you want energy readings, in Wh or kWh so you need to use the energy card (same as the one in the energy dashboard) but that will display only the same as you have configured in the energy dashboard:

Much simpler, haha. Thanks for the tip!

Can anyone show me where I can learn how to install this?

I have HACS but it doesn’t find ‘power flow’.
Manual installation mentions ‘config/www’, but that’s not there either.

You should look at the second tab in HACS (Frontend) and search for Power Flow Card. Oh, and don’t search in the field on top but use the blue button on the right bottom of the page (explore and download). Otherwise you search in your installed repositories only.

2 Likes

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