Skip to content

Entity options ​

For the weather, power flow and energy flow cards, and the deprecated entity cards

These keys describe an entity of the deprecated entity cards, of the weather card's entity sections and of header_entities (deprecated on the weather, power flow and energy flow cards, which take badges instead). All of them go in 4.0. The tile, the poster and the tile group write an entity their own way; Moving to 3.0 maps the keys.

The entity card, the entity group card and the entity sections card describe an entity with the same keys. On the entity card they sit directly on the card; in a group or section they are the items of entities, either a plain entity id or an object. The first row below is the bare id, the second an object with the options this page explains.

Value and attribute ​

By default the card shows the entity state, formatted with the entity's unit. Two keys change that:

KeyShows
attributean attribute of the entity, for example attribute: current_position
valuea Jinja template ({{ … }}) or plain text; an entity is then optional

unit, decimals (0 to 3), prefix and suffix apply to whatever is shown. Rules compare against the numeric value, so they also work on attributes and template results.

Template ​

Any string containing {{ }} is rendered by Home Assistant. Templates are supported for title, icon, name, secondary, color and value; a template result that looks like a number gets decimals, unit and rules like a state. unit, prefix, suffix and rule labels are plain text. Home Assistant also renders {% %} blocks; the examples on this site only evaluate {{ }} expressions.

Secondary line ​

secondary sets the line under the name in tiles, list rows and the hero lead, in place of the rule label. Templates make it a status line.

Plain text ​

Any other string is shown as is. Useful for scene rows where the value is a verb.

Rules ​

rules is a list; the first entry that matches decides colour, icon, label and card tint. Write them in the order they should be tried.

MatcherMatches when
belowthe value is numeric and < below
abovethe value is numeric and >= above
statethe shown text (state, attribute or value) or the entity's state equals state; quote "on" / "off"

Where the label goes depends on the layout: list rows and tiles show it next to the value, as a line under the name; row, column and table items and header_entities have one line for the value, so there the label stands in for it, in the rule's colour, and the value stays in the item's tooltip. A badge always shows the label in its pill.

A rule may combine below and above for a range. Numeric rules never match text, so numeric and state rules can share one list. States that no rule matches keep the entity icon and take Home Assistant's state colour, else primary, or grey for off-like states (off, closed, idle, standby, docked, not_home, disarmed, clear). An explicit color or icon on the entity always wins over the rules.

YAML anchors

Home Assistant's YAML supports anchors (&t) and aliases (*t), handy for repeating the same rules across entities.

State rules label text states, on a badge or in the secondary line.

Card tint ​

tint_card: true on a rule colours the whole card while that rule matches. In a group or sections card the first tinting entity wins.

Visuals ​

visual decides how the entity is drawn. Every visual uses the same value, rules, colour and actions; it only changes the picture. Three of them (sparkline, columns, strip) read the recorder history for the card's history window. The table lists which keys each visual reads; the sections below show them one by one.

VisualDrawsOptionsDrawn in
iconthe entity icon in a coloured circle (or alone, icon_style)icon_styleeverywhere
ringa progress ring around the icon (grid cells: around the value)min / maxeverywhere
gaugea half-circle gauge with the value inside and min / max labelsmin / maxtile, list, grid, hero
bara horizontal progress bar under the valuemin / maxtile, list, grid, hero, header
sparklinea smoothed line of the last hours_to_show hourshours_to_show, smoothing_minutestile, list, grid, hero, header
columnsone bar per bucket_minutes bucket, peak highlightedhours_to_show, bucket_minutestile, list, grid, hero
badgea coloured pill with the rule label or the valuerules[].labeleverywhere
stripa timeline coloured by the matching rule per buckethours_to_show, bucket_minutes, rulestile, list, grid, hero

"Everywhere" includes the compact items of the row, column and table layouts and the header entities. See Visuals in items and headers for how they draw there.

Icon ​

