Open
Conversation
Add a new energy card that displays grid energy as an equation (imported - exported = net) with a visual bar gauge showing the balance between grid import and export. The card appears in the energy dashboard sidebar when grid return is configured.
Member
Author
|
This started as something different but it ended up as kind of a replacement for the |
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new built-in Energy dashboard card to visualize grid import/export as an equation and centered balance bar, and wires it into the Energy dashboard strategy so it is auto-inserted when grid export is configured.
Changes:
- Introduces
hui-energy-grid-balance-cardrendering an import − export = net equation with tooltips and a balance bar. - Registers the new card type for Lovelace lazy-loading and adds a new energy card config type.
- Auto-adds the new card to the Energy dashboard sidebar (and a small-screen section) when grid return/export is configured, plus adds English translations.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/translations/en.json | Adds localization strings for the new grid balance card title/tooltips. |
| src/panels/lovelace/create-element/create-card-element.ts | Registers energy-grid-balance for lazy-loaded card creation. |
| src/panels/lovelace/cards/types.ts | Adds EnergyGridBalanceCardConfig for the new card type. |
| src/panels/lovelace/cards/energy/hui-energy-grid-balance-card.ts | Implements the new grid balance card UI and data subscription. |
| src/panels/energy/strategies/energy-view-strategy.ts | Auto-inserts the new card into the Energy dashboard when export is configured. |
Only add the grid balance card to the dashboard when both import and export meters are configured, not just export alone.
Add getConfigElement, getStubConfig, editor type union registration, card registry entry, and documentation URL mapping.
NoRi2909
reviewed
Apr 14, 2026
- Split equation tooltip into per-value tooltips matching the bar - Use custom title from config if provided - Render with zeros when grid data is missing instead of blank - Add card name and description for the card picker - Handle small values with significant digit formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Add a new energy card that displays grid energy as an equation showing imported energy minus exported energy equals net consumption. The card includes a visual bar gauge that represents the ratio between imported and exported energy, with the bar filling from a center line toward the dominant direction.
There are tooltips explaining the values
The card is automatically added to the energy dashboard sidebar when grid return (export) is configured.
In theory we can have the same card for batteries but I don't see the value there. And efficiency losses would complicate it.
Screenshots
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: