Skip to content

Look ​

A tile and a poster draw their entity the way its kind says. Every part of that look also has a key of its own: the texts, the colour, the icon and the visual. This page shows how to change each of them, on a tile and a poster side by side.

The texts ​

Both cards show a name and a value. The tile puts the value on the line under the name; the poster draws it large at the bottom.

  • name: the entity's friendly name by default.
  • value: the entity's state, or what its kind shows (a thermostat's temperature, a media player's title). attribute shows an attribute instead. unit, decimals, prefix and suffix format a number.
  • status: a word from the kind or from the matching rule, such as Cleaning or Good. On a tile it follows the value on the line; on a poster it is the first badge in the corner. A text of your own replaces it, false leaves it out. status_badge: true makes a tile's status a badge instead.
  • secondary: the line the kind adds, such as the artist and the album, or the wind's direction and gusts. A text of your own replaces it.

show_name: false hides the name, show_value: false the value.

Edit

Values from templates ​

name, value, status, secondary, icon and color also take a template. Home Assistant renders it and keeps it up to date. A number from a template is still a number: unit, decimals, prefix and suffix work on it. A card does not even need an entity: the keys alone can fill it.

Edit

Colour ​

The card's colour paints its icon, its visual and its status. It comes from the first of these that has one:

  1. the matching rule's color;
  2. the card's color, while the entity is active (an entity that is off takes Home Assistant's colour for off);
  3. the kind's own colour: a light in its own colour, a thermostat warm while heating and cool while cooling;
  4. Home Assistant's colour for the entity's state.

color takes a theme colour name (amber, teal, deep-purple …), a hex, rgb(), var(--…) or a template. It is a default: a matching rule's colour wins over it. To colour the whole card, use a rule with tint_card. Colours lists the names.

Rules ​

rules change the look by the value or the entity's state. They match in the order written, and the first match wins.

  • state matches the value or the entity's state. Quote "on" and "off".
  • below matches a value under the number, above a value at or over it.
  • attribute makes the rule read that attribute of the entity in place of the value: { attribute: hvac_action, state: heating, … } on a thermostat that shows its temperature. It reads the entity as it is now, so a plot's past values never match it.

A matching rule can set:

  • color and icon: they win over the card's own color and icon;
  • status: the status text (quote a word such as "Off" or "No");
  • tint_card: true: the whole card washed in the rule's colour;
  • pulse: true: the status badge pulses;
  • visual, and an icon as a place.
Edit

Many kinds bring rules of their own: CO₂ from Good to Bad, a battery Low and Critical, the weather a colour per condition. Your rules replace them as a whole, and rules: [] drops them. Kinds lists each kind's rules.

Rules also match a template's value by its text, so { state: Open, color: red } works on a card without an entity.

Below, the thermostat shows its temperature and turns red with a status of its own while it heats:

Edit

The places ​

Besides its texts, a card draws two places:

  • icon: the icon (on the poster at the top left);
  • visual: what fills the card behind the texts, such as a glow or a picture, or what sits below them, such as a plot of the history or a bar.

Each place draws one thing. You write it in one of four ways:

  • its name: visual: sparkline;
  • the thing with its options: visual: { type: sparkline, hours: 12 };
  • false for nothing: visual: false, icon: false;
  • left out: the kind's default, such as a light's glow or a person's photo.

icon written as a text is always an icon's name, icon: mdi:sofa. Its other things take the object form: icon: { type: image }.

The icon draws one of these:

  • icon: an icon, the entity's unless name gives another;
  • image: a picture in the icon's circle;
  • flow: the wind's or the rain's animation.

An icon or an image takes ring: true, a ring of the value around it. ring can also read another entity: an entity id, or { entity, attribute, min, max, color }, on that entity's scale (its own min and max, or min_value and max_value, else 0 to 100), in the card's colour unless it names one. A rule switches the ring on and off and colours it, but never names another entity. Every icon takes style: plain, the icon without its circle.

