Skip to content

Controls ​

A tile or a poster can carry a control: a switch, a slider, a stepper, speeds, buttons, a select or a button to hold. Most kinds bring the right one on their own; control changes it, adds one to any entity, or draws your own buttons.

A tap on the card still opens more-info. The control takes its own taps, and the icon has actions of its own.

What the kinds bring ​

Without control, a kind draws its own controls. A poster has room for a second one below its value, such as a light's brightness; a tile keeps to one line and leaves it out.

KindTilePoster
lighta switcha switch, brightness below the value
pluga switcha switch
fanits speedsits speeds
climatea stepper for the targeta stepper for the target
coveropen, stop and closeopen, stop and close
media_playerprevious, play / pause and nextthe same, the volume below the value
vacuum, lawn_mowerstart / pause and back to dockstart / pause and back to dock
lockhold the icon to lock or unlockhold the icon to lock or unlock
alarm_control_panelhold the icon to arm or disarm *hold the icon to arm or disarm *

* Unless the panel wants a code. A fan with more than six speeds gets a slider in place of its speeds. Every other kind (a sensor, the weather, the energy kinds …) has no control until you set one.

Edit

Another control, or none ​

A control's name shows that control alone in place of the kind's: a light that only dims takes control: slider, which shows the slider without the switch (on a tile, the light's icon still switches it). control: false shows none, for a thermostat you only want to look at.

Edit

A control on any entity ​

Any tile or poster takes a control its entity supports, whatever its kind: a slider for a number, a select for an input select, a switch for a switch, a button for a script. control: auto picks the domain's own control where the kind has none. The reference lists every control and what it suits.

Edit

The control's options ​

A control with options is an object: its type and what it takes. step sets the step of a slider or a stepper. attribute picks what it sets (below). options limits segments and a select to the ones you list, each with its own label and icon.

An object without type changes the kind's own controls: control: { step: 1 } steps a thermostat by whole degrees, control: { confirm: true } makes a cover's buttons holds.

Edit

What a control sets ​

type says how a control is drawn, attribute what it sets, by Home Assistant's name for it: a light's slider sets its brightness, or its color_temp_kelvin, hue or saturation. Left out, a control sets the mode the card shows (on a thermostat card showing attribute: preset_mode, segments set the preset), else what its type sets by default: on a light, a slider sets the brightness, buttons the favourite colours, a select the effect. An attribute the entity's domain cannot set is a config error. The reference lists every one.

A light's colour ​

color_temp_kelvin, hue and saturation draw the slider as the colours it sets; while the light is off it is faded, and a drag turns it on in that colour. Buttons are the light's favourite colours, each a swatch that sets it; a select sets its effect.

Edit

Climate and air ​

A thermostat's segments or select set its hvac_mode, preset_mode, fan_mode, swing_mode or swing_horizontal_mode, a stepper its temperature or humidity. A thermostat holding a range (heat_cool) gets a stepper for its low and one for its high target, as Home Assistant's own. A humidifier takes a switch, its target humidity and its mode; a water heater its temperature and its operation_mode. A fan's switch sets its power, or its oscillating; segments its speed, its preset_mode or its direction.

Edit

Covers and valves ​

A cover's slider and buttons move it, or tilt it with attribute: current_tilt_position; its segments are its favourite positions. A valve takes a switch, its buttons (open, stop, close) and a slider where it has a position.

Edit

Media, robots, locks and alarms ​

A speaker's select sets its source or sound_mode, its stepper the volume by 5 %. A robot's select sets its fan_speed. A domain's buttons are named in options, in your order: a robot's start_pause, stop, clean_spot, locate and dock, a lock's lock, unlock and open_door (always held for a second). A domain's buttons leave out what the entity says it does not support: a garage door that only opens and closes has no stop, a TV without tracks no previous or next. A switch on a lock locks and unlocks it. An alarm panel's segments arm it in the modes it supports and disarm it. A lock or a panel that wants a code opens Home Assistant's dialog for it instead, from a switch or a hold too.

Edit

Helpers, updates and dates ​

A counter steps by its own step, or takes buttons (decrement, reset, increment). A timer's buttons are start, pause and cancel (finish when you name it), or its presets with attribute: presets; its time left counts down beside them (see Timer). An update's are skip and install. A date, a date and time or an input date takes control: date: a chip with the day that opens a calendar.

Edit

Favourites ​

A light's favourite colours, a cover's or a valve's favourite positions and a timer's presets are those you set in Home Assistant, in the entity's more-info dialog, as for Home Assistant's own tile. Without any, a cover offers 0, 25, 75 and 100 %, and a light four whites across its range plus four colours where it takes colours; a timer without presets shows none, and the visual editor does not offer them. options sets your own in the card instead.

Where it sits ​

position puts a control in one of two places. On a tile, end is at the end of the line and block is below it, across the whole tile. On a poster, end is beside the value and block is under it.

A slider sits at block, every other control at end. On a narrow card a control at the end moves under the line or the value rather than squeeze it.

Edit

Your own buttons ​

control: { type: buttons, options: [ … ] } draws a row of your own buttons. Each button does one of three things:

  • Runs its entity: a scene or a script turns on, a button is pressed.
  • Switches its entity: a light, a switch or a fan. The button is grey while it is off and filled in its entity's colour while it is on (tinted with variant: tinted).
  • Runs its tap_action: any Home Assistant action. Without a target, the action uses the button's entity: a robot's Dock button is entity: vacuum.robot with tap_action: { action: perform-action, perform_action: vacuum.return_to_base }.

An entity a button can neither run nor switch (a sensor, a window) opens its dialog. A card of buttons needs no entity: a name and an icon are enough. A button takes its entity's colour (a light amber, a fan cyan, a cover purple) unless it names one. show_name: true writes its name beside the icon. A button with visibility comes and goes with its conditions; below, Movie shows only while the speaker plays.

Edit

Buttons that show state ​

A button shows its entity with its name, its value and rules of its own, and is filled while the entity is active. A room's poster can carry its lights, its blinds, its windows and its heating in one row.

What fills a button ​

A button fills in Home Assistant's colour for its entity while the entity is active:

EntityFilled while
a light, a switch, a fan …it is on
a cover, a valveit is open
a lockit is unlocked
a binary sensorit is on: a window open, motion seen, smoke detected
a person, a trackerthey are not away: home or in a zone
a thermostatit heats, cools, dries or runs its fan (hvac_action), not by mode
a humidifierit humidifies or dries, else while it is on
a scene, a script, a buttonnever: it flashes when pressed
a sensor, a number, the weathernever on its own: a rule can fill it

A thermostat in heat all winter stays grey while the room is warm enough, and fills while it heats.

Edit

Names and values ​

show_name: true writes the button's name beside its icon, show_value: true its value after it: the state, or the attribute it names, as Home Assistant writes it (a position's %, a thermostat's °C). A value of your own, a text or a template, shows without show_value. unit, decimals, prefix and suffix work as on the card.

Edit

Rules ​

A button's rules work as a badge's: state, above or below, the first match wins, and its icon and color win over the button's. A rule's value is the text while it matches, also on a button that shows no value. active: true fills the button while the rule matches, active: false keeps it grey; a grey button takes the rule's colour on its icon. pulse: true draws a ring around it.

Edit

A rule's own attribute ​

A rule reads the button's value unless it names an attribute of its own. A thermostat's button can show the room's temperature and swap its icon by what the thermostat does. The poster's and the tile's own rules and a badge's take attribute too.

Edit

Only what needs attention ​

On a room's card most things are fine most of the time. visibility shows a button only while it has something to say: a condition without an entity reads the button's own, and attribute reads one of its attributes. Below, the door shows only while it is open and the thermostat only while it heats.

Edit

Filled or tinted ​

Controls are rounded squares of one height, as Home Assistant's tile features; the switch is a button with the power icon, and a slider is a bar filled to the value.

At rest a control is grey; a slider's bar is its colour at 20 % behind the fill. What is on or chosen is filled in its colour with a white icon: a switch that is on, your own buttons while their entity is on, a player's play button, the chosen segment. variant: tinted draws it in its colour at 20 % with the icon in its colour instead. A button (Run), which has no on, rests filled or tinted. Without type the variant changes the kind's own controls: control: { variant: tinted } on a light tints its switch.

Edit

Hold to confirm ​

Some things should not happen by a stray tap. A hold fills the button from the left for a second (one standing in for the icon: a ring around it) and runs when it is full; letting go earlier cancels. There are three ways to get one:

  • confirm: true on the control turns a switch, a Run button or buttons into holds, each button its own.
  • control: hold is a button to hold, for any entity that switches or runs. On one that switches it is filled while the entity is on, as a switch is.
  • icon: { hold_action: … } holds the icon (the icon's actions). Locks and alarm panels do this by default.
Edit

States ​

A control shows what you asked for right away, as a ghost: a switch pulses, a slider's fill is translucent, the segment is outlined. It turns solid once the entity's state changes, or after five seconds if the device never answers. An unavailable entity greys its control out. A failed call shows Home Assistant's error toast.

Keyboard and screen readers ​

Every control works without a pointer. Tab reaches the card first, then its controls in order. Space or Enter flips a switch; the arrow keys step a slider and move along segments; Home and End jump to the ends. To confirm a hold, keep Space or Enter pressed for a second. A screen reader cannot hold, so it presses twice: the first press arms the button ("Press again to …"), a second press within five seconds runs it.

Reference ​

control is a control's name, auto (the kind's, else the domain's: an input select's select, a script's button), false (no control), or an object with the options below. Left out, the card shows the kind's controls.

Control types ​

controlDrawsFor
togglea switchlights, switches, fans, input booleans, media players …
slidera sliderbrightness, cover position, volume, fan speed, numbers
stepper− and + around the valuethermostats, numbers
segmentsone segment per optionfan speeds, a thermostat's modes, selects
selecta dropdownselects, input selects, modes
buttonsa row of buttonscovers, valves, media players, robots, locks, counters, timers, updates; or your own
buttonone buttonscripts, scenes, buttons
holda button held for a secondlocks, alarm panels; any switch that must not go by accident
datea chip with the daydates, dates and times, input dates

Control options ​

KeyDefaultDescription
typethe kind'sOne of the control types. Without it, the other options change the kind's own controls.
positionthe control's ownend (end of the line, beside a poster's value) or block (below it). A slider's is block, the others' end.
stepthe entity's, else 1The step of a slider or a stepper (a thermostat: 0.5).
attributethe shown one, else the type'sWhat it sets, by Home Assistant's name (below).
optionsthe entity'sSegments and select: the options, each { value, label, icon }. Buttons: the domain's own by name ([stop, locate]), or your own buttons (below).
confirmfalseTurns a switch, a Run button or buttons into holds.
variantfillfill or tinted: how a switch, a button, buttons and segments show what is on or chosen.

What each entity sets ​

The first is what a control of its type sets unless attribute names another.

EntityattributeTypes
lightbrightness, color_temp_kelvin, hue, saturation, favorite_colors, effectslider, stepper; buttons (favourite colours), select (effects)
fanpercentage, preset_mode, oscillating, directionslider, stepper, segments, select; toggle (oscillating)
climatetemperature, hvac_mode, preset_mode, fan_mode, swing_mode, swing_horizontal_mode, humiditystepper, slider; segments, select
humidifierhumidity, modeslider, stepper; segments, select; toggle (power)
water_heatertemperature, operation_modestepper, slider; segments, select
covercurrent_position, current_tilt_positionslider, stepper, buttons; segments (favourite positions)
valvecurrent_positionslider, stepper; segments (favourite positions); buttons, toggle
media_playervolume_level, source, sound_modeslider, stepper (5 %); select, segments
vacuumfan_speedselect, segments
alarm_control_panelits modesegments, select
number, input_numberits valueslider, stepper
select, input_selectits optionselect, segments
counter, timerits value; a timer's presetsstepper (a counter); buttons, select (a timer's presets)
date, datetime, input_datetimeits daydate

