Skip to content

Commit 0e26e47

Browse files
authored
Changes that support 1.3.3
## Added **Devices and labels are now unlimited!** Important: you must increase the size of the card to see more labels/devices. Just adding them to the card configuration / YAML is not enough, the card hides them if rows/column minimums aren't met. Cap limits are in place for the default size of the card (12 columns, 3 rows): 2 Grid, 2 Battery, 4 PV labels, 8 Devices. Note: There are of course theoretical limits due to the size of the cards which I cannot really avoid without making the UI tiny. In testing I am seeing 8 devices and PV labels for every 12 columns used, in theory grid and battery labels should be unlimited if you keep growing the card height. Another Note: On small screens (phones), the width of wide cards is squeezed small - in this case a max of 8 PV labels or devices will be shown in the UI. Reminder: Card resizing is [managed using sections](https://github.com/pacemaker82/Compact-Power-Card#managing-the-size-of-the-card). **Your mileage may vary with this change. It can lead to overlapping labels and other undesirable effects as there are so many possible scenarios that I can't really control.** ## Other Changes - `curve_factor` updated to support 0-5 range. - `curved_lines` is now deprecated. Use `curve_factor: 0` for same effect. - Refactored all geometry across render and update to remove duplication.
1 parent 95110a7 commit 0e26e47

2 files changed

Lines changed: 479 additions & 257 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
<img width="1043" height="640" alt="Screenshot 2025-12-24 at 07 39 40" src="https://github.com/user-attachments/assets/583dde65-2885-4cfb-8db0-d91a9ec7c580" />
66