The default. The icon sits in a soft circle of the entity's colour, the value and the rule label follow. Icon and colour come from, in this order: a fixed icon / color on the entity, the first matching rule, the entity's own icon and Home Assistant's state colour, else primary, or grey for off-like states such as off, closed, idle or not_home. Use it whenever the value itself is the message and rules only need to flag it.

The thermostat tile shows the override: a fixed icon or color on the entity wins over the rules, which then only contribute the label.

icon_style: plain draws the icon without its circle, in the same place and at the same size, so plain and circled entities line up. It works in every layout and with ring, where only the fill inside the ring goes. A control on the icon that is a button (Run, a confirmed hold) keeps its circle, since that is what marks it as a button.

Picture ​

show_entity_picture: true draws the entity's picture in place of its icon, in the icon's place and shape: a person's photo makes a tile for each member of the household, and a media player's cover or a camera's snapshot work the same way. Everything else stays: the value, the rules and their colour, the actions. An entity without a picture keeps its icon, as Kim does below, and a control on the icon that is a button keeps its icon too. As on Home Assistant's tile card, the picture is off unless you ask for it.

Ring ​

A progress ring around the icon. Progress is (value − min) / (max − min); min and max default to the entity's min / max (or min_value / max_value) attributes and otherwise to 0 and 100, so percentage sensors need no configuration. The ring is not drawn when the value is not numeric or max is not above min; the icon stays. Colour follows the rules like everywhere else.

In a grid layout the ring grows and the value moves inside it, replacing the icon. Rings also work in row, column and table items and in header_entities, where a thin ring goes around the icon.

Gauge ​

A half-circle gauge below the name with the formatted value in the arc and min and max printed as small labels at its ends. Same scale rules as the ring: min / max from the config, else from the entity attributes, else 0 to 100. The gauge is a block visual: it is drawn in a tile, list row, grid cell or hero lead.

In a grid cell the gauge replaces the big value, since it already shows it.

Bar ​

A thin horizontal bar under the value, filled to the same (value − min) / (max − min) progress as the ring and gauge. It is the quietest way to show a level; the rule label, if any, appears as the secondary line. Like the gauge it is a block visual and needs a tile, list row, grid cell or hero lead.

History window ​

sparkline, columns and strip fetch the recorder history of their entity and redraw it every five minutes. Three card-level keys shape the window; they apply to every history visual on the card (or on all sections of a sections card):

OptionDefaultDescription
hours_to_show24Length of the window in hours, at least 1. Shown as the left label of a strip.
bucket_minutes60Bucket size for columns and strip, at least 5. The number of buckets is hours_to_show × 60 / bucket_minutes.
smoothing_minutesAveraging bucket of the sparkline in minutes, at least 5. Without it the line has one point per 12 px of width.

In a card given more height (fixed rows, a taller card beside it) a sparkline or columns plot takes the height the card has to spare (Filling the height); a strip keeps its own. Entities without recorder history draw an empty plot. Hovering (or touching) a plot shows the value at that point and the time; on a sparkline that value is the mean of the point's bucket.

Sparkline ​

A smoothed line with a soft area below it and a dot at the last value, for temperatures, prices and anything else that drifts. Each point is the mean of its bucket (one per 12 px of width, or smoothing_minutes), so sensor noise does not show as a zigzag; the dot shows the last bucket's mean, while the row's value stays the current reading. The vertical scale fits the data, so bucket_minutes, min and max do nothing here. The whole line takes the current value's rule colour or the fixed color.

smoothing_minutes sets the averaging bucket for every sparkline on the card. Larger buckets give a calmer line that shows the trend of the day; small buckets keep short swings, down to one point per 2 px.

Columns ​

One bar per bucket, for quantities that come in portions: solar power, energy, rain, wind gusts. Each bar is the mean of its bucket_minutes bucket over the last hours_to_show hours; the baseline is 0 (or the lowest value if negative), the peak bucket is drawn solid and the others lighter, and hovering a bar shows its value and time. Fine buckets over a short window give a detailed profile; coarse buckets over a long window give a daily pattern.

Badge ​

