Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions README.cs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# UltimatePower Card

[English](README.md) · **Česky**

Karta pro Home Assistant, která ukazuje, kudy právě teče energie: výroba z fotovoltaiky, spotřeba domu, baterie a síť. Toky jsou animované a pod schématem je bilance energie, ve které se dá listovat do minulosti. Rozložení vychází z monitoru energie známého z Loxone.

<p>
<img src="https://raw.githubusercontent.com/Developer089/UltimatePower-Card/main/docs/images/preview-dark-cs.png" width="380" alt="Karta v tmavém motivu: fotovoltaika napájí dům, baterie i síť">
<img src="https://raw.githubusercontent.com/Developer089/UltimatePower-Card/main/docs/images/preview-light-cs.png" width="380" alt="Karta ve světlém motivu: večer dům napájí baterie a síť">
</p>

Na obrázcích jsou ukázková data.

> **Stav:** raný vývoj (v0.x). Volby se před první stabilní verzí mohou změnit.

## Co karta umí

- **Čtyři hlavní uzly kolem středu:** výroba, spotřeba, baterie a síť. Karta se vejde do jednoho sloupce nástěnky.
- **Libovolný počet stringů, baterií a spotřebičů.** Stringy jsou v řadě nad výrobou, baterie (s kroužkem stavu nabití) a spotřebiče visí pod svým uzlem.
- **Barvy s jedním významem:** zelená je vlastní energie (výroba, baterie, dodávka do sítě), oranžová je spotřeba a odběr ze sítě. Uzel v klidu zešedne.
- **Animace toku:** tečky běží od zdroje ke spotřebiči a s výkonem výrazně zrychlují. Uzel, který energii dodává, pulzuje ven; uzel, který ji odebírá, pulzuje dovnitř.
- **Bez senzoru spotřeby domu:** spotřeba se počítá z fotovoltaiky, sítě a baterie. Co nepokryjí zadané spotřebiče, ukáže se jako „Ostatní".
- **Bilance energie:** výroba, spotřeba, odběr a dodávka do sítě, soběstačnost a vlastní spotřeba za den, týden, měsíc nebo rok. Listuje se šipkami nebo tažením po grafu. Sekci lze vypnout.
- **Baterie oběma způsoby:** jeden senzor výkonu se znaménkem, nebo zvlášť senzor nabíjení a vybíjení.
- Klik na uzel otevře jeho detail v Home Assistantu. České a anglické popisky, světlý i tmavý motiv.

Zatím chybí: vizuální editor nastavení, vlastní barvy a ikony.

## Instalace

### HACS

1. HACS → **⋮** → **Vlastní repozitáře**.
2. Přidej `Developer089/UltimatePower-Card`, typ **Dashboard** (ve starším HACS *Lovelace*).
3. Najdi **UltimatePower Card**, stáhni ji a obnov stránku v prohlížeči.

### Ručně