A domain's buttons ​

options of type: buttons naming them, in your order. Left out, those not marked "also" (a cover with attribute: current_tilt_position: its tilt buttons).

EntityButtons
coveropen, stop, close; tilting: tilt_open, tilt_stop, tilt_close
valveopen, stop, close
media_playerprevious, play_pause, next
vacuumstart_pause, dock; also stop, clean_spot, locate
lawn_mowerstart_pause, dock
locklock, unlock; also open_door (always held)
counterdecrement, reset, increment
timerstart, pause, cancel; also finish
updateskip, install

Your own buttons ​

Each entry of options with type: buttons. A button needs an entity or a tap_action.

KeyDefaultDescription
entityWhat the button shows and runs or switches, and the target of its tap_action.
tap_actionthe entity's ownA Home Assistant action to run (perform-action, navigate, more-info …).
namethe entity's nameIts name, written beside the icon with show_name: true. Template allowed, or its parts: [{ type: entity }].
show_namefalseWrite the name beside the icon.
attribute–Shows this attribute in place of the state.
valuethe stateA text or a template of your own; it shows without show_value.
show_valuefalseWrite the value after the name.
unit, decimalsthe entity'sThe value's unit and decimal places.
prefix, suffix–Text before and after the value.
iconthe entity's iconmdi: icon; a matching rule's wins.
colorits entity'sColour token, hex, var() or a template: the fill while it is filled (else the card's); a matching rule's wins.
rules–state, above or below, and an optional attribute, setting icon, color, value, active and pulse. First match wins.
visibilityalwaysConditions: the button is drawn only while they hold.

label and action (3.0) are read until 4.0: label: Dim is name: Dim with show_name: true, action is tap_action.

Released under the MIT License.