A coloured pill instead of the plain value. The pill shows the matching rule's label, or the formatted value when no rule has a label, and takes the rule colour. Because the pill already carries the label, the badge has no secondary line unless you set secondary. It is made for states that have names (presence, appliance programs, modes) and works in items and headers too, where it stands in for the value. In header_entities the badge carries the icon inside the pill; with show_value: false, or a value that renders empty, it is just the icon in a coloured circle. See the header example on the group card.

Badges in a row layout show the pill under the name.

Strip ​

A timeline of the last hours_to_show hours, one block per bucket_minutes bucket, each coloured by the rule that bucket matches. On a numeric sensor a bucket is matched by its mean value; on any other entity by the last state in the bucket. rules are therefore what gives the strip its colours: a strip without rules is a single-colour bar. The current bucket has an outline, the axis reads −N h on the left and now on the right, and hovering a block shows its value or state and time.

The same on numeric sensors, colouring every hourly bucket by the range its mean falls in:

Visuals in items and headers ​

The row, column and table layouts show every entity as a compact item, and header_entities sit on the title line. Items draw icon, ring and badge only. Header entities are badges: icon, ring (around the icon), bar (beside the value), sparkline (in the icon's place, over the card's hours_to_show), trend (the change over trend_hours, 1 by default), count (how many members of a group are on), dot (in the icon's place) and badge (a soft pill); control: toggle adds a switch. The heading card and the v3 cards write their badges another way (a poster's badge keys). Any other visual on such an entity falls back to icon and logs a warning in the browser console. show_icon, show_value and show_name decide what the item shows; see Item options.

Actions ​

tap_action, hold_action and double_tap_action accept every Home Assistant action: more-info (default for tap and hold), toggle, navigate, url, perform-action (also call-service), assist, fire-dom-event and none. Set them on the card as defaults or per entity, as an object or as a bare action name (tap_action: toggle). Home Assistant runs the action, so you get its confirmation dialog and haptic feedback in the companion app. confirmation asks before running; the controls never ask (use control_confirm: true for a hold to confirm) and call their own services.

perform-action takes data and target like a Home Assistant action; url opens url_path in a new tab; entity points more-info or toggle at another entity than the row shows.

Hover ​

hover: true shows what a click will do, as Home Assistant's tile does. Set it on an entity, or on the card or a section as the default for its entities, as with the actions: the closest one wins, so hover: false on one entity leaves it out. A tile, a grid cell or a header entity with an action takes a light layer in its colour under the pointer and a ripple while pressed. List rows, heroes and table fields keep still. An icon with its own action (control_position: lead, the items of a row layout) brightens its circle instead. Every control answers too, as Home Assistant's control buttons do; over a control the row's layer gives way to the control's. Touch screens show only the press. hover is off by default on these cards, except on header entities: a badge is a button, as Home Assistant's badges are, so it answers whenever it has an action unless hover: false is set on the entity or the card.

Action options ​

FieldActionsDescription
actionmore-info, toggle, navigate, url, perform-action, call-service, assist, fire-dom-event or none. A bare string sets action only.
entitymore-info, toggleAct on this entity instead of the row's entity.
navigation_pathnavigateDashboard path; navigation_replace: true replaces the history entry.
url_pathurlOpened in a new tab.
perform_action / serviceperform-actiondomain.action; service is the legacy spelling.
data / service_dataperform-actionAction data; service_data is the legacy spelling.
targetperform-action{ entity_id, device_id, area_id }.
pipeline_idassistThe assist pipeline; start_listening: true starts the microphone right away.
confirmationalltrue or { text, title, confirm_text, dismiss_text, exemptions }; Home Assistant shows its dialog, exemptions: [{ user }] skip it for those users.

fire-dom-event passes every other key of the action to the DOM event, which is how browser_mod popups are opened: tap_action: { action: fire-dom-event, browser_mod: { service: browser_mod.popup, data: { … } } }. The docs demo only shows a toast for assist and fire-dom-event.

Item options ​

