Binary Sensor Alert Card
Description¶
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. This card shows an alert if the state is on/open or unavailable.
Variables¶
Variable | Default | Required | Notes |
---|---|---|---|
entity | |||
ulm_show_last_changed | true or false |
||
ulm_card_binary_sensor_alert_name | Set custom Name | ||
ulm_card_binary_sensor_alert_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_alert
variables:
ulm_card_binary_sensor_alert: true
ulm_show_last_changed: true
entity: binary_sensor.garage_door
Template Code
card_binary_sensor_alert.yaml
---
### Card Binary Sensor Alert ###
card_binary_sensor_alert:
template:
- "icon_more_info_alert"
- "blue"
- "ulm_translation_engine"
- "ulm_actions_card"
show_last_changed: false
variables:
ulm_show_last_changed: false
ulm_card_binary_sensor_alert_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_binary_sensor_alert_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_alert_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_alert_name; ]]]"
label: "[[[ return variables.ulm_translation_state;]]]"
show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]"