Conditional Card


The Conditional card displays another card based on entity states.

Note: Conditions with more than one entity are treated as an ‘and’ condition. This means that for the card to show, all entities must meet the state requirements set.

To add the Conditional 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. Note that while editing the dashboard, the card will always be shown, so be sure to exit editing mode to test the conditions.

All options for this card can be configured via the user interface.

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

type string Required

conditional

conditions list Required

List of entity IDs and matching states.

entity string Required

Entity ID.

state string (Optional)

Entity state is equal to this value.*

state_not string (Optional)

Entity state is unequal to this value.*

card map Required

Card to display if all conditions match.

*one is required (state or state_not)

Examples

type: conditional
conditions:
  - entity: light.bed_light
    state: "on"
  - entity: switch.decorative_lights
    state_not: "off"
card:
  type: entities
  entities:
    - device_tracker.demo_paulus
    - cover.kitchen_window
    - group.kitchen
    - lock.kitchen_door
    - light.bed_light