Skip to content

Add battery summary card and view strategy to home dashboard#30372

Open
Brookke wants to merge 3 commits intohome-assistant:devfrom
Brookke:batteries-summary
Open

Add battery summary card and view strategy to home dashboard#30372
Brookke wants to merge 3 commits intohome-assistant:devfrom
Brookke:batteries-summary

Conversation

@Brookke
Copy link
Copy Markdown
Contributor

@Brookke Brookke commented Mar 26, 2026

Proposed change

Enables users to see at a glance the status of their devices batteries.

It does so by introducing a button in the summaries tab of the overview dashboard, and it introduces a battery strategy that lists all the batteries (that a user hasn't marked as hidden) grouped by area

Screenshots

image 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

Additional information

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

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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

To help with the load of incoming pull requests:

@Brookke Brookke marked this pull request as draft March 26, 2026 22:32
@Brookke Brookke changed the title Add a summary for battery status and a battery strategy Add battery summary card and view strategy to home dashboard Mar 26, 2026
@Brookke Brookke marked this pull request as ready for review March 26, 2026 22:42
"count_media_playing": "{count} {count, plural,\n one {playing}\n other {playing}\n}"
"count_media_playing": "{count} {count, plural,\n one {playing}\n other {playing}\n}",
"count_batteries_low": "{count} {count, plural,\n one {low}\n other {low}\n}",
"all_batteries_good": "All good"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not entirely happy with this wording - open to suggestions

climate: "deep-orange",
security: "blue-grey",
media_players: "blue",
batteries: "green",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now all these colors are static, wonder if we should consider making it possible to make them dynamic e.g. batteries red if 1 or more batteries are low

Copy link
Copy Markdown
Member

@MindFreeze MindFreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be a full dashboard like lights. Or part of the Energy dashboard

Comment on lines +34 to +48
const computeBatteryTileCard = (
hass: HomeAssistant,
areaName: string,
entityId: string
): TileCardConfig => {
const stateObj = hass.states[entityId];
const name = computeStateName(stateObj);
const strippedName = stripPrefixFromEntityName(name, areaName.toLowerCase());

return {
type: "tile",
entity: entityId,
name: strippedName,
};
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

computeAreaTileCardConfig does this exactly. It could use this as a base instead so we don't duplicate the logic. Not a blocker but it's opportunity for improvement

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not string the name, we should use the device name so we don't repeat battery for every name.

name:
   type: device

About stripping the name, there is already a discussion here.
I would prefer to not have this as a requirement for this PR. We can update this view later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update this now.

Re not stripping the name are you referring to not removing the area prefix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed up your suggested change @piitaya

@MindFreeze MindFreeze added the Needs UX Items requiring a review from the Home Assistant design team label Mar 27, 2026
Copy link
Copy Markdown
Member

@piitaya piitaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion about entity naming

Comment on lines +34 to +48
const computeBatteryTileCard = (
hass: HomeAssistant,
areaName: string,
entityId: string
): TileCardConfig => {
const stateObj = hass.states[entityId];
const name = computeStateName(stateObj);
const strippedName = stripPrefixFromEntityName(name, areaName.toLowerCase());

return {
type: "tile",
entity: entityId,
name: strippedName,
};
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not string the name, we should use the device name so we don't repeat battery for every name.

name:
   type: device

About stripping the name, there is already a discussion here.
I would prefer to not have this as a requirement for this PR. We can update this view later.

@timmo001
Copy link
Copy Markdown
Member

timmo001 commented Mar 27, 2026

I think something like this is very much needed.

First though, I think we would need to figure out what kind of dashboard this should be, and whether it should be a subview of the home overview or a full dashboard.

I had a similar idea and made a "maintenance" dashboard which contains a batteries view based on the home overview layouts with an additional top section for batteries below a threshold.

I made it into a custom dashboard strategy instead of a branch here, mostly due to personal requirements which are unlikely to match the project in it's entirety.


This is what I have been tinkering with:

image

It was mostly coded by an LLM with my guidance and has way more than what we would ever probably want, hence why I made it custom in the first place.

I made a few decisions in this custom dashboard like @piitaya's review comment here which made it much nicer to look at (not repeating battery) and added features to the cards (These shouldn't go in the first PR though IMO).

There are other decisions I made here, I could probably write these up elsewhere though not to flood this PR (which I am already 😄).


The idea here though is a "Maintenance" dashboard might be something we might want to consider, instead of a subview of home. It should still link to it like the energy card does though

I don't think that this PR is a bad setup in any way though and it's a foundation we can iteratre on down the line. We could also move the subview to a full dashboard later on, like the media subview will eventually have once we figure out a solution on that.

@Brookke
Copy link
Copy Markdown
Contributor Author

Brookke commented Mar 27, 2026

Hey @timmo001 thanks for taking a look!

I think something like this is very much needed.

First though, I think we would need to figure out what kind of dashboard this should be, and whether it should be a subview of the home overview or a full dashboard.

More than happy to help this evolve over time based on what home assistants long term plans/philosophy is around when to subview vs full dashboard.

I had a similar idea and made a "maintenance" dashboard which contains a batteries view based on the home overview layouts with an additional top section for batteries below a threshold.

Yes I think this is much needed. Thought I would start with just batteries since its the one I imagine most people need. I think there's other improvements we can make over time too, like a default automation/blueprint (perhaps toggle-able in this screen) to alert users when batteries are low.

This is my current dashboard for context.
image

I made it into a custom dashboard strategy instead of a branch here, mostly due to personal requirements which are unlikely to match the project in it's entirety.

This is what I have been tinkering with:
image

It was mostly coded by an LLM with my guidance and has way more than what we would ever probably want, hence why I made it custom in the first place.

I made a few decisions in this custom dashboard like @piitaya's review comment here which made it much nicer to look at (not repeating battery) and added features to the cards (These shouldn't go in the first PR though IMO).

There are other decisions I made here, I could probably write these up elsewhere though not to flood this PR (which I am already 😄).

The idea here though is a "Maintenance" dashboard might be something we might want to consider, instead of a subview of home. It should still link to it like the energy card does though

Perhaps we can open a discussion about the maintenance dashboard and discuss ideas for it, and then refactor this out of the home sub view?

I don't think that this PR is a bad setup in any way though and it's a foundation we can iteratre on down the line. We could also move the subview to a full dashboard later on, like the media subview will eventually have once we figure out a solution on that.

@Brookke Brookke requested review from MindFreeze and piitaya March 27, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Needs UX Items requiring a review from the Home Assistant design team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants