State¶
The State tool shows the current value of a Home Assistant entity or attribute.
By default, the Flexible Horseshoe Card follows Home Assistant formatting for the value and unit, including locale, number formatting, and display precision.
Basic configuration¶
Add states under layout.states:
entity_index selects the entity whose state is displayed.
xpos and ypos position the state on the card.
See Positioning and sizing for the card coordinate system.
Configuration options¶
| Field | Required | Default | Description |
|---|---|---|---|
entity_index | Yes | Entity whose state is displayed | |
xpos | Yes | Horizontal position | |
ypos | Yes | Vertical position | |
show.uom | No | end | Places the unit at end, top, or bottom |
uom.styles | No | Unit styling | |
ellipsis | No | Maximum number of displayed state characters | |
styles | No | Default state style | SVG and CSS styling |
color_stops | No | Not set | Colors the state from the entity value |
State and unit appearance¶
Use styles to change the appearance and alignment of the state.
The unit can be styled separately with uom.styles:
Common styles include:
| Property | Use |
|---|---|
font-size | Text size |
font-weight | Text weight |
text-anchor | Horizontal alignment using start, middle, or end |
fill | Text color |
opacity | Text opacity |
See Styling for the complete styling guide.
Keep long values readable¶
Use ellipsis to limit the number of displayed characters:
The value is shortened after the configured number of characters. Its unit remains visible.
Formatting values¶
State values follow Home Assistant localization and formatting by default.
Configure decimals, units, locale, and other formatting options on the entity in the card's entities list. The same formatting is then used wherever that entity is shown in the card.
See Entities for entity configuration and Localization and formatting for formatting options.
Show values in color¶
Use color stops when the state should change color based on its value:
The State tool applies the matching color to the displayed value.
See Color stops for ranges, gradients, palettes, and interpolation.