The visual draws one of these:

  • behind the texts: glow (the card lit from below in its colour), image (a picture), flow (the wind's or the rain's animation);
  • below the texts: sparkline, columns and strip (the history), bar, gauge and segments (the value between min and max; a timer's bar is its time left), sun (the sun's day);
  • a kind's own drawing: cover (a cover's shutter, blind, garage …), path (a robot's path), line (the grid's power line). A tile draws these only where you name them.

On a tile, a visual below the texts adds a second row.

Edit

Changing the kind's default ​

An object without type keeps the thing the kind draws and changes only its options. visual: { hours: 24 } makes the weather's forecast look a day ahead. visual: { blur: false } shows a person's photo sharp. icon: { ring: true } puts a ring around whatever the icon is. An object with another type replaces the thing.

Edit

Options a thing cannot use are caught: with a written kind the card shows an error, otherwise the browser's console warns once.

By rule ​

A rule takes icon and visual too, drawn over the card's while it matches. As on the card, an object without type changes options only, a type draws another thing and false empties the place. A rule never sets a plot's window or scale: it takes no hours, bucket, smoothing, min, max or a plot's src. A rule that names another plot (visual: columns over the card's sparkline) draws it with the defaults, and with the card's min and max where written.

Each place is resolved in layers: the kind's default, then the card's, then the first matching rule's.

The living room fan glows in teal while it runs; switch it off and its icon loses its circle.

Edit

A picture behind ​

visual: { type: image } puts a picture behind the whole card, under a shade that keeps the text readable. Without src it shows the card's own entity's picture. src takes a URL (/local/… for a file in Home Assistant's www folder), a template that renders one, or an entity whose picture it shows: a camera's snapshot, a person's photo, a media player's art.

  • opacity: how much of the picture shows through the shade, from 0 to 1 (0.3 by default).
  • tint: a colour mixed into the shade.
  • blur: a number of pixels, true for 20, false for a sharp picture. A person's photo and a media player's art are blurred by default.
Edit

One place for the animation ​

The wind's and the rain's animation is drawn in one place: by default in the icon. visual: { type: flow } lets it fill the whole card instead, and the icon becomes the wind's arrow or the rain's icon. A flow's variant picks the drawing: dots, lines, swoosh or vectors for the wind, drops, ripples or fill for the rain.

Edit

Recipes ​

An entity, your own look ​

With an entity, the card takes the name, the icon, the state and the colour from it, and the kind adds the rest. kind: none turns the kind off: no status, controls, rules or visual of the kind's, only what you write. Here the ceiling light shows its brightness as a bar instead of its glow.

Edit

Plots on one scale ​

A plot fits its own data: columns reach from 0 to the window's highest bucket, a line from its lowest value to its highest. Side by side, cards are then hard to compare. min and max on the visual give them one scale. A plot of the card's own entity takes the card's min and max as well.

Edit

A card without an entity ​

A card needs no entity: templates fill it. This one counts the lights that are on. Without an entity a tap does nothing until you give it a tap_action.

Edit

Reference ​

Texts and colour ​

KeyDefaultWhat it does
namethe friendly nameThe name. Text or template.
valuethe state, or the kind's valueThe value. Text or template.
attribute–Shows this attribute of the entity in place of its state.
unitthe entity's unitThe unit after a number.
decimalsHome Assistant'sDecimal places of a number, 0 to 3.
prefix–A text before the value.
suffix–A text after the value.
statusthe rule's, else the kind'sThe status. Text or template; false for none.
status_badgefalseTile only: the status as the first badge instead of on the line.
secondarythe kind's lineThe extra line. Text or template.
show_nametruefalse hides the name.
show_valuetruefalse hides the value.
colorthe kind's, else Home Assistant'sThe card's colour: a theme colour name, hex, rgb(), var() or template.
min, maxthe entity's own, else 0 and 100The range of a ring, a bar, a gauge, segments and a glow. Written, they also scale a plot of the entity's state (sparkline, columns) that has no min or max of its own.
rulesthe kind'sLook by value or state; first match wins. [] drops the kind's.
kinddetected from the entityThe kind; none draws only what you write. See Kinds.

Rule keys ​

KeyWhat it does
stateMatches the value or the entity's state. Quote "on" and "off".
belowMatches a value under this number.
aboveMatches a value at or over this number.
attributeReads this attribute of the entity in place of the value (the entity of now, never a plot's past values).
colorThe card's colour while the rule matches. Wins over color.
iconAn icon's name, or the icon place's thing or options (no actions). Wins over icon.
visualThe visual place's thing or options, or false. No hours, bucket, smoothing, min, max, or a plot's src.
statusThe status text while the rule matches.
tint_cardtrue: the whole card in the rule's colour.
pulsetrue: the status badge pulses.
styleThe status badge's look: outline, soft, filled, plain or tag.

A rule needs at least one of state, below and above.

Icon things ​

ThingOptionsDraws
iconname, ring, styleAn icon: the entity's, or name (an mdi: icon or a template).
imagesrc, name, ring, styleA picture in the icon: the entity's, or src. name shows while there is none.
flowvariant, styleThe wind's or the rain's animation. Wind and rain kinds only.
OptionWhat it does
ringtrue: a ring of the value around the icon, filled between min and max. An entity id or { entity, attribute, min, max, color }: another entity's value, on its scale. { color }: the value in a colour of its own.
stylecircle (default) or plain, without the circle.
srcA URL, a template that renders one, or an entity whose picture it shows.
variantWind: dots, lines, swoosh, vectors. Rain: drops, ripples, fill.

The icon also takes its own tap_action, hold_action and double_tap_action (see Actions & hover), and on a tile a badge (see Badges).

Visual things ​

ThingOptionsDraws
glow–The card lit from below in its colour, as strong as the value's level.
imagesrc, opacity, tint, blurA picture behind the whole card.
flowvariantThe wind's or the rain's animation behind the card. Wind and rain only.
covervariantA cover's drawing. Cover only.
path–A robot's path. Vacuum and lawn mower only.
line–The power line. Grid only.
sparklinehours, bucket, smoothing, axis, src, min, maxA line of the history. A weather's: the hours ahead; a trend's: its series.
columnshours, bucket, axis, src, min, maxA bar per bucket.
striphours, bucket, src, variantA block per bucket, coloured by the rule each one matched.
bar–The value between min and max as a bar; a timer's time left.
gauge–The value between min and max as an arc.
segments–Ten segments, filled to the value.
sun–The sun's day, with the sun where it is now. Sun only.
OptionWhat it does
srcimage: a URL, a template that renders one, or an entity whose picture it shows. A plot: another entity's history.
opacityHow much of the picture shows through its shade, 0 to 1. Default 0.3.
tintA colour mixed into the shade.
blurBlurs the picture: a number of px, true for 20, false for none.
variantFlow: as for the icon. Cover: shutter, blind, curtain, garage, gate, awning, window. Strip: timeline (below the texts, with its times) or edge (along the card's bottom edge).
hoursThe window in hours, or today (since midnight). Default 24; a weather's forecast 12 ahead, a trend 6 back, solar today.
bucketA bucket's minutes, at least 5: a column or a block of the strip. Default 60.
smoothingThe sparkline's averaging in minutes, at least 5. Default: by the plot's width.
axistrue: a row above the drawing with the scale's range on the left and the window on the right (24 h, or Today), and a faint line at the scale's top (and its bottom, on a line and on columns whose min is above 0). The plot keeps its height: the drawing is that row shorter. On a narrow plot the window is left out.
min, maxA plot's scale, its bottom and top (not a weather's or a trend's own line). Values beyond it widen the scale, so nothing is cut off; a side left out fits the data. Left out on a plot of the card's own entity: the card's min and max, where written and the card shows the entity's state. With either, a column is as bright as it is tall.

Released under the MIT License.