You are reading the development docs (2026.12.1-dev.1): features here may not be released yet.
Skip to content

Data and Cells ​

What the cells show: generated values in decorative mode, or the rows you write in data mode. How the cells look is on Styling and Animation.

Decorative mode ​

A decorative grid fills itself with generated values: digits, decimals, letters or hex codes. Use it for LCARS texture: a panel of numbers, a background behind other cards.

  • The grid size comes from the CSS Grid templates in grid: repeat(5, auto) rows and repeat(8, 1fr) columns give a 5 by 8 grid. Without templates the grid is 8 rows by 12 columns.
  • With refresh_interval the values change on a timer; a small refresh_cells changes only a few cells each time, which looks like data trickling in.
  • columns gives one column, by position, a format of its own.
yaml
# hex values, a few changing every 1.5 seconds; the first two columns are digits
type: custom:lcards-data-grid
data_mode: decorative
format: hex
refresh_interval: 1500
refresh_cells: 0.15
grid:
  grid-template-rows: repeat(5, auto)
  grid-template-columns: repeat(8, 1fr)
  gap: 0px
columns:
  - format: digit
  - format: digit
style:
  font_size: 20px
  color: var(--lcars-orange)
highlight_changes:
  preset: pulse
  duration: 400
More about decorative mode
  • Card picker: values don't change (and the cascade doesn't run) in the card picker preview, so the picker stays calm. The card editor's preview does animate.
  • Refreshing few cells: each refresh changes at least one cell, so refresh_cells: 0 with a refresh_interval still changes one cell at a time.
  • Grid size: repeat(auto-fill, ...) and other track lists without a fixed count fall back to 8 rows or 12 columns.
  • Highlighting: with highlight_changes the cells that changed animate briefly, as in the example.
KeyTypeDefaultDescription
formatstringmixeddigit (0042), float (42.17), alpha (AB), hex (A3F1), or mixed (any of the four, picked per cell)
refresh_intervalnumber0New values every this many milliseconds. 0 keeps them fixed
refresh_cellsnumber1How much of the grid changes on each refresh, 0 to 1: 1 is every cell, 0.2 a fifth of them
columns[].formatstringformatA different format for one column, by position
grid.grid-template-rowsstringrepeat(8, auto)The number of rows (and their heights): see Grid layout
grid.grid-template-columnsstringrepeat(12, 1fr)The number of columns (and their widths)

rows ​

In data mode you write the grid row by row: each row is a list of cells, and the card works out what each cell is. A row can also be written as an object with values, to give it options.

  • Rows can have different lengths; the grid is as wide as the longest row, and shorter rows end in empty cells.
  • header: true makes a row a header row; style styles the whole row (see Style layers).
yaml
type: custom:lcards-data-grid
data_mode: data
rows:
  # a row with options
  - values: [Room, Temperature, Humidity]
    header: true
  # plain rows
  - [Living room, sensor.living_room_temperature, sensor.living_room_humidity]
  - [Outside, sensor.outdoor_temperature, sensor.outdoor_humidity]
grid:
  grid-template-columns: 1fr 1fr 1fr
style:
  font_size: 18px
More about rows
  • No rows: a data grid with an empty rows list shows "Data mode needs at least one row". Without data_mode, an empty rows makes a decorative grid.
  • Other shapes: an entry that is neither a list nor an object with values becomes an empty row.
KeyTypeDefaultDescription
rowslist-The rows, top to bottom. Each is a list of cells, or an object with the keys below
rows[].valueslistrequiredThe row's cells, left to right
rows[].headerbooleanfalseA header row: header defaults plus header_style
rows[].styleobject-Style for every cell in this row: the style keys

What a cell can be ​

A cell shows text, an entity's state, a template or a data source value, and the card works out which from what you write. Cells update by themselves when their entity, template or data source changes.

  • Put templates in quotes in YAML: "{{ ... }}". An entity id or plain text needs no quotes.
  • A JavaScript template does not know which entities it reads, so list them in triggers_update for it to update.
You writeThe cell shows
Living roomThe text as written
sensor.living_room_temperatureThe entity's state, formatted by Home Assistant with its unit (21.4 °C, Open, On)
"{{ states('sensor.x') }} W"A Home Assistant template (Jinja2), rendered by Home Assistant
"{datasource:net_tx:.1f} MB/s"A value from an LCARdS data source. With a format (:.1f) you get the number only; without one, the value with its unit
"[[[ return states['sensor.x'].state ]]]"A JavaScript template
yaml
type: custom:lcards-data-grid
data_mode: data
rows:
  # text, then an entity state
  - [Inside, sensor.living_room_temperature]
  # text, then a Home Assistant template
  - [Comfort, "{{ 'WARM' if states('sensor.living_room_temperature') | float > 22 else 'OK' }}"]
  - [Battery, "{{ states('sensor.phone_battery') | int }}%"]
