---
title: "Count badge"
description: "A badge with the number of a count helper, like how many lights are on. Gone at zero. Select it to see which lights are on, and open any of them."
canonical_url: "https://spook.boo/count-badge"
---
# Count badge

> A badge with the number of a count helper, like how many lights are on. Gone at zero. Select it to see which lights are on, and open any of them.

The count badge puts the number of a [count helper](https://spook.boo/count) on your dashboard: how many lights are on, how many windows are open, how many things are unavailable. When nothing counts, the badge is gone, so it only takes room when there is something to see.

Select it, and it lists what counts right now: every light that is on, with its state. Select one to open it.

It needs [Spook on your dashboards](https://spook.boo/dashboards) switched on, and a [count helper](https://spook.boo/count) to show.

![The count badge for the lights that are on, showing 3, next to Home Assistant's own badges, with the list of the three lights opened under it.](https://spook.boo/images/screenshots/en/light/count-badge.webp)

## Adding it to a dashboard

1. Open the dashboard, and edit it.
2. Select **Add badge**, and search for **Count (Spook)**.
3. Pick the count helper. Only count helpers are offered.
4. Select **Save**.

Or start from the helper: add a badge, pick the sensor of your count helper, and the count badge is offered right there.

## What it shows

The name and the icon of the count helper, and the count. Give the badge a name or an icon of its own in the editor, and those win.

- **At zero**, the badge is gone. Switch on **Show at zero** to keep it, with a 0.
- **While Home Assistant starts**, the count helper has no count yet, so the badge is gone until it has one.
- **Unavailable**: the badge stays, and says so. Something is off with the helper.
- **While you edit the dashboard**, the badge is always there, at zero too, so you can find it.

## What counts

Select the badge, and a list opens with every entity that counts right now, by name, with its state. Select one to open its more info dialog. **Details** at the bottom opens the one of the count helper itself, with the history of the count.

The list keeps up while it is open: a light that goes off drops out. When the count drops to zero and the badge goes, the list closes with it.

## Options

| Option | What it does |
| --- | --- |
| **Entity** | The count helper the badge shows. |
| **Name** | The name of the badge. The helper's own if left empty. |
| **Icon** | The icon of the badge. The helper's own if left empty. |
| **Show at zero** | Keep the badge when nothing counts, instead of it being gone. |

## In YAML

```yaml
type: custom:spook-count-badge
entity: sensor.living_room_lights_on
name: Lights on
icon: mdi:lightbulb-group
show_zero: true
```

| Key | Values | Default |
| --- | --- | --- |
| `entity` | A count helper | Required |
| `name` | Any text | The helper's name |
| `icon` | An icon | The helper's icon |
| `show_zero` | `true` or `false` | `false`: gone at zero |


## Sitemap

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