1. Stáhni `ultimate-power-card.js` z [posledního vydání](https://github.com/Developer089/UltimatePower-Card/releases).
2. Zkopíruj ho do `/config/www/ultimate-power-card/`.
3. Přidej zdroj nástěnky: `/local/ultimate-power-card/ultimate-power-card.js`, typ **JavaScript modul**.

## Nastavení

Karta se nastavuje v YAML. Povinná je jen `grid_entity`.

```yaml
type: custom:ultimate-power-card
name: Energie
grid_entity: sensor.sit_vykon

pv_strings:
- { power_entity: sensor.fve_vychod, name: Východ }
- { power_entity: sensor.fve_zapad, name: Západ }

batteries:
# jeden senzor se znaménkem: kladná hodnota = vybíjení
- power_entity: sensor.baterie_1_vykon
soc_entity: sensor.baterie_1_soc
name: Baterie 1
# nebo dva senzory, které jsou oba vždy kladné
- charge_entity: sensor.baterie_2_nabijeni
discharge_entity: sensor.baterie_2_vybijeni
soc_entity: sensor.baterie_2_soc
name: Baterie 2

appliances:
- { power_entity: sensor.wallbox_vykon, name: Wallbox }
- { power_entity: sensor.tepelne_cerpadlo_vykon, name: Tepelné čerpadlo }
- { power_entity: sensor.bojler_vykon, name: Bojler }
```

### Znaménka

- **Síť:** kladná hodnota = odběr, záporná = dodávka. Pokud to elektroměr hlásí obráceně, nastav `grid_invert: true`. Pokud máš odběr a dodávku ve dvou senzorech, zadej druhý do `grid_export_entity`.
- **Baterie:** kladná hodnota = vybíjení, záporná = nabíjení. U baterie s opačným znaménkem nastav `invert: true`.
- **Spotřeba domu** se nečte ze senzoru. Je to `FVE + síť + baterie`, takže vychází správně jen tehdy, když jsou zadané všechny tři.

Senzory výkonu mohou být ve W nebo kW.

### Volby

| Volba | Výchozí | Význam |
|---|---|---|
| `grid_entity` | povinná | Výkon sítě. Kladná hodnota = odběr, záporná = dodávka. |
| `grid_export_entity` | – | Jen když jsou odběr a dodávka dva samostatné, vždy kladné senzory. |
| `grid_invert` | `false` | Když senzor sítě hlásí dodávku kladně. |
| `pv_strings[]` | – | `power_entity`, volitelně `name`. |
| `pv_total_entity` | součet stringů | Celkový výkon FVE, pokud na něj máš samostatný senzor. |
| `batteries[]` | – | `soc_entity`, volitelně `name` a výkon buď jedním senzorem se znaménkem `power_entity` (kladná hodnota = vybíjení, `invert` ho otočí), nebo dvěma vždy kladnými senzory `charge_entity` + `discharge_entity`. |
| `battery_total_entity`, `battery_invert` | součet baterií | Celkový výkon baterií a přepínač jeho znaménka. |
| `battery_charge_entity`, `battery_discharge_entity` | – | Celkový výkon baterií dvěma vždy kladnými senzory. |
| `appliances[]` | – | `power_entity`, `name`, volitelně `on_threshold_w`. |
| `show_other` | `true` | Zobrazit dopočtený zbytek spotřeby domu. |
| `update_interval` | `1` | Jak často karta překresluje živé hodnoty, v sekundách (1–20). Senzory se nečtou častěji, než samy hlásí. |
| `animation` | `auto` | `auto` se řídí systémovým omezením pohybu, `always` ho ignoruje, `off` animace vypne. |
| `animation_speed` | `1` | Násobitel rychlosti toku. |
| `max_power` | `10000` | Výkon (W), při kterém tok dosáhne plné rychlosti. |
| `show_w_not_kw` | `false` | Vždy zobrazovat watty. |
| `show_statistics` | `true` | Zobrazit sekci s bilancí energie. |
| `statistics` | panel Energie | Vlastní senzory energie: `pv`, `grid_import`, `grid_export`, `battery_charge`, `battery_discharge` (u každého jedno id nebo seznam). |

### Bilance energie

Bilance čte dlouhodobé statistiky Home Assistantu, tedy stejná data jako panel Energie. Ve výchozím stavu si karta vezme senzory FVE, sítě a baterií nastavené v panelu Energie, proto ho nastav jako první. Jiné senzory zadáš pod `statistics`; musí to být senzory energie (kWh) se `state_class: total_increasing`.

## Vývoj

```bash
npm install
npm run watch # při uložení sestaví znovu do dist/
```

Soubor `dist/ultimate-power-card.js` zkopíruj do `/config/www/` vývojového Home Assistantu.

## Licence

Apache License 2.0 — viz [LICENSE](LICENSE).
101 changes: 55 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,82 @@
# UltimatePower Card

A Home Assistant Lovelace custom card that visualises real-time power flow between **multiple PV strings**, **multiple batteries**, the grid, and the home — with a Tesla-style bubble layout and animated flows.
**English** · [Česky](README.cs.md)

> **Status:** 🚧 early development (v0.x). API may change before the first stable release.
A Home Assistant dashboard card that shows where your energy is flowing right now: solar production, house consumption, batteries and the grid, with animated flows and an energy balance you can page through. The layout follows the energy monitor known from Loxone.

## Why another power card?
<p>
<img src="https://raw.githubusercontent.com/Developer089/UltimatePower-Card/main/docs/images/preview-dark-en.png" width="380" alt="Card in the dark theme: solar production feeding the house, the batteries and the grid">
<img src="https://raw.githubusercontent.com/Developer089/UltimatePower-Card/main/docs/images/preview-light-en.png" width="380" alt="Card in the light theme: batteries and the grid feeding the house in the evening">
</p>

Existing cards (`tesla-style-solar-power-card`, `power-flow-card-plus`, `power-flux-card`, …) all assume **one** battery and a small fixed number of consumers. UltimatePower Card targets larger residential / small-commercial setups where you have:
The screenshots use demo data.

- 🟧 **N PV strings / inverters** — see each one separately
- 🟩 **N batteries side by side** — every module's SoC + power visible at a glance
- 🟦 **One main house bubble** + **N appliance branches** (boiler, EV, heat-pump, kitchen circuits, server rack, …)
- ⬜ Grid (import / export)
> **Status:** early development (v0.x). Options may change before the first stable release.

## Features (v0.2)
## Features

- Four main nodes in a cross around a central hub: production, consumption, battery and grid. The card fits one dashboard column.
- N PV strings in a row above production; N batteries (with a state-of-charge ring) and N appliances as chains below their node.
- Green marks own energy (production, battery, export), orange marks consumption and grid import. Idle nodes turn grey.
- Animated flow: dots run from the source to the consumer and speed up steeply with power. A node that supplies energy pulses outwards, a node that draws energy pulses inwards.
- House load is computed from PV, grid and battery; the remainder not covered by appliances is shown as "Other".
- Optional statistics: production, consumption, grid import/export, self-sufficiency and self-consumption per day, week, month or year, with paging into the past (arrows or swipe on the chart).
- Click-through to the HA `more-info` dialog. Czech and English labels, light and dark theme.
- **Four main nodes around a central hub:** production, consumption, battery and grid. The card fits one dashboard column.
- **Any number of PV strings, batteries and appliances.** Strings sit in a row above production; batteries (with a state-of-charge ring) and appliances hang below their node.
- **Colours with one meaning:** green is your own energy (production, battery, export), orange is consumption and grid import. Idle nodes turn grey.
- **Animated flow:** dots run from the source to the consumer and speed up steeply with power. A node that supplies energy pulses outwards, a node that draws energy pulses inwards.
- **No house sensor needed:** the house load is computed from PV, grid and battery. Whatever your listed appliances do not cover is shown as "Other".
- **Energy balance:** production, consumption, grid import and export, self-sufficiency and self-consumption per day, week, month or year. Page into the past with the arrows or by swiping the chart. The section can be switched off.
- **Batteries either way:** one signed power sensor, or separate charge and discharge sensors.
- Click a node to open its Home Assistant detail. English and Czech labels, light and dark theme.

Not yet: visual config editor, custom colours and icons.
Not yet available: visual config editor, custom colours and icons.

## Installation

### Via HACS (recommended once published)
### HACS

1. HACS → Frontend → **⋮** → Custom repositories → add `Developer089/UltimatePower-Card` (type: Lovelace)
2. Install **UltimatePower Card**
3. Add the resource (HACS does this automatically) and refresh
1. HACS → **⋮** → **Custom repositories**.
2. Add `Developer089/UltimatePower-Card`, type **Dashboard** (called *Lovelace* in older HACS).
3. Find **UltimatePower Card**, download it and reload the browser.

### Manual

1. Download `ultimate-power-card.js` from the [latest release](https://github.com/Developer089/UltimatePower-Card/releases)
2. Copy to `/config/www/community/ultimate-power-card/`
3. Add a Lovelace resource: `/local/community/ultimate-power-card/ultimate-power-card.js` (type: `module`)
1. Download `ultimate-power-card.js` from the [latest release](https://github.com/Developer089/UltimatePower-Card/releases).
2. Copy it to `/config/www/ultimate-power-card/`.
3. Add a dashboard resource: `/local/ultimate-power-card/ultimate-power-card.js`, type **JavaScript module**.

## Configuration

Minimal example:
The card is configured in YAML. Only `grid_entity` is required.

```yaml
type: custom:ultimate-power-card
name: My Power
name: Energy
grid_entity: sensor.grid_power

pv_strings:
- { power_entity: sensor.pv_east, name: East }
- { power_entity: sensor.pv_west, name: West }

batteries:
- { power_entity: sensor.bat1_power, soc_entity: sensor.bat1_soc, name: BMS-1 }
- { power_entity: sensor.bat2_power, soc_entity: sensor.bat2_soc, name: BMS-2 }
- { power_entity: sensor.bat3_power, soc_entity: sensor.bat3_soc, name: BMS-3 }
# one signed sensor: positive = discharging
- power_entity: sensor.battery_1_power
soc_entity: sensor.battery_1_soc
name: Battery 1
# or two sensors that are both always positive
- charge_entity: sensor.battery_2_charge_power
discharge_entity: sensor.battery_2_discharge_power
soc_entity: sensor.battery_2_soc
name: Battery 2

appliances:
- { power_entity: sensor.boiler_power, name: Boiler, icon: mdi:water-boiler }
- { power_entity: sensor.ev_charger, name: EV, icon: mdi:car-electric }
- { power_entity: sensor.heatpump_power, name: HP, icon: mdi:heat-pump }
- { power_entity: sensor.kitchen_circuit, name: Kuchyň, icon: mdi:silverware-fork-knife }
- { power_entity: sensor.wallbox_power, name: Wallbox }
- { power_entity: sensor.heat_pump_power, name: Heat pump }
- { power_entity: sensor.boiler_power, name: Boiler }
```

There is no house sensor to configure. The card derives the house load from the energy balance: `PV + grid + battery`, where grid is positive on import and battery is positive on discharge. On the consumption side you only list the individual appliances.
### Sign conventions

- **Grid:** positive = import, negative = export. Use `grid_invert: true` if your meter reports it the other way round, or `grid_export_entity` if import and export are two separate sensors.
- **Battery:** positive = discharging, negative = charging. Use `invert: true` on a battery whose sensor is the other way round.
- **House load** is not read from a sensor. It is `PV + grid + battery`, so it is only right when all three are configured.

Power sensors may be in W or kW.

### Options

Expand All @@ -75,18 +87,22 @@ There is no house sensor to configure. The card derives the house load from the
| `grid_invert` | `false` | Set when the grid sensor reports export as positive. |
| `pv_strings[]` | – | `power_entity`, optional `name`. |
| `pv_total_entity` | sum of strings | Total PV power, if you have a dedicated sensor. |
| `batteries[]` | – | `power_entity` (positive = discharging), `soc_entity`, optional `name`, `invert`. |
| `batteries[]` | – | `soc_entity`, optional `name`, and the power either as one signed sensor `power_entity` (positive = discharging, `invert` flips it) or as two always-positive sensors `charge_entity` + `discharge_entity`. |
| `battery_total_entity`, `battery_invert` | sum of batteries | Total battery power and its sign switch. |
| `battery_charge_entity`, `battery_discharge_entity` | – | Total battery power as two always-positive sensors. |
| `appliances[]` | – | `power_entity`, `name`, optional `on_threshold_w`. |
| `show_other` | `true` | Show the computed remainder of the house load. |
| `update_interval` | `1` | How often the card redraws live values, in seconds (1–20). Sensors are not read more often than they report. |
| `animation` | `auto` | `auto` follows the system "reduce motion" setting, `always` ignores it, `off` never animates. |
| `animation_speed` | `1` | Multiplier for the flow speed. |
| `max_power` | `10000` | Power (W) at which the flow reaches full speed. |
| `show_w_not_kw` | `false` | Always show watts. |
| `show_statistics` | `true` | Show the balance section. |
| `show_statistics` | `true` | Show the energy balance section. |
| `statistics` | Energy dashboard | Override the energy sensors: `pv`, `grid_import`, `grid_export`, `battery_charge`, `battery_discharge` (one id or a list each). |

Statistics read Home Assistant long-term statistics, so the energy sensors must be in kWh with `state_class: total_increasing`. Without the `statistics` option the card uses the sensors configured in the Energy dashboard.
### Energy balance

The balance reads Home Assistant long-term statistics, the same data the Energy dashboard uses. By default the card takes the solar, grid and battery sensors configured in the Energy dashboard, so set that up first. To use other sensors, list them under `statistics`; they must be energy sensors (kWh) with `state_class: total_increasing`.

## Development

Expand All @@ -95,15 +111,8 @@ npm install
npm run watch # rebuilds on save into dist/
```

Then symlink (or copy) `dist/ultimate-power-card.js` into `/config/www/` of your dev Home Assistant.

## Roadmap

- v0.1 — visual MVP (this milestone)
- v0.2 — visual config editor
- v0.3 — `flow_diagram_mode` (line thickness ∝ power), forecast overlay
- v0.4 — battery runtime / autonomy estimate, dynamic-pricing tint
Copy `dist/ultimate-power-card.js` into `/config/www/` of a development Home Assistant.

## License

Apache License 2.0 — see [LICENSE](LICENSE). Visual inspiration from the Tesla Powerwall app and from the `tesla-style-solar-power-card` project (also Apache-2.0).
Apache License 2.0 — see [LICENSE](LICENSE).
Binary file added docs/images/preview-dark-cs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/preview-dark-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/preview-light-cs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/preview-light-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions info.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# UltimatePower Card

Tesla-style power flow card with **multi-PV**, **multi-battery** and **multi-appliance** support — designed for residential setups bigger than a single inverter + one battery.
Energy flow card for Home Assistant: solar production, house consumption, batteries and the grid around a central hub, with animated flows and an energy balance per day, week, month or year.

- 🟧 N PV strings (one bubble each)
- 🟩 N batteries side by side, each with SoC ring
- 🟦 House bubble with a radial fan of appliances
- ⬜ Grid bubble
- Animated flow lines, auto-derived from sensor values
Karta toku energie pro Home Assistant: výroba z fotovoltaiky, spotřeba domu, baterie a síť kolem společného středu, s animací toků a bilancí energie za den, týden, měsíc nebo rok.

<img src="https://raw.githubusercontent.com/Developer089/UltimatePower-Card/main/docs/images/preview-dark-en.png" width="360" alt="UltimatePower Card preview">

- Any number of PV strings, batteries and appliances · libovolný počet stringů, baterií a spotřebičů
- House load computed from PV, grid and battery · spotřeba domu počítaná z FVE, sítě a baterie
- Energy balance with paging into the past · bilance energie s listováním do minulosti

[Documentation (English)](https://github.com/Developer089/UltimatePower-Card#readme) · [Dokumentace (česky)](https://github.com/Developer089/UltimatePower-Card/blob/main/README.cs.md)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ultimate-power-card",
"version": "0.2.0",
"version": "0.2.1",
"description": "Home Assistant custom Lovelace card — Tesla-style power flow with multi-battery and multi-appliance support",
"main": "dist/ultimate-power-card.js",
"type": "module",
Expand Down
Loading
Loading