grid:
  grid-template-columns: 1fr 1fr
style:
  font_size: 20px
More about cell values
  • Entity ids: a cell is read as an entity id when it is all lower case: a domain, a dot and an object id (sensor.cpu_temp). Anything else is text.
  • Missing entities: an entity Home Assistant doesn't know shows -.
  • Braces mean a template: any text with { or [[[ in it is treated as a template, so a literal brace in plain text is read as one too.
  • Numbers: a number cell shows as written.
  • JavaScript templates: in a cell object with an entity, entity in a JavaScript template is that entity; otherwise it is the card's own. Read other entities through states['sensor.x'] (or hass.states).

Cell objects ​

Write a cell as an object to show an attribute, style one cell, or give it an entity for colours and actions. Plain cells and cell objects mix freely in a row.

  • Without value, the cell shows its entity's state, or the attribute of it.
  • With a template or text in value, entity is the context: the entity that conditional colours and tap actions follow, and the one {entity.state}, {entity.name} and {entity.attributes.NAME} in the value read.
yaml
type: custom:lcards-data-grid
data_mode: data
rows:
  # an attribute of an entity
  - - Outside
    - entity: weather.home
      attribute: temperature
  # one cell styled on its own
  - - Battery
    - value: sensor.phone_battery
      style:
        color: var(--lcars-yellow)
grid:
  grid-template-columns: 1fr 1fr
style:
  font_size: 20px
KeyTypeDefaultDescription
valuestring / number-What the cell shows: text, an entity id or a template
entitystringthe value, when that is an entity idShow this entity's state when value is empty, and use it for conditional colours and actions
attributestring-Show this attribute of entity instead of its state
styleobject-Style for this cell only: see Style layers
tap_actionaction-What tapping the cell does: see Tap actions
hold_actionaction-What holding the cell does
double_tap_actionaction-What double-tapping the cell does

Rows from Home Assistant ​

A row with a target repeats once for every entity a Home Assistant label, area, device or floor includes, so the grid lists what you label in Home Assistant. Write the row once with {entity...} tokens; each copy reads its own entity.

  • target is Home Assistant's target object: label_id, area_id, device_id, floor_id, entity_id, each one id or a list. A label counts on the entity, its device or its area.
  • In the row's values, {entity} alone is the entity's state, formatted like an entity cell. In a template, {entity.state}, {entity.name} (its name) and {entity.attributes.NAME} read that row's entity.
  • The copies take the row's place, so header rows above and rows below stay where they are. style applies to every copy.
  • sort orders the copies: name (default), state (numbers low to high, then text) or none. max_items keeps the first ones.
  • The rows follow Home Assistant: a label added or removed adds or removes a row, and a state change moves a row when sort: state.
yaml
type: custom:lcards-data-grid
data_mode: data
rows:
  - values: [System, Level]
    header: true
  # one row for each entity with the label
  - target:
      label_id: lcards_test_engine
    values:
      - "{entity.name}"
      - "{entity}"
    sort: state
grid:
  grid-template-columns: 2fr 1fr
style:
  font_size: 18px
More about rows from Home Assistant
  • Which entities: hidden entities and configuration or diagnostic entities are left out unless named in entity_id, as in Home Assistant's own sections.
  • No entities: a target that includes nothing adds no rows; the rest of the grid still shows.
  • Cell objects: a cell object in the row gets the row's entity unless it names its own, so { attribute: battery_level } shows each entity's battery level.
  • Colours and taps: each copy's cells carry its entity, so conditional colours and cell_tap_action (such as more-info) follow it.
KeyTypeDefaultDescription
rows[].targetobject-Home Assistant's target: label_id, area_id, device_id, floor_id, entity_id (each an id or a list). The row repeats per entity
rows[].valueslistrequiredThe cells of each copy; {entity} and {entity.*} read the copy's entity
rows[].sortstringnamename, state or none
rows[].max_itemsnumber-At most this many copies
rows[].styleobject-Style for every cell of every copy

Data sources ​

A data source can smooth, scale or convert a sensor before the grid shows it. Define it under data_sources and use it in a cell by name: {datasource:name}.

  • With a format such as :.0f the cell gets the number only, so add the unit yourself; without a format it gets the value with its unit, as Home Assistant shows it.
  • See Data Sources for the processing options and Templates for every format.
yaml
type: custom:lcards-data-grid
data_mode: data
data_sources:
  power:
    entity: sensor.kitchen_power
rows:
  - [Kitchen, "{datasource:power:.0f} W"]
grid:
  grid-template-columns: 1fr 1fr
style:
  font_size: 20px
KeyTypeDefaultDescription
data_sourcesobject-Named data sources: see Data Sources

Header rows ​

A header row labels the grid or a group of rows: bold, uppercase and smaller, with a divider line, in the theme's header colours. Write the row as an object with values and header: true.

  • Any number of rows can be headers, so a long table can have one per group.
  • Change their look for the whole grid with header_style (Styling), or for one row with that row's style.
yaml
type: custom:lcards-data-grid
data_mode: data
rows:
  - values: [Deck, Section, Status]
    header: true
  - [Deck 1, Bridge, Nominal]
  - [Deck 5, Sickbay, Nominal]
  - values: [Engineering]
    header: true
  - [Deck 12, Warp core, Online]
grid:
  grid-template-columns: 1fr 1fr 1fr
style:
  font_size: 18px
header_style:
  color: var(--lcars-orange)
KeyTypeDefaultDescription
rows[].headerbooleanfalseMake this row a header row
header_styleobjectheader defaultsStyle for every header row: see Header rows

Conditional colours ​

A cell's color or background can change with the state of the cell's entity, using the same state map as other LCARdS cards. Use it to turn a reading yellow or red past a limit.

  • The cell's entity is its entity, or the value when that is an entity id. For a template cell, add entity: to say which entity the colours follow; cells without an entity use default.
  • State maps work on row, column and grid-wide styles too; they resolve against each cell's own entity. See Colours for every colour format.
  • A running cascade animates the text colour of every cell, so text-colour state maps only show when there is no cascade. Background state maps always show.
yaml
type: custom:lcards-data-grid
data_mode: data
rows:
  - values: [Load, Watts]
    header: true
  - - Kitchen
    - value: sensor.kitchen_power
      style:
        color:
          default: var(--lcars-green)
          above:300: var(--lcars-yellow)
          above:1000: var(--lcars-red)
  - - Phone battery
    - value: sensor.phone_battery
      style:
        background:
          default: transparent
          below:30: var(--lcars-red)
          at_least:80: var(--lcards-green-darkest)
grid:
  grid-template-columns: 1fr 1fr
style:
  font_size: 20px
State keyMatches when the entity state
on, off, open, heat, ...is exactly that state
above:N, below:N, at_least:N, at_most:Nis a number past N (the closest match wins)
between:A:Bis a number from A to B; between_exclusive:A:B leaves out A and B
zero, non_zerois 0, or any other number
active, inactive, unavailableis on/off style active, inactive, or unavailable/unknown
defaultnone of the above
More about conditional colours
  • Order: an exact state wins, then zero, then the number ranges, then non_zero, then active/inactive/unavailable, then default.
  • Closest match: among above and at_least keys the highest threshold that matches wins, among below and at_most the lowest, and among between keys the narrowest.

Tap actions ​

Cells do nothing when tapped unless you ask: cell_tap_action for every entity cell, or actions on one cell object. The most common choice is more-info, which opens the entity's dialog.

  • tap_action, hold_action or double_tap_action on a cell object are for that cell only; a cell's own tap_action replaces cell_tap_action for it.
  • Actions use the cell's entity by default, and take every standard action. Cells with an action show a pointer cursor.
  • Cell actions work in data mode only; decorative cells have none.
yaml
type: custom:lcards-data-grid
data_mode: data
# every entity cell opens its dialog
cell_tap_action:
  action: more-info
rows:
  - [Inside, sensor.living_room_temperature]
  # this cell toggles its light instead
  - - Kitchen light
    - value: light.kitchen
      tap_action:
        action: toggle
grid:
  grid-template-columns: 1fr 1fr
style:
  font_size: 20px
More about tap actions
  • Own actions win: a cell's own tap_action replaces cell_tap_action; a cell with only a hold_action or double_tap_action still taps with cell_tap_action.
  • Text cells: cell_tap_action applies to cells with an entity, including a text cell object that sets entity.
  • Tap animations: a tap anywhere on the grid also fires the card's on_tap animations, with the tap point.
KeyTypeDefaultDescription
cell_tap_actionaction-What tapping any entity cell does, unless the cell has its own tap_action
tap_actionaction-On a cell object: what tapping that cell does
hold_actionaction-On a cell object: what holding that cell does
double_tap_actionaction-On a cell object: what double-tapping that cell does

In the Configuration Studio ​

The Studio's Grid Structure tab shows your rows as a spreadsheet you can edit.

  • Click a cell to choose Entity (with an optional attribute) or Text or template, and to set the cell's style, conditional colours and actions.
  • Click a row or column header to insert, move or delete it, set its style, or mark a row as a header.
  • Add Row and Add Column grow the grid. Custom column widths such as 100px 1fr 80px are kept when you add, move or remove columns.
  • Saving keeps your YAML short: rows without options stay plain lists, and cells without options stay plain values.

Released under the MIT License. | About