7-
Inspired by the excellent [power flow card plus](https://github.com/flixlix/power-flow-card-plus) - A compact power card for Home Assistant that supports a tighter user experience, and 8 power devices/feeds from the home in a single card. In addition, the card can show up to 8 entity labels for whatever you want, colour and configure them how you need.
7+
Inspired by the excellent [power flow card plus](https://github.com/flixlix/power-flow-card-plus) - A compact power card for Home Assistant that supports a tighter user experience, labels and power devices in the home in a single card. Various elements are very customisable, see below for more.
88

99
## Functionality
1010

11-
- Up to 8 device power entities for the home that can help calculate the rest of home usage
12-
- Up to 8 additional state labels to show related info, like battery %, grid voltage, PV energy or whatever you want.
11+
- Add Device power entities for the home that can help calculate the rest of home usage
12+
- Add labels to show related info, like battery %, grid voltage, PV energy or whatever you want.
1313
- Thresholds can be set on entities to fade out the entity label below the threshold.
1414
- Home power is calculated by default based on the grid/power/battery. Alternatively, use a home power sensor.
1515
- Home icon dynamically changes colour based on the power provided to it.
16-
- Grid & Battery sensors expect +/- values for import/export or charge/discharge. These can be inverted if the default behaviour isn't what you want.
16+
- Grid & Battery sensors expect +/- values for import/export or charge/discharge. These can be inverted if the default behaviour isn't what you want. You can also provide separate import/export and charge/discharge entities.
1717
- Icons, colors and units can be customised.
1818

1919
## Installation
@@ -33,7 +33,6 @@ Before you dive in getting a complicated card all setup, start with the basics.
3333

3434
```yaml
3535
type: custom:compact-power-card
36-
curved_lines: true
3736
curve_factor: 1
3837
entities:
3938
pv:
@@ -46,13 +45,15 @@ entities:
4645
4746
## Managing the size of the card
4847
49-
This card is designed for the new [Home Assistant Sections UI](https://www.home-assistant.io/dashboards/sections/), introduced in 2024. This allows you to scale the card horizontally or vertically as you see fit. The card will dynamically resize to fit the rows and columns you setup in the card UI:
48+
This card is designed for the new [Home Assistant Sections UI](https://www.home-assistant.io/dashboards/sections/), introduced in 2024. This allows you to scale the card horizontally or vertically as you see fit. The card will dynamically resize to fit the rows and columns you setup in the card UI.
49+
50+
**Note:** Caps are in place for the default size of the card (12 columns, 3 rows): 2 Grid, 2 Battery, 4 PV labels, 8 Devices.
5051
5152
<img width="1000" height="741" alt="Screenshot 2025-12-18 at 10 41 00" src="https://github.com/user-attachments/assets/e0a1a5e2-8567-4c69-ad4e-c4cb7b0ec984" />
5253
5354
# Compact Power Card Settings (Quick Reference)
5455
55-
**Note:** All of these settings are available in the configuration UI, details here for reference.
56+
**Note:** All of these settings are available in the configuration UI (unless mentioned otherwise), details here for reference.
5657
5758
## Card-level
5859
@@ -62,8 +63,7 @@ This card is designed for the new [Home Assistant Sections UI](https://www.home-
6263
| Decimal places | `decimal_places`| Default decimal places for all labels/values unless overridden at the entity/label level. |
6364
| Subtract devices from home | `subtract_devices_from_home` | If true, subtract summed devices from the home value. Default: `false`. |
6465
| Power Unit Override | `power_unit`| Set to W, kW or mW |
65-
| Show curved lines? | `curved_lines`| Set to `false` if you want a more straight-edge look. Default `true` |
66-
| Curved Line Radius | `curve_factor`| Adjusts the curve radius. `1` to `5`, `1` is default. Only works when `curved_lines: true` |
66+
| Curved Line Radius | `curve_factor`| Adjusts the curve radius. `0` to `5`, `1` is default. Set to `0` for straight lines. |
6767
| Device Power Lines | `show_device_power_lines`| Set to `true` to light up devices when power is flowing beyond a threshold. Default `false` |
6868
| Home Icon Gradient | `disable_home_gradient`| Set to `true` if you want the home icon to be a single colour. |
6969
| Remove Glow Effects | `remove_glow_effects`| Set to `true` to disable drop shadow/glow effects. Default `false` (dark mode only). |
@@ -85,7 +85,6 @@ Example:
8585
```yaml
8686
type: custom:compact-power-card
8787
threshold_mode: display_only
88-
curved_lines: true
8988
curve_factor: 5
9089
```
9190

@@ -99,27 +98,27 @@ Common keys for `pv`, `grid`, `home`, `battery`. The following settings are poss
9998
| Threshold | `threshold` | Values below this are zeroed (per `threshold_mode`) and dimmed. |
10099
| Decimals | `decimal_places` | Number of decimals to display (defaults to card-level `decimal_places`, or 1). |
101100
| Unit override | `unit` / `unit_of_measurement` | Converts `W` to `kW` if set to `kW` |
102-
| Invert state values | `invert_state_values` | Flip sign of grid/battery readings (e.g., import/export, charge/discharge). |
101+
| Invert state values | `invert_state_values` | Flip positive/negative for the grid/battery readings |
103102
| Tap Action | `tap_action` | Set to `more-info` or `navigate`. `navigate` requires a `navigation_path`. Default behaviour is `more-info` |
104103
| Navigation Path | `navigation_path` | Used with `tap_action: navigate`. Set to a local path to go to a dashboard, e.g. `/my-dashboard/page` |
105104

106105
### Separate Entities for Grid or Battery:
107106

108107
If you don't have a single entity for grid or battery power, you can instead use separate entities for both. This is not part of the configuration UI, it can only be added as YAML manually to the card.
109108

110-
For Grid:
109+
**For Grid:**
111110

112111
| Name | Setting slug | What it does |
113112
| ------------------- | ----------------------- | ------------------------------------------------------------------------------- |
114113
| Import Entity | `import_entity` | Sensor defining the import power from the grid. |
115114
| Export Entity | `export_entity` | Sensor defining the export power to the grid. |
116115

117-
For Battery (can be provided for each battery):
116+
**For Battery** (can be provided for each battery):
118117

119118
| Name | Setting slug | What it does |
120119
| ------------------- | ----------------------- | ------------------------------------------------------------------------------- |
121120
| Charge Entity | `charge_entity` | Sensor defining the charge power to the battery. |
122-
| Discharge Entity | `discharge_entity` | Sensor defining the discharge power from the battery. |
121+
| Discharge Entity | `discharge_entity` | Sensor defining the discharge power from the battery. |
123122

124123
Example:
125124

@@ -170,7 +169,7 @@ The card supports many combinations: PV/Grid/Home/Battery, PV/Grid/Home, Battery
170169

171170
### Supporting multiple batteries
172171

173-
The card will support more than 1 battery, this is experimental at the moment. Each battery can have a soc and capacity entity too.
172+
The card can support more than 1 battery. Each battery can have a soc and capacity entity too.
174173

175174
The UI will calculate your % of battery available across multiple batteries. If you just provide the `battery_soc` it will be an average across the SoCs. If you also provide the `battery_capacity` it will calculate a weighted average across the batteries.
176175

@@ -193,10 +192,12 @@ entities:
193192

194193
## Devices
195194

196-
Devices are up to 8 power feeds within your home that you want to show in the card. By default, device power is not subtracted from the home power value. If you want that to happen, set the card-level `subtract_devices_from_home: true`.
195+
Devices are power feeds within your home that you want to show in the card. By default, device power is not subtracted from the home power value. If you want that to happen, set the card-level `subtract_devices_from_home: true`.
197196

198197
**Important:** Any entity can be used in the device section to show icon/label, but only entities with `device_class: power` will be subtracted from the home power if `subtract_devices_from_home: true`. In addition, only devices with `device_class: power` will show power flow lines in the devices section.
199198

199+
**Important:** You can add as many devices as you want, however the display of them is determined by the card width, 12 columns = up to 8 devices, 24 columns = up to 16 devices. On small screens (phones) this will still be limited to 8 devices, unless in landscape mode where you should have more real estate.
200+
200201
| Name | Setting slug | What it does |
201202
| ----------------------- | --------------------------------- | -------------------------------------------------------------------------------- |
202203
| Device entity | `entity` | Sensor/entity id for a load. |
@@ -220,6 +221,7 @@ Example below of how devices can be setup:
220221
threshold: 50
221222
color: "#FFFFFF"
222223
switch_entity: switch.car_charger
224+
name: Polestar
223225
- entity: sensor.pool_pump_power
224226
icon: mdi:pool
225227
threshold: 50
@@ -231,11 +233,13 @@ Example below of how devices can be setup:
231233

232234
## Labels (per pv/grid/battery)
233235

234-
Labels can be used to display "other" information - that can be more power stats, energy stats, weather, whatever you want. You can add up to four PV labels and two grid labels (plus battery labels separately). Note: these are just labels, they do not factor into the power diagram or calculations at all.
236+
Labels can be used to display "other" information - that can be more power stats, energy stats, weather, whatever you want. Note: these are just labels, they do not factor into the power diagram or calculations at all.
237+
238+
**Important:** You can add as many labels as you want, however the display of them is determined by the card size width and height. Defaults for a 12 column, 3 row card are 2 labels for grid and battery, 4 labels for PV. Max 8 labels for PV on small screens like phones, the rest are hidden.
235239

236240
| Name | Setting slug | What it does |
237241
| ------------- | ---------------------------- | -------------------------------------------------------------------- |
238-
| Labels list | `labels` | Array (max 4 for PV, max 2 for grid) of label objects. |
242+
| Labels list | `labels` | Array of labels objects. |
239243
| Label entity | `entity` | Sensor/entity id for the label value. |
240244
| Label attribute | `attribute` | Read from an attribute instead of state. |
241245
| Label name | `name` | PV only. Add a name to the label. Ensure card is >= 4 rows in height. |
@@ -274,6 +278,20 @@ Battery labels are setup differently (due to the nature of supporting multi-batt
274278
- entity: sensor.my_sensor
275279
```
276280

281+
## A specific note on unlimited devices and labels...
282+
283+
**Important:** you must increase the size of the card to see more labels/devices. Just adding them to the card configuration / YAML is not enough, the card hides them if rows/column minimums aren't met.
284+
285+
There are cap limits are in place for the default size of the card (12 columns, 3 rows): 2 Grid, 2 Battery, 4 PV labels, 8 Devices.
286+
287+
**Note:** There are of course theoretical limits due to the size of the cards which I cannot really avoid without making the UI tiny. In testing I am seeing 8 devices and PV labels for every 12 columns used, in theory grid and battery labels should be unlimited if you keep growing the card height.
288+
289+
**Another Note:** On small screens (phones), the width of wide cards is squeezed small - in this case a max of 8 PV labels or devices will be shown in the UI.
290+
291+
**Reminder:** Card resizing is [managed using sections](https://github.com/pacemaker82/Compact-Power-Card#managing-the-size-of-the-card).
292+
293+
**Your mileage may vary with limitless labels and devices. It can lead to overlapping labels or other undesirable effects as there are so many possible scenarios that I can't really control.**
294+
277295
## Unit & Formatting behavior
278296
- W values auto-convert to kW when ≥ 1000 W, unless `power_unit` is forcing to `W`.
279297
- kWh values auto-convert to MWh when ≥ 1000 kWh.

0 commit comments

Comments
 (0)