---
title: "Batteries card and badge"
description: "A card with every battery that needs attention, lowest first, at your own threshold. Phones, what charges and what carries Spook's label left out. And a badge with how many there are. Both gone when every battery is fine."
canonical_url: "https://spook.boo/batteries-card"
---
# Batteries card and badge

> A card with every battery that needs attention, lowest first, at your own threshold. Phones, what charges and what carries Spook's label left out. And a badge with how many there are. Both gone when every battery is fine.

Home Assistant knows the battery level of every remote, door sensor and thermostat in your home. This shows the ones that need attention: the card lists them, the badge counts them.

Both are gone when every battery is fine. They take no room on your dashboard, and turn up the moment a battery runs low.

It needs [Spook on your dashboards](https://spook.boo/dashboards) switched on.

## The batteries card

Every battery that needs attention, the lowest at the top. One row per device, even when it has a battery level and a "battery low" sensor both. Per row:

- The **name of the device**, not the long name of its battery sensor.
- Its **area**, when the name does not say it already.
- The **level**, or **Low** for a device that only says its battery is low.
- A **battery icon** that empties with the level, in the colors Home Assistant gives a battery.

Select a row to open the more info dialog of the battery.

### Which batteries need attention

The card decides what a battery is the way the Maintenance dashboard of Home Assistant does:

- A **sensor** with the battery device class, at or under the threshold. The threshold is **20 percent**, the same as Home Assistant's, unless you pick your own.
- A **binary sensor** with the battery device class that is on: the device says its battery is low. That counts, even when a level of the same device is above the threshold. The device knows its battery better.
- A **battery that went silent**: unavailable for a day. See below.

### What is left out

- **What charges.** A device with a charging sensor that says it is charging, like Home Assistant's own view does.
- **Phones and tablets.** The batteries of the Home Assistant companion app. You carry those around, and charge them every night.
- **Hidden entities**, like in Home Assistant's own view.
- **What carries Spook's label**, the **Excluded from Spook** label. On the battery, on its device, or on its area: the same as for Spook's repairs. Put it on the battery of your car or your robot vacuum, and the card leaves it alone.

Spook goes by the label itself, not its name. Renamed, it still works.

### A battery that went silent

An empty battery often says nothing at all: the device stops talking, and its battery sensor turns unavailable. The card shows it as **No reading**, with when it was last heard.

Only after a whole day. A restart of Home Assistant, or an integration that reloads, makes every sensor unavailable for a moment, and a battery device that sleeps can be out of reach for hours. None of that is an empty battery, so none of it shows up.

What does not count as silent:

- **Unknown.** A sleepy device can go a day without a word after a restart, and is unknown until it wakes up. That is no empty battery.
- **A battery whose integration is not loaded.** Home Assistant keeps its entities around, marked as restored. That is the integration, not the battery.
- **A device that still talks.** When another battery sensor of the same device still reports, the device is fine.

### Adding it to a dashboard

1. Open the dashboard, and edit it.
2. Select **Add card**, and search for **Batteries (Spook)**.
3. Pick your options, and select **Save**.

While you edit the dashboard, the card is always there, so you can find it again. With every battery fine, it shows the ghost.

### Options

| Option | What it does |
| --- | --- |
| **Title** | Shown above the list. None if left empty. |
| **Low at** | A battery at or under this percentage needs attention. 20 if left empty, like Home Assistant's Maintenance dashboard. |
| **At most** | The lowest ones first, and a line with how many more there are. All of them if left empty. |
| **Stay when every battery is fine** | Off, the card is not there at all while no battery needs attention. On, it stays, with the ghost saying every battery is fine. |

### In YAML

```yaml
type: custom:spook-batteries-card
title: Batteries
threshold: 25
max_batteries: 5
show_empty: false
```

| Key | Values | Default |
| --- | --- | --- |
| `title` | Any text | No title |
| `threshold` | A percentage, 1 to 100 | `20` |
| `max_batteries` | A whole number, 1 up | All |
| `show_empty` | `true` or `false` | `false` |

## The batteries badge

A battery icon with how many batteries need attention. Gone at zero. Hover it to see which ones, and how low.

There is nothing to select on the badge: picking one battery out of three would be a guess. The card is where they are.

Add it like any badge: edit the dashboard, select **Add badge**, and search for **Batteries (Spook)**. It takes the same threshold as the card.

```yaml
type: custom:spook-batteries-badge
threshold: 25
```

| Key | Values | Default |
| --- | --- | --- |
| `threshold` | A percentage, 1 to 100 | `20` |

## Who sees what

Everybody sees the same batteries, administrator or not. Nothing on the card or the badge needs admin rights.

Do you want the card for some people only? Use the **Visibility** tab of the card, and show it to the users you pick.

## Always up to date

The card and the badge follow the batteries as they change: one that runs low turns up, one with a fresh battery goes, without reloading the page. Putting Spook's label on something, or taking it off, shows straight away too.

They only do work when a battery changes. A light turning on somewhere in the house does not make them look again.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