Row, column and table layouts and header entities show every entity as a compact item. Four keys decide what an item shows; they cascade from the card to the section to the entity.

OptionRowColumnTableHeader entitiesDescription
show_nametruetruetruefalseThe name, above or below the icon (table: the key)
show_valuetruetruetruetrueThe value under the name (badge: the pill; a header badge without it is a circle with the icon)
show_icontruetruefalsetrueThe round icon (table: an icon column; header badge: the icon inside the pill)
name_positionbelow–––above or below the icon; rows only

Entity options ​

All keys an entity accepts, grouped by what they do. "Applies to" names the visuals or layouts a key matters for; the rest apply everywhere.

Identity and value ​

OptionDefaultApplies toDescription
entityallEntity id. Optional when value is plain text or a template, or for a row of your own buttons.
namefriendly nameallText or template.
secondarytile, list, hero leadLine under the name in place of the rule label (on a tile also of the value). Template allowed.
attributeallShow this attribute instead of the state (hvac_mode shows a thermostat's mode, which HA keeps in the state).
valueallA template or plain text instead of the state; see Value and attribute.
unitentity unitallUnit text after the value.
decimalsas reportedall0 to 3.
prefix / suffixallText around the value.

Look ​

OptionDefaultApplies toDescription
visualiconallicon, ring, gauge, bar, sparkline, columns, badge or strip, and on header entities trend, count or dot; see Visuals. What a place cannot draw falls back to icon.
iconentity iconallFixed icon that overrides rule icons. Template allowed.
icon_stylecircleallcircle draws the icon in a soft circle of its colour, plain the icon alone; see Icon. Header items have no circle, so it changes nothing there.
show_entity_picturefalseallThe entity's picture (a person's photo) in place of its icon; an entity without one keeps its icon. See Picture.
colorHA stateallFixed colour that overrides rule colours. Without it the entity uses Home Assistant's state colour (see the colour guide), plain sensors primary. Template allowed.
rulesallList of { state, below, above, color, icon, label, tint_card }, first match wins; see Rules. below and above may be numeric strings.

Scale ​

OptionDefaultApplies toDescription
min / maxentity min / max attributes, else 0 / 100ring, gauge, barBounds of the progress (value − min) / (max − min). Nothing is drawn when the value is not numeric or max ≤ min.

History ​

These keys sit on the card, not on the entity, and apply to every history visual on it; see History window.

OptionDefaultApplies toDescription
hours_to_show24sparkline, columns, stripWindow in hours, at least 1.
bucket_minutes60columns, stripBucket size in minutes, at least 5. Sparklines ignore it.
smoothing_minutessparklineAveraging bucket in minutes, at least 5 (default: one point per 12 px).

Controls ​

See Controls for what every control looks like and where it sits.

OptionDefaultApplies toDescription
controlallauto (or true) picks the domain default (header entities: a switch only), a name picks one, none draws nothing. control_position, control_attribute, control_step, control_options and control_confirm tune it: see Controls; control: buttons with control_options draws your own buttons.
togglefalseallDeprecated alias of control: toggle.
tap_action / hold_action / double_tap_actioncard defaultsallPer-entity overrides, see Action options.
hovercard / section default (false)allHome Assistant's hover and press layers on the entity's tile, cell or header item (on by default for header items), its icon and its controls, see Hover.

Items ​

OptionDefaultApplies toDescription
show_name / show_value / show_iconper layoutrow, column, table, headerWhat a compact item shows, see Item options.
name_positionbelowrowabove or below the icon; the other layouts ignore it.

Visibility ​

OptionDefaultApplies toDescription
visibilityentities in groups, headersDrawn only while every condition holds (Home Assistant's conditions); a condition without entity reads this one. See Visibility.

Every card also accepts the Home Assistant keys grid_options, visibility, layout_options, view_layout, card_mod and uix; see Sizing in sections. On the card itself visibility is Home Assistant's and hides the whole card. fill_height: false keeps the card at its own height beside a taller card; see Filling the height.

Released under the MIT License.