Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chadbaldwin/3de6cbf8e59d3e900d0554557546fff0 to your computer and use it in GitHub Desktop.
Save chadbaldwin/3de6cbf8e59d3e900d0554557546fff0 to your computer and use it in GitHub Desktop.
auto entities card + restriction card + template card
homeassistant:
customize: !include customize.yaml
##########################################################
# Always on switches
##########################################################
# List of switches that should be considered "always on". For example, dishwasher, furnace, etc
# The switch is in place purely for monitoring electrical usage. So we want to prevent those swithces from turning off by accident
#switch.outlet_01_switch:
# always_on: true
switch.outlet_02_switch:
always_on: true
#switch.outlet_03_switch:
# always_on: true
#switch.outlet_04_switch:
# always_on: true
#switch.outlet_05_switch:
# always_on: true
switch.outlet_06_switch:
always_on: true
#switch.outlet_07_switch:
# always_on: true
#switch.outlet_08_switch:
# always_on: true
switch.outlet_09_switch:
always_on: true
#switch.outlet_10_switch:
# always_on: true
#switch.outlet_11_switch:
# always_on: true
#switch.outlet_12_switch:
# always_on: true
#switch.outlet_13_switch:
# always_on: true
#switch.outlet_14_switch:
# always_on: true
#switch.outlet_15_switch:
# always_on: true
#switch.outlet_16_switch:
# always_on: true
#switch.outlet_17_switch:
# always_on: true
#switch.outlet_18_switch:
# always_on: true
switch.outlet_19_switch:
always_on: true
#switch.outlet_20_switch:
# always_on: true
switch.outlet_21_switch:
always_on: true
#switch.outlet_22_switch:
# always_on: true
switch.outlet_23_switch:
always_on: true
switch.outlet_24_switch:
always_on: true
switch.outlet_25_switch:
always_on: true
#switch.outlet_26_switch:
# always_on: true
switch.outlet_27_switch:
always_on: true
#switch.outlet_28_switch:
# always_on: true
#switch.outlet_29_switch:
# always_on: true
#switch.outlet_30_switch:
# always_on: true
type: vertical-stack
cards:
- type: custom:auto-entities
card:
type: entities
title: Switches
show_header_toggle: false
state_color: true
filter:
include:
- domain: switch
not:
attributes:
always_on: true
options:
type: custom:template-entity-row
toggle: true
active: '{{ is_state(config.entity, ''on'') }}'
name: |
{{
state_attr(config.entity, 'friendly_name')
| replace(' - Switch', '')
}}
card_mod:
style: |
:host {
--paper-item-icon-active-color: #FFC107;
}
exclude:
- state: unavailable
sort:
method: friendly_name
- type: custom:auto-entities
card:
type: entities
title: Locked Switches
show_header_toggle: false
state_color: true
filter:
include:
- domain: switch
attributes:
always_on: true
options:
type: custom:restriction-card
row: true
action: hold
card:
type: custom:template-entity-row
toggle: true
active: '{{ is_state(config.entity, ''on'') }}'
entity: this.entity_id
name: |
{{
state_attr(config.entity, 'friendly_name')
| replace(' - Switch', '')
}}
card_mod:
style: |
:host {
--paper-item-icon-active-color: #FFC107;
}
exclude:
- state: unavailable
sort:
method: friendly_name
@chadbaldwin
Copy link
Author

[reserving first comment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment