-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Power sources chart #27501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: power
Are you sure you want to change the base?
Power sources chart #27501
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new power sources graph card for the energy dashboard that displays real-time power flow from various energy sources (solar, grid, battery) in a line chart format. The card shows both consumption and charging/return flows in a single visualization with area fill gradients.
Key changes:
- Added new
power-sources-graphcard type with comprehensive TypeScript interfaces and component implementation - Extended energy data collection to include high-resolution power statistics alongside existing energy statistics
- Enhanced chart formatting utilities to support line charts with proper tooltip formatting
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/translations/en.json |
Added localization strings for power graph labels (Grid, Solar, Battery) |
src/panels/lovelace/editor/get-dashboard-documentation-url.ts |
Added documentation URL mapping for the new power-sources-graph card |
src/panels/lovelace/create-element/create-card-element.ts |
Registered lazy loading for the new power sources graph card component |
src/panels/lovelace/cards/types.ts |
Added TypeScript interface for PowerSourcesGraphCardConfig |
src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts |
Main card component implementation with data processing and visualization logic |
src/panels/lovelace/cards/energy/common/energy-chart-options.ts |
Enhanced tooltip formatting and added fillLineGaps utility for line chart data processing |
src/data/energy.ts |
Extended energy data collection to fetch power statistics with fine-grained time periods |
src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts
Outdated
Show resolved
Hide resolved
src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts
Outdated
Show resolved
Hide resolved
src/panels/lovelace/cards/energy/common/energy-chart-options.ts
Outdated
Show resolved
Hide resolved
src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts
Outdated
Show resolved
Hide resolved
src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts
Outdated
Show resolved
Hide resolved
src/panels/lovelace/cards/energy/hui-power-sources-graph-card.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Aidan Timson <[email protected]>
|
Great idea! Question:
What are the conditions to show it or now? |
|
It's not shown now. Just added as a card that dashboards can use |
Proposed change
A line graph showing the power flow of all the energy sources - solar, grid, battery. Can be conditionally included in the energy dashboard after its layout is updated.
Show consumption and return/charging in one graph.
Comparing is not supported for now and probably shouldn't be for such graphs.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: