This card for Home Assistant Dashboards is designed to provide power distribution in an identical style to the Official Energy Distribution card included by Home Assistant.
preview.mov
This card is available in HACS (Home Assistant Community Store). HACS is a third party community store and is not included in Home Assistant out of the box.
-
Download and copy
power-distribution-card.js
from the latest release into yourconfig/www
directory. -
Add the resource reference as decribed below.
If you configure Dashboards via YAML, add a reference to power-distribution-card.js
inside your configuration.yaml
:
resources:
- url: /local/power-distribution-card.js
type: module
Else, if you prefer the graphical editor, use the menu to add the resource:
- Make sure, advanced mode is enabled in your user profile (click on your user name to get there)
- Navigate to Configuration -> Dashboards -> Resources Tab. Hit (+ ADD RESOURCE) icon
- Enter URL
/local/power-distribution-card.js
and select type "JavaScript Module". (Use/hacsfiles/power-distribution-card/power-distribution-card.js
and select "JavaScript Module" for HACS install if HACS didn't do it already)
I recommend looking at the Example usage section to understand the basics to configure this card. (also) pay attention to the required options mentioned below.
Name | Type | Default | Description |
---|---|---|---|
type (required) | string | custom:power-distribution-card . |
|
entities (required) | map | One or more sensor entities in a list, see entities map for additional entity options. | |
min_flow_rate | number | .75 | Represents the fastest amount of time in seconds for a flow dot to travel from one end to the other, see flow formula. |
max_flow_rate | number | 6 | Represents the slowest amount of time in seconds for a flow dot to travel from one end to the other, see flow formula. |
Name | Unit | Description |
---|---|---|
grid (required) | kW | Entity providing a state with a positive value when consuming and a negative value when producting. |
battery | kW | Entity providing a state with a positive value when charging and a negative value when discharging. |
battery_charge | % | Entity providing a state with the current percentage of charge on the battery. |
solar | kW | Entity providing a state with the value of generation. |
type: custom:power-distribution-card
title: Realtime Distribution
entities:
battery: sensor.powerwall_battery_now
battery_charge: sensor.powerwall_charge
grid: sensor.powerwall_site_now
solar: sensor.powerwall_solar_now
max_flow_rate: 10
This formula is based on the offical formula used by the Energy Distribution card.
max - (value / total) * (max - min);
I'm not 100% happy with this. I'd prefer to see the dots travel slower when flow is low, but faster when flow is high. For example if the only flow is Grid to Home, I'd like to see the dot move faster if the flow is 15kW, but slower if it's only 2kW. Right now the speed would be the same. If you have a formula you'd like to propose please submit a PR.