Button Card
The Button card allows you to add buttons to perform tasks.
Screenshot of three Button Cards.
To add the Button card to your user interface, click the menu (three dots at the top right of the screen) and then Edit Dashboard. Click the Add Card button in the bottom right corner and select from the card picker.
All options for this card can be configured via the user interface.
Card Settings
The button name that is displayed on the card. If this field is left blank and the card interacts with an entity, the button name defaults to the entity name. Otherwise, no name is displayed.
The icon that is displayed on the card. If this field is left blank and the card interacts with an entity, the icon defaults to the entity domain icon. Otherwise, no icon is displayed.
Name of any loaded theme to be used for this card. For more information about themes, see the frontend documentation.
The action taken on card tap. For more information, see the action documentation.
The action taken on card tap and hold. For more information, see the action documentation.
YAML Configuration
The following YAML options are available when you use YAML mode or just prefer to use YAML in the Code Editor in the UI.
Configuration Variables
The button name that is displayed on the card. It defaults to the entity name only if the card interacts with an entity. Otherwise, if not configured, no name is displayed.
The icon that is displayed on the card. It defaults to the entity domain icon only if the card interacts with an entity. Otherwise, if not configured, no icon is displayed.
If false, the icon does not change color when the entity is active.
The action taken on card tap. For more information, see the action documentation.
The action taken on card tap and hold. For more information, see the action documentation.
The action taken on card double-tap. For more information, see the action documentation.
Override the used theme for this card with any loaded theme. For more information about themes, see the frontend documentation.
Examples
Basic example:
type: button
entity: light.living_room
Button Card with a button name and a script that runs when card is tapped:
type: button
name: Turn Off Lights
show_state: false
tap_action:
action: call-service
service: script.turn_on
data:
entity_id: script.turn_off_lights
Screenshot of the Button card with Script Service.