Skip to content

Commit 8ca1a37

Browse files
committed
Rename project to Power Flow Live and add new features
- Rename system-flow-card to power-flow-live across all files, classes, and config - Replace global fadeIdylElements with per-element fade option (never/no-flow/unavailable) - Add configurable sizing options: boxSize, iconSize, valueFontSize, extraFontSize, sideExtraFontSize - Update README with new documentation and upstream credits
1 parent e444725 commit 8ca1a37

12 files changed

Lines changed: 5181 additions & 3394 deletions

.releaserc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ module.exports = {
1010
{
1111
replacements: [
1212
{
13-
files: ["dist/system-flow-card.js"],
14-
from: /System Flow Card v(\d+\.\d+\.\d+)/,
15-
to: "System Flow Card v${nextRelease.version}",
13+
files: ["dist/power-flow-live.js"],
14+
from: /Power Flow Live v(\d+\.\d+\.\d+)/,
15+
to: "Power Flow Live v${nextRelease.version}",
1616
results: [
1717
{
18-
file: "dist/system-flow-card.js",
18+
file: "dist/power-flow-live.js",
1919
hasChanged: true,
2020
numMatches: 2,
2121
numReplacements: 2,

README.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
1-
# System Flow Card
1+
# Power Flow Live
22

3-
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=flat-square)](https://github.com/hacs/integration)
4-
![GitHub release (latest by date)](https://img.shields.io/github/v/release/flyrmyr/system-flow-card?style=flat-square)
5-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/flyrmyr/system-flow-card/CI?style=flat-square)
6-
![GitHub all releases](https://img.shields.io/github/downloads/flyrmyr/system-flow-card/total?style=flat-square)
7-
8-
This card for [Home Assistant](https://home-assistant.io/) Dashboards is designed to provide system distribution in an identical style to the Official Energy Distribution card included by Home Assistant.
3+
A custom [Home Assistant](https://home-assistant.io/) Lovelace card that visualises live power flow with animated dots, inspired by the official Energy Distribution card.
94

105
<img width="454" alt="Screenshot 2023-02-17 at 1 46 52 AM" src="https://user-images.githubusercontent.com/14035884/219596902-40d68252-fa60-49ef-a354-f14d8a89b1a3.png">
116

12-
## Install
13-
14-
### HACS (recommended)
15-
16-
This card is available in [HACS](https://hacs.xyz/) (Home Assistant Community Store).
17-
<small>_HACS is a third party community store and is not included in Home Assistant out of the box._</small>
18-
197
### Manual install
208

21-
1. Download and copy `system-flow-card.js` from the [latest release](https://github.com/flyrmyr/system-flow-card/releases/latest) into your `config/www` directory.
9+
1. Download and copy `power-flow-live.js` from the [latest release](https://github.com/mathewgreen/power-flow-live/releases/latest) into your `config/www` directory.
2210

2311
2. Add the resource reference as decribed below.
2412

2513
### Add resource reference
2614

27-
If you configure Dashboards via YAML, add a reference to `system-flow-card.js` inside your `configuration.yaml`:
15+
If you configure Dashboards via YAML, add a reference to `power-flow-live.js` inside your `configuration.yaml`:
2816

2917
```yaml
3018
resources:
31-
- url: /local/system-flow-card.js
19+
- url: /local/power-flow-live.js
3220
type: module
3321
```
3422
@@ -39,8 +27,8 @@ Else, if you prefer the graphical editor, use the menu to add the resource:
3927
3. Click three dot icon
4028
4. Select Resources
4129
5. Hit (+ ADD RESOURCE) icon
42-
6. Enter URL `/local/system-flow-card.js` and select type "JavaScript Module".
43-
(Use `/hacsfiles/system-flow-card/system-flow-card.js` and select "JavaScript Module" for HACS install if HACS didn't do it already)
30+
6. Enter URL `/local/power-flow-live.js` and select type "JavaScript Module".
31+
(Use `/hacsfiles/power-flow-live/power-flow-live.js` and select "JavaScript Module" for HACS install if HACS didn't do it already)
4432

4533
## Using the card
4634

@@ -53,12 +41,16 @@ I recommend looking at the [Example usage section](#example-usage) to understand
5341

5442
| Name | Type | Default | Description |
5543
| ----------------- | -------- | :-----------: | ------------|
56-
| type | `string` | **required** | `custom:system-flow-card`.
44+
| type | `string` | **required** | `custom:power-flow-live`.
5745
| title | `string` | | Shows a title at the top of the card.
5846
| system | `object` | | Define parameters of the central `System` element, see [system object](#system-object) for additional system element options.
5947
| elements | `object` | **required** | One or more sensor entities, see [element object](#element-object) for additional entity options.
60-
| speed | `string` | 5 | Define the average time (s) for dots to travel.
61-
| fadeIdylElements | `string` | | Fade elements that are not currently producing or consuming.
48+
| speed | `number` | `5` | Average time (s) for dots to travel.
49+
| boxSize | `number` | `80` | Size (px) of each element box.
50+
| iconSize | `number` | `24` | Size (px) of icons inside element boxes.
51+
| valueFontSize | `number` | `12` | Font size (px) for the main value text in element boxes.
52+
| extraFontSize | `number` | `10` | Font size (px) for the extra main sensor text.
53+
| sideExtraFontSize | `number` | `10` | Font size (px) for the left/right extra sensor text.
6254

6355
#### System object
6456
The system is essentially an [element object](#element-object). The `value` is calculated from the difference in providers and consumers in the system (a positive value shows net unaccounted for production). This element has a central position.
@@ -85,6 +77,7 @@ The system is essentially an [element object](#element-object). The `value` is c
8577
| fill | `string` | | Entity ID of a sensor providing a state of 0 - 100 (%) fill of the element box
8678
| invert | `boolean` | false | Invert element value for the system flow calculation
8779
| exclude | `boolean` | false | Exclude element value from the system flow calculation
80+
| fade | `string` | `never` | Controls when the element fades out. `never`: never fade. `no-flow`: fade when power flow is zero. `unavailable`: fade only when the entity is unavailable/unknown.
8881
| extra | `object` | | Extra sensor values to display within the element box. See [element extra object](#element-extra-object) for additional extra options.
8982

9083
#### Element value object
@@ -109,9 +102,12 @@ The system is essentially an [element object](#element-object). The `value` is c
109102
For those testing, here is my current config:
110103

111104
```yaml
112-
type: custom:system-flow-card
105+
type: custom:power-flow-live
113106
speed: 3
114-
fadeIdylElements: true
107+
boxSize: 90
108+
iconSize: 28
109+
valueFontSize: 14
110+
extraFontSize: 11
115111
system:
116112
unit: W
117113
icon: mdi:rv-truck
@@ -122,6 +118,7 @@ elements:
122118
icon: mdi:power-socket-au
123119
position: left
124120
color: '#B62D00'
121+
fade: no-flow
125122
extra:
126123
main: sensor.victron_multiplus_state_238
127124
left: sensor.victron_multiplus_activein_l1_voltage_238
@@ -130,12 +127,14 @@ elements:
130127
icon: mdi:engine
131128
position: left
132129
color: '#f67828'
130+
fade: no-flow
133131
extra:
134132
left: sensor.victron_alternator_battery_voltage
135133
right: sensor.victron_alternator_battery_current
136134
- value: sensor.victron_battery_power
137135
invert: true
138136
icon: mdi:car-battery
137+
fade: unavailable
139138
extra:
140139
main: sensor.victron_system_battery_soc
141140
left: sensor.victron_system_battery_voltage
@@ -145,6 +144,7 @@ elements:
145144
color: '#3FF628'
146145
- value: sensor.victron_solar_pv_power
147146
icon: mdi:solar-power-variant
147+
fade: no-flow
148148
extra:
149149
main: sensor.victron_solar_yield_today
150150
left: sensor.victron_solar_pv_voltage
@@ -171,7 +171,11 @@ elements:
171171

172172
## Credits
173173

174-
- [HA Energy Distribution Card](https://www.home-assistant.io//dashboards/energy/#energy-distribution)
174+
This project is a fork of [samuelolteanu/system-flow-card](https://github.com/samuelolteanu/system-flow-card), which was itself forked from [flyrmyr/system-flow-card](https://github.com/flyrmyr/system-flow-card).
175+
176+
- [flyrmyr](https://github.com/flyrmyr/system-flow-card) — original System Flow Card
177+
- [samuelolteanu](https://github.com/samuelolteanu/system-flow-card) — intermediate fork
178+
- [ulic75/power-flow-card](https://github.com/ulic75/power-flow-card) — inspiration
179+
- [HA Energy Distribution Card](https://www.home-assistant.io/dashboards/energy/#energy-distribution) — official HA card that inspired the design
175180
- [@angular/cdk](https://github.com/angular/components/tree/main/src/cdk)
176181
- [Jack Moore](https://www.jacklmoore.com/notes/rounding-in-javascript/)
177-
- [ulic75](https://github.com/ulic75/power-flow-card)

0 commit comments

Comments
 (0)