Skip to content
tempus2016 edited this page Nov 11, 2026 · 2 revisions

Badge (v2.2.0+)

Two rows of Chartdeck badges: the grid, outside temperature and humidity as values beside a tinted icon; then the outside temperature as a sparkline, a phone battery as a small ring and kitchen humidity as a thin bar

A Chartdeck badge for the badge row at the top of a Sections view: one entity, drawn as a pill like Home Assistant's own badges, with the card's colour bands, limits and actions. It comes with the card; there is nothing more to install.

Good for

A few numbers you want above every card on a view: the grid, the outside temperature, the phone's battery, with a trend or a fill level the plain badge doesn't show.

Example

type: custom:chartdeck-badge
entity: sensor.phone_battery
style: ring
name: Phone
severity:
  - from: 0
    color: red
  - from: 20
    color: amber
  - from: 40
    color: green

To add one, edit a Sections view, choose Add badge and search for Chartdeck badge. Its own editor has every option below.

The four looks

style What it draws
value (default) The value and name beside the entity's icon in a circle tinted with the badge's colour
sparkline A small line of the last hours of history, then the value and name
ring A small ring filled to the value's place between min and max, then the value and name
thin A short bar filled the same way, then the value and name

Options

Option Type Default Editor
entity entity id none (needed) Entity
style value, sparkline, ring, thin value Look
attribute attribute name none (the state) Attribute (instead of the state)
name text the entity's friendly name Name
show_name true / false true Show name
show_icon true / false true Show icon (value look only)
icon icon, such as mdi:flash the entity's own icon Icon (value look, while the icon is shown)
hours number of hours, above 0 and at most 168 24 Hours of history (sparkline only)
min number or entity 0 Minimum
max number or entity 100 Maximum
unit text the entity's unit Unit
decimals whole number, 0–20 as on the card Decimals
color palette name or any CSS colour the theme's primary colour Colour without bands
severity list of bands none Colour bands
tap_action, hold_action, double_tap_action action more-info, none, none Actions
  • The options mean the same as on the card, because the badge runs them through the card's own code: min, max and band starts can be numbers or entities, unit converts as on the card (see Options), and decimals follow the entity's display precision.
  • Colour: the colour of the band the value is in when severity is set, otherwise color, otherwise the theme's primary colour.
  • show_icon: false on the value look puts a small dot in the badge's colour in place of the icon.
  • Unavailable or missing entities draw grey, with their status in place of the value.
  • The sparkline loads the entity's history once and then adds new states as they arrive. It stops while the badge isn't on the page.

In the badge editor: Entity and Look first, then the attribute, Name and, for the sparkline, Hours of history; Show name and Show icon; Icon; Unit and Decimals; Colour without bands; then Minimum and Maximum (each with Default, Number and Entity, as in the card's Limits section), Colour bands and Actions.

Everything else

The badge is static: it has no draw-in animation. It needs Home Assistant 2024.8 or later, which added badges to Sections views.

Every card option is described on the Options page; the badge reads the ones in the table above.

Clone this wiki locally