Skip to content

Conversation

@MindFreeze
Copy link
Member

@MindFreeze MindFreeze commented Oct 14, 2025

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.

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Copy link
Contributor

Copilot AI left a 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-graph card 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

@laupalombi
Copy link
Member

Great idea! Question:

Can be conditionally included in the energy dashboard after its layout is updated.

What are the conditions to show it or now?

@MindFreeze
Copy link
Member Author

It's not shown now. Just added as a card that dashboards can use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

4 participants