Skip to content

Binary Sensor Card

Description

example-image

The binary-sensor-card is to show the state (on/off, open/close, etc.) of a binary sensor, eg. your garage door or a window contact sensor.

Variables

Variable Default Required Notes
entity
ulm_show_last_changed true or false
ulm_card_binary_sensor_name Set custom Name
ulm_card_binary_sensor_icon Set custom Icon

⚠️ Breaking Change v1.0.1

show_last_changed is changed to be used as variable:

variables:
  ulm_show_last_changed: true

Usage

- type: 'custom:button-card'
  template: card_binary_sensor
  variables:
    ulm_card_binary_sensor_alert: true
    ulm_show_last_changed: true
  entity: binary_sensor.garage_door
Template Code
card_binary_sensor.yaml
---
### Card Binary Sensor ###
card_binary_sensor:
  template:
    - "icon_more_info_new"
    - "blue"
    - "ulm_translation_engine"
    - "ulm_actions_card"
  show_last_changed: false
  variables:
    ulm_show_last_changed: false
    ulm_card_binary_sensor_icon: "[[[ return entity.attributes.icon ]]]"
    ulm_card_binary_sensor_name: "[[[ return entity.attributes.friendly_name ]]]"
  custom_fields:
    item1:
      card:
        type: "custom:button-card"
        template:
          - "icon_more_info"
          - "blue"
        custom_fields:
          item1:
            card:
              type: "custom:button-card"
              template:
                - "blue"
              variables:
                ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
                ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
              entity: "[[[ return entity.entity_id ]]]"
              icon: "[[[ return variables.ulm_card_binary_sensor_icon; ]]]"
          item2:
            card:
              type: "custom:button-card"
              template:
                - "blue_no_card"
              variables:
                ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
                ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
              entity: "[[[ return entity.entity_id ]]]"
              name: "[[[ return variables.ulm_card_binary_sensor_name; ]]]"
              label: "[[[ return variables.ulm_translation_state;]]]"
              show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]"