91JJ
(91JJ)
June 11, 2021, 3:20pm
1
I’ve created three helpers with the intention of using these for the home security automations.
input_boolean.ho_home_lock_open
input_boolean.ho_home_alert
input_boolean.ho_home_lock
I’m hoping to create a single automation that will only allow one of these to be enabled at any time.
So if ‘Home Open’ was ‘on’ and ‘Home Alert’ was turned on, it would turn off ‘Home Open’
Can this be done in one automation?
91JJ
(91JJ)
June 11, 2021, 4:17pm
2
Had a little change of heart on how to do this… Just for anybody in the future reading
I created a new input_select with those three options.
(edit - made some slight alterations)
{
"name": "[HO Security List]",
"icon": "mdi:home-lock",
"options": [
"ho_home_lock_open",
"ho_home_alert",
"ho_home_lock"
],
"id": "jj_list_test"
}
Using the Custom Button Card I created the below card.
type: horizontal-stack
cards:
- type: 'custom:button-card'
color_type: card
entity: input_select.jj_list_test
name: Home Open
icon: 'mdi:home-lock-open'
styles:
card:
- height: 64px
- '--mdc-ripple-color': lime
- '--mdc-ripple-press-opacity': 0.7
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.jj_list_test
option: ho_home_lock_open
state:
- value: ho_home_lock_open
color: green
- operator: default
color: black
- type: 'custom:button-card'
color_type: card
entity: input_select.jj_list_test
name: Home Alert
icon: 'mdi:home-alert'
styles:
card:
- height: 64px
- '--mdc-ripple-color': orange
- '--mdc-ripple-press-opacity': 0.7
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.jj_list_test
option: ho_home_alert
state:
- value: ho_home_alert
color: green
styles: null
- operator: default
color: black
- type: 'custom:button-card'
color_type: card
entity: input_select.jj_list_test
name: Home Lock
icon: 'mdi:home-lock'
confirmation:
text: >-
[[[ return `Are you sure you want to toggle
${entity.attributes.friendly_name}?` ]]]
styles:
card:
- height: 64px
- '--mdc-ripple-color': red
- '--mdc-ripple-press-opacity': 0.7
tap_action:
action: call-service
service: input_select.select_option
service_data:
entity_id: input_select.jj_list_test
option: ho_home_lock
state:
- value: ho_home_lock
color: green
styles: null
- operator: default
color: black
If anybody uses this and finds it useful, please share your mods to the card
3 Likes