Skip to content

Conversation

MindFreeze
Copy link
Member

Proposed change

Add a new mode to the energy devices graph with a universal transition animation

Screen.Recording.2025-10-01.at.16.15.35.mov

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:

MindFreeze and others added 3 commits October 1, 2025 16:25
* Add hide_compound_stats option to energy-devices-graph-card

* Update src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* format

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
@karwosts
Copy link
Member

karwosts commented Oct 1, 2025

The device hierarchy is a bit of a problem here right? If you're rendering bars as a percentage of a whole, any energy under a hierarchy is going to be double (or more) counted if you're rendering it as a fraction of 100%.

@MindFreeze
Copy link
Member Author

Yes but the circle doesn't need to represent 100% of the consumption.
There is also a new option to hide compound sensors from this chart. I think it should be enabled bu default at least in the energy dashboard

@MindFreeze
Copy link
Member Author

The idea of this card is to show you the top consumers and conflating end devices with compound ones like breakers just needlessly complicatesb it, imo.

@karwosts
Copy link
Member

karwosts commented Oct 1, 2025

The idea of this card is to show you the top consumers and conflating end devices with compound ones like breakers just needlessly complicatesb it, imo.

I guess I'm afraid "end device" vs "compound device" is not such a black and white distinction. Just because you have at least one child device under a device doesn't mean that it's superflouous, you could have many other loads under a parent that aren't otherwise tracked, and then you'll lose that monitoring.

I fear if we punish users by removing features for enabling hierarchy we'll end up driving them back to whatever janky templates they were trying to use before we added this feature.

@MindFreeze
Copy link
Member Author

Actually we could use this to show the total usage in the middle and then it would make a lot of sense to show the untracked part of parents like in the other chart. Only when they are enabled of course.
I'll make some changes tomorrow.

@MindFreeze MindFreeze marked this pull request as draft October 1, 2025 14:51
@MindFreeze
Copy link
Member Author

Add total in the center and made the graph show only the untracked part of compound sensors. Just like the other devices graph
image

renovate bot and others added 4 commits October 2, 2025 10:05
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Add a sub-editor to hui-entity-editor

* item styling
@MindFreeze MindFreeze marked this pull request as ready for review October 2, 2025 07:06
@frenck frenck added the Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Oct 2, 2025
@MindFreeze
Copy link
Member Author

Not sure how to handle untracked energy now. The total in the middle will be more than the sum of the devices because untracked isn't included. But I'm afraid if I include it, it will take a lot of space in some cases and reduce the actually valuable data.
Hmm, I'll try to explain it in a tooltip for the total

@karwosts
Copy link
Member

karwosts commented Oct 2, 2025

Should it have a fixed height? The size of the card seems still governed by the bar-chart the number of entities, so if you have only a couple, it's pretty small.

image

@MindFreeze
Copy link
Member Author

I set a min height of 300. Could make it 400 like the other charts.
Left the height as is though so the UI doesn't jump around when you toggle the chart type.

bramkragten
bramkragten previously approved these changes Oct 14, 2025
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
@MindFreeze MindFreeze enabled auto-merge (squash) October 14, 2025 11:23
@MindFreeze MindFreeze merged commit fd7f0d3 into dev Oct 14, 2025
11 checks passed
@MindFreeze MindFreeze deleted the energy-pie branch October 14, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed hacktoberfest Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants