Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- button_card_templates:
- generic_custom_button:
- show_icon: true
- show_name: true
- show_state: false
- color_type: icon
- triggers_update: all
- state:
- - color: rgb(28, 28, 28)
- operator: '=='
- value: 'off'
- styles:
- name:
- - color: rgb(128, 128, 128)
- - color: yellow
- operator: '=='
- value: 'on'
- styles:
- name:
- - color: rgb(255, 255, 255)
- styles:
- card:
- - background-color: transparent
- - '--ha-card-box-shadow': none
- - border-radius: 20px
- - '--mdc-ripple-color': white
- - '--mdc-ripple-press-opacity': 1.5
- - border: 1px solid var(--primary-text-color)
- tap_action:
- action: toggle
- hold_action:
- action: more-info
- double_tap_action:
- action: none
- blank_custom_button:
- show_icon: false
- show_name: false
- show_state: false
- triggers_update: all
- styles:
- card:
- - background-color: transparent
- - border: none
- tap_action:
- action: none
- hold_action:
- action: none
- double_tap_action:
- action: none
- oversized_custom_button:
- template: generic_custom_button
- aspect_ratio: 2/2
- custom_fields:
- color_temp: |-
- [[[ if ((entity.state === 'on')) ;
- if (entity.attributes.color_mode == 'color_temp') return entity.attributes.color_temp_kelvin + "K";
- if (entity.attributes.rgb_color != undefined) return "RGB(" + entity.attributes.rgb_color + ")";
- else return;
- ]]]
- last_changed: |-
- [[[ if (entity.state === 'on') {
- var last_changed_in_minutes = ((new Date().getTime() - new Date(entity.last_changed).getTime())/60000).toFixed(0);
- if (last_changed_in_minutes < 1) return;
- if (last_changed_in_minutes < 60) return last_changed_in_minutes + " min";
- if (last_changed_in_minutes >= 60) {
- var hrs = Math.floor(last_changed_in_minutes / 60);
- return hrs + " hr" + " " + (last_changed_in_minutes % (hrs * 60)) + " min"; }
- } ]]]
- styles:
- card:
- - font-size: 30px
- icon:
- - width: 125%
- custom_fields:
- color_temp:
- - align-self: middle
- - justify-self: right
- - position: absolute
- - right: 3%
- - top: 3%
- - font-size: 20px
- - color: white
- - transform: rotate(0deg)
- - opacity: 33%
- last_changed:
- - align-self: middle
- - justify-self: right
- - position: absolute
- - right: 3%
- - top: 8%
- - font-size: 20px
- - color: white
- - transform: rotate(0deg)
- - opacity: 33%
- oversized_custom_button_with_auto:
- template: oversized_custom_button
- variables:
- var_auto_entity: input_boolean.automation_auto_kitchen_lights
- custom_fields:
- auto: >
- [[[ if ((states[variables.var_auto_entity].state === 'on')) return
- "Automatic"; ]]]
- styles:
- custom_fields:
- auto:
- - align-self: middle
- - justify-self: left
- - position: absolute
- - left: 3%
- - top: 3%
- - font-size: 24px
- - color: yellow
- - transform: rotate(0deg)
- - opacity: 33%
- double_tap_action:
- action: call-service
- service: input_boolean.toggle
- service_data:
- entity_id: '[[[ return variables.var_auto_entity; ]]]'
- rgb_selector:
- template: generic_custom_button
- variables:
- var_color_name: red
- var_entity_id: light.living_room_lights
- show_name: false
- show_icon: false
- styles:
- card:
- - border-radius: 50%
- - height: 75px
- - width: 75px
- - background-color: rgba(255, 0, 0, 0.5)
- tap_action:
- action: call-service
- service: light.turn_on
- service_data:
- entity_id: light.bedroom_lights
- color_name: red
- hold_action:
- action: call-service
- service: nodered.trigger
- service_data:
- entity_id: switch.nodered_all_lights_to_rgb
- payload:
- color_name: '[[[ return variables.var_color_name; ]]]'
- brightness_selector:
- template: generic_custom_button
- variables:
- var_value: 100
- var_entity_id: light.living_room_lights
- name: '[[[ return `${variables.var_value}%` ]]]'
- show_icon: false
- state:
- - operator: template
- value: |-
- [[[ return
- parseInt(states[variables.var_entity_id].attributes.brightness) ===
- Math.round(variables.var_value*255/100) ]]]
- styles:
- name:
- - color: yellow
- card:
- - box-shadow: inset 0px 0px 5px 1px yellow
- - border: 1px solid yellow
- styles:
- card:
- - height: 75px
- name:
- - font-weight: bold
- - font-size: 24px
- tap_action:
- action: call-service
- service: light.turn_on
- service_data:
- brightness_pct: '[[[ return variables.var_value; ]]]'
- entity_id: '[[[ return variables.var_entity_id; ]]]'
- hold_action:
- action: call-service
- service: nodered.trigger
- service_data:
- entity_id: switch.nodered_all_lights_to_rgb
- payload:
- brightness_pct: '[[[ return variables.var_value; ]]]'
- battery_custom_button:
- template: generic_custom_button
- entity: sensor.derek_s_fire_10_battery_level
- name: Tablet
- tap_action:
- action: none
- variables:
- var_color: |-
- [[[
- var battery_level=entity.state;
- if (battery_level > 70) return 'lime';
- else if (battery_level >= 30) return 'yellow';
- else return 'red';
- ]]]
- custom_fields:
- battery_percentage: |
- [[[ if (entity.state === 'unavailable') return " ";
- else return `${entity.state}%` ]]]
- styles:
- card:
- - border: none
- icon:
- - color: '[[[ return variables.var_color ]]]'
- - animation: |
- [[[ if (entity.state <= 10 ) return 'blink 2s ease infinite'; ]]]
- custom_fields:
- battery_percentage:
- - align-self: middle
- - justify-self: center
- - position: absolute
- - left: 5%
- - top: 25%
- - font-size: 14px
- - color: '[[[ return variables.var_color ]]]'
- - transform: rotate(90deg)
- motion_detector_animated:
- entity: binary_sensor.bathroom_motion_detector_on_off
- name: Bathroom
- show_name: true
- variables:
- var_battery_entity: sensor.living_room_motion_detector_battery_level
- custom_fields:
- battery_percentage: >
- [[[ return `<ha-icon icon="mdi:circle-small" style="width: 25px; height:
- 25px;"> </ha-icon>`; ]]]
- styles:
- custom_fields:
- battery_percentage:
- - position: absolute
- - left: 10%
- - top: 10%
- - color: |-
- [[[
- var battery_level=states[variables.var_battery_entity].state;
- if (battery_level > 70) return 'lime';
- else if (battery_level >= 30) return 'yellow';
- else return 'red';
- ]]]
- card:
- - background-color: rgb(17, 17, 17)
- - border-radius: 20px
- state:
- - value: 'off'
- operator: '=='
- icon: mdi:walk
- color: rgb(28, 28, 28)
- styles:
- name:
- - color: rgb(28, 28, 28)
- - value: 'on'
- operator: '=='
- icon: mdi:motion-sensor
- color: rgb(255, 0, 0)
- styles:
- name:
- - color: white
- icon:
- - animation: blink 2s ease infinite
- - value: unavailable
- operator: '=='
- icon: mdi:walk
- color: rgb(255, 255, 0)
- styles:
- name:
- - color: rgb(255, 255, 0)
- - animation: blink 3s cubic-bezier(.2, 0, 1, 1) infinite
- onstate:
- state:
- - color: rgb(0,255,0)
- value: 'on'
- offstate:
- state:
- - color: rgb(255,0,0)
- value: 'off'
- chips:
- tap_action:
- action: more-info
- show_icon: false
- show_label: true
- show_name: false
- show_state: false
- styles:
- label:
- - justify-self: center
- - padding: 0px 6px
- - font-weight: bold
- - font-size: 14px
- img_cell:
- - width: 24px
- grid:
- - grid-template-areas: '''l'''
- card:
- - border-radius: 18px
- - box-shadow: var(--box-shadow)
- - height: 36px
- - width: auto
- - padding-left: 6px
- - padding-right: 6px
- size: 80%
- chip_icon_label:
- template: chips
- show_icon: true
- size: 100%
- styles:
- card:
- - padding-top: 6px
- - padding-button: 6px
- - padding-left: 12px
- grid:
- - grid-template-areas: '''i l'''
- - grid-template-columns: max_content auto
- - grid-template-rows: min-content
- img_cell:
- - place-self: center
- - width: 14px
- - height: 24px
- label:
- - font-size: 12px
- - margin-left: 0px
- views:
- - icon: mdi:animation-outline
- theme: Derek Dark Theme
- badges: []
- cards:
- - type: custom:stack-in-card
- mode: horizontal
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- cards:
- - type: custom:auto-entities
- card:
- type: custom:layout-card
- layout_type: horizontal
- layout_options:
- width: 100
- filter:
- include:
- - domain: light
- options:
- type: custom:button-card
- entity_id: this.entity_id
- layout: vertical
- show_last_changed: true
- aspect_ratio: 1/1
- styles:
- card:
- - box-shadow: none
- - background-color: transparent
- - border: 1
- - padding: 15%
- - color: yellow
- - opacity: 1
- - font-size: 10px
- - text-shadow: 0px 0px 5px black
- - text-transform: capitalize
- icon:
- - width: 40%
- - padding-top: 10px
- label:
- - color: gray
- - font-size: 10px
- - padding-top: 0px
- - opacity: 0.7
- name:
- - white-space: normal
- - font-weight: 300
- - font-size: 10px
- - color: white
- tap_action:
- action: toggle
- hold_action:
- action: more-info
- exclude:
- - state: 'off'
- - entity_id: '*lights*'
- - entity_id: '*screen*'
- - state: '0'
- - state: unavailable
- sort:
- method: name
- reverse: false
- numeric: false
- show_empty: true
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- icon: mdi:star
- name: Blink
- styles:
- icon:
- - animation: blink 1s infinite
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @keyframes bounce {
- 0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
- 40% { transform: translateY(-25px); }
- 60% { transform: translateY(-15px); }
- }
- icon: mdi:star
- name: Bounce
- styles:
- icon:
- - animation: bounce 1s infinite
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @-webkit-keyframes swing
- {
- 15%
- {
- -webkit-transform: translateX(5px);
- transform: translateX(5px);
- }
- 30%
- {
- -webkit-transform: translateX(-5px);
- transform: translateX(-5px);
- }
- 50%
- {
- -webkit-transform: translateX(3px);
- transform: translateX(3px);
- }
- 65%
- {
- -webkit-transform: translateX(-3px);
- transform: translateX(-3px);
- }
- 80%
- {
- -webkit-transform: translateX(2px);
- transform: translateX(2px);
- }
- 100%
- {
- -webkit-transform: translateX(0);
- transform: translateX(0);
- }
- }
- icon: mdi:star
- name: Swing
- styles:
- icon:
- - animation: swing 1s infinite
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @keyframes red-alert {
- 0% {
- -moz-box-shadow: 0 0 0 0 rgba(255,0,0, 0.7);
- box-shadow: 0 0 0 0 rgba(255,0,0, 0.7);
- }
- 70% {
- -moz-box-shadow: 0 0 0 10px rgba(240,52,52, 0.9);
- box-shadow: 0 0 0 15px rgba(240,52,52, 0.7);
- }
- 100% {
- -moz-box-shadow: 0 0 0 0 rgba(240,52,52, 0);
- box-shadow: 0 0 0 0 rgba(240,52,52, 0);
- }
- }
- icon: mdi:star
- name: Red Alert
- styles:
- icon:
- - animation: red-alert 1s infinite
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @keyframes scale {
- from {
- transform: scale(1);
- box-shadow: 0 8px 6px -6px #6C7A89;
- }
- to {
- transform: scale(1.25);
- box-shadow: 0 10px 6px -6px #6C7A89;
- }
- icon: mdi:star
- name: Scale
- styles:
- icon:
- - animation: scale 2s ease-in-out infinite alternate
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- icon: mdi:star
- name: Rotating
- styles:
- icon:
- - animation: rotating 5s linear infinite alternate
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @keyframes fade {
- 0%, 100% {
- opacity: 0.5;
- }
- 50% {
- opacity: 1;
- }
- }
- icon: mdi:star
- name: Fade
- styles:
- icon:
- - animation: fade 2s ease-in-out infinite alternate
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @keyframes heartbeat {
- 0% {
- opacity: 1;
- transform: scale(0.95);
- }
- 30% {
- opacity: 0.7;
- transform: scale(1.05);
- }
- 40% {
- opacity: 1;
- transform: scale(0.9);
- }
- 50% {
- opacity: 0.7;
- transform: scale(1.1);
- }
- 60% {
- opacity: 1;
- transform: scale(0.95);
- }
- 90% {
- opacity: 1;
- transform: scale(0.95);
- }
- 100% {
- opacity: 1;
- transform: scale(0.95);
- }
- }
- icon: mdi:star
- name: Heartbeat
- styles:
- icon:
- - animation: heartbeat 1.5s infinite
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @-webkit-keyframes WidthAni {
- 0% {width: 0px}
- 10% {width: 50%;left: 0;right: 0}
- 20% {width: 5%;left: 95%;}
- 25% {width: 5%;left: 95%;}
- 35% {width: 50%;left: 0%;}
- 45% {width: 0%;}
- 100% {width: 0%;}
- }
- icon: mdi:star
- name: In & Out
- styles:
- icon:
- - animation: WidthAni 5.0s infinite ease-in-out
- - type: custom:button-card
- entity: binary_sensor.hallway_closet
- extra_styles: |
- @keyframes cool {
- 0% {
- transform: rotate(0deg);
- background-color: #ff4081;
- }
- 25% {
- transform: rotate(90deg);
- background-color: #40c4ff;
- }
- 50% {
- transform: rotate(180deg);
- background-color: #ffdd57;
- }
- 75% {
- transform: rotate(270deg);
- background-color: #ccff90;
- }
- 100% {
- transform: rotate(360deg);
- background-color: #ff4081;
- }
- }
- icon: mdi:star
- name: Cool
- styles:
- icon:
- - animation: cool 4s infinite
- - title: Test bed
- icon: mdi:test-tube
- path: lab
- badges: []
- cards:
- - type: horizontal-stack
- title: bedroom1
- card_mod:
- style: |
- ha-card {
- border: solid 1px var(--primary-text-color);
- background-color: rgba(0, 0, 0, 0)
- }
- cards:
- - type: custom:light-brightness-preset-row
- entity: light.bedroom1
- name: ' '
- reverseButtons: true
- customSetpoints: true
- lowBrightness: 30
- medBrightness: 127
- hiBrightness: 255
- - type: custom:slider-entity-row
- entity: light.bedroom1
- toggle: false
- hide_state: true
- hide_when_off: true
- full_row: true
- haptic: light
- min: 5
- step: 10
- - type: vertical-stack
- title: RGB Light card (visible when on)
- cards:
- - type: custom:rgb-light-card
- entity: light.bedroom1
- hide_when_off: true
- justify: center
- colors:
- - rgb_color:
- - 255
- - 0
- - 0
- transition: 0
- - rgb_color:
- - 0
- - 255
- - 0
- transition: 0
- - rgb_color:
- - 0
- - 0
- - 255
- transition: 0
- - color_temp: 288
- transition: 0
- - kelvin: 2000
- transition: 0
- state_color: true
- - type: vertical-stack
- title: Auto entities - motion detectors
- cards:
- - type: custom:auto-entities
- card:
- type: entities
- card_mod:
- style: |
- ha-card {
- border: solid 1px var(--primary-text-color);
- background-color: rgba(0, 0, 0, 0)
- }
- filter:
- include:
- - entity_id: '*motion_detector_o*'
- exclude: []
- sort:
- method: none
- - type: custom:button-card
- template: generic_custom_button
- show_header_toggle: false
- entity: zone.home
- icon: mdi:restart
- name: Theme Restart
- show_state: false
- show_icon: true
- styles:
- card:
- - height: 150px
- - width: 150px
- - '--mdc-ripple-color': red
- - '--mdc-ripple-press-opacity': 1.5
- tap_action:
- action: none
- hold_action:
- action: call-service
- service: frontend.reload_themes
- - type: grid
- cards:
- - type: custom:button-card
- template: generic_custom_button
- entity: sensor.s22_ultra_battery_level
- name: S22
- styles:
- icon:
- - animation: |
- [[[
- if (states['binary_sensor.s22_ultra_is_charging'].state === 'on') return 'blink 2s ease infinite';
- ]]]
- - color: |
- [[[
- if (states['binary_sensor.s22_ultra_is_charging'].state === 'on')
- return 'red';
- ]]]
- - type: custom:button-card
- template: generic_custom_button
- entity: sensor.s22_ultra_battery_level
- name: S22
- variables:
- var_color: |-
- [[[
- var blevel=entity.state;
- if (blevel > 70) return 'lime';
- else if (blevel >= 30) return 'yellow';
- else return 'red';
- ]]]
- custom_fields:
- battery_percentage: |
- [[[
- return `${entity.state}%`
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- custom_fields:
- battery_percentage:
- - align-self: right
- - position: absolute
- - right: 9%
- - top: 3%
- - font-size: 14px
- - color: '[[[ return variables.var_color ]]]'
- - type: custom:button-card
- template: generic_custom_button
- entity: sensor.s22_ultra_battery_level
- name: S22
- variables:
- var_color: |-
- [[[
- var blevel=entity.state;
- if (blevel > 80) return 'lime';
- else if (blevel >= 30) return 'green';
- else if (blevel >= 30) return 'orange';
- else if (blevel >= 30) return 'yellow';
- else return 'red';
- ]]]
- custom_fields:
- battery_percentage: |
- [[[
- return `${entity.state}%`
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- custom_fields:
- battery_percentage:
- - align-self: right
- - position: absolute
- - right: 9%
- - top: 14%
- - font-size: 14px
- - color: '[[[ return variables.var_color ]]]'
- - transform: rotate(90deg)
- - type: entities
- entities:
- - entity: light.living_room1
- - entity: light.living_room1
- - entity: light.living_room1
- - entity: light.living_room1
- show_header_toggle: false
- title: Card Mod Test
- card_mod:
- style: |
- ha-card {
- border: solid 1px var(--primary-text-color);
- background-color: rgba(0, 0, 0, 0)
- }
- - type: custom:button-card
- template: generic_custom_button
- show_state: true
- show_icon: false
- show_name: false
- entity: sensor.time
- styles:
- card:
- - font-size: 75px
- - type: grid
- cards:
- - type: custom:button-card
- entity: sensor.processor_temperature
- icon: mdi:raspberry-pi
- aspect_ratio: 1/1
- name: HassOS
- styles:
- card:
- - background-color: '#000044'
- - border-radius: 10%
- - padding: 10%
- - color: ivory
- - font-size: 10px
- - text-shadow: 0px 0px 5px black
- - text-transform: capitalize
- grid:
- - grid-template-areas: '"i temp" "n n" "cpu cpu" "ram ram" "sd sd"'
- - grid-template-columns: 1fr 1fr
- - grid-template-rows: 1fr min-content min-content min-content min-content
- name:
- - font-weight: bold
- - font-size: 13px
- - color: white
- - align-self: middle
- - justify-self: start
- - padding-bottom: 4px
- img_cell:
- - justify-content: start
- - align-items: start
- - margin: none
- icon:
- - color: |
- [[[
- if (entity.state < 60) return 'lime';
- if (entity.state >= 60 && entity.state < 80) return 'orange';
- else return 'red';
- ]]]
- - width: 70%
- - margin-top: '-10%'
- custom_fields:
- temp:
- - align-self: start
- - justify-self: end
- cpu:
- - padding-bottom: 2px
- - align-self: middle
- - justify-self: start
- - '--text-color-sensor': >-
- [[[ if (states["sensor.processor_use"].state > 80) return
- "red"; ]]]
- ram:
- - padding-bottom: 2px
- - align-self: middle
- - justify-self: start
- - '--text-color-sensor': >-
- [[[ if (states["sensor.memory_use_percent"].state > 80)
- return "red"; ]]]
- sd:
- - align-self: middle
- - justify-self: start
- - '--text-color-sensor': >-
- [[[ if
- (states["sensor.derek_s_fire_10_external_storage"].state >
- 80) return "red"; ]]]
- custom_fields:
- temp: |
- [[[
- return `<ha-icon
- icon="mdi:thermometer"
- style="width: 12px; height: 12px; color: yellow;">
- </ha-icon><span>${entity.state}°F</span>`
- ]]]
- cpu: |
- [[[
- return `<ha-icon
- icon="mdi:server"
- style="width: 12px; height: 12px; color: deepskyblue;">
- </ha-icon><span>CPU: <span style="color: var(--text-color-sensor);">${states['sensor.processor_use'].state}%</span></span>`
- ]]]
- ram: |
- [[[
- return `<ha-icon
- icon="mdi:memory"
- style="width: 12px; height: 12px; color: deepskyblue;">
- </ha-icon><span>RAM: <span style="color: var(--text-color-sensor);">${states['sensor.memory_use_percent'].state}%</span></span>`
- ]]]
- sd: |
- [[[
- return `<ha-icon
- icon="mdi:harddisk"
- style="width: 12px; height: 12px; color: deepskyblue;">
- </ha-icon><span>SD: <span style="color: var(--text-color-sensor);">${states['sensor.derek_s_fire_10_external_storage'].state}%</span></span>`
- ]]]
- - type: entities
- show_header_toggle: false
- title: Entities with sliders
- entities:
- - type: custom:slider-entity-row
- entity: light.all_lights
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- - type: custom:slider-entity-row
- entity: light.bathroom_lights
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- - type: custom:slider-entity-row
- entity: light.bedroom_lights
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- - type: custom:slider-entity-row
- entity: light.hallway
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- - type: custom:slider-entity-row
- entity: light.kitchen_lights
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- - type: custom:slider-entity-row
- entity: light.living_room_lights
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- - type: custom:slider-entity-row
- entity: light.office_lights
- toggle: true
- hide_when_off: true
- haptic: light
- min: 5
- step: 20
- state_color: true
- - type: vertical-stack
- title: Markdown with formatted date/time
- cards:
- - type: markdown
- content: '{{ now().strftime("%m/%d/%Y, %H:%M") }}'
- - type: markdown
- content: |-
- {% set time = now().hour %}
- {% if (time >= 18) %}
- Good evening, {{user}}!
- {% elif (time >= 12) %}
- Good afternoon, {{user}}!
- {% elif (time >= 6) %}
- Good morning, {{user}}!
- {% elif (time >= 0) %}
- Good night, {{user}}!
- {% else %}
- Hallo, {{user}}!
- {% endif %}
- Today is **{{ now().strftime('%B %d, %Y') }}**
- card_mod:
- style: |
- ha-markdown {
- padding: 0 0 0 1 !important;
- font-size: 12px !important;
- font-weight: normal !important;
- line-height: 1.4 !important;
- }
- ha-card {
- font-family: Arial;
- text-align: center;
- width: 120px;
- box-shadow: 0px 2px 5px 1px red;
- border-radius: 25px;
- margin-left: auto;
- margin-right: auto;
- margin-top: 4px;
- margin-bottom: 4px;
- padding-top: 15px;
- padding-right: 15px;
- padding-left: 15px;
- padding-bottom: 15px;
- padding: 15px;
- {% if is_state('light.bedroom_lights', 'on') %}
- background-color: yellow;
- color: black;
- box-shadow: inset 0px 0px 5px 1px black;
- {% else %}
- background: transparent;
- color: yellow;
- box-shadow: inset 0px 0px 5px 1px yellow;
- {% endif %}
- }
- - type: markdown
- content: '{{ now().strftime("%m/%d/%y, %H:%M") }}'
- card_mod:
- style: |
- ha-card {
- background: transparent;
- }
- :host {
- position: fixed;
- top: 0px;
- right: 10%;
- z-index: 99;
- font-size:25px;
- }
- - type: markdown
- content: '{{ states("input_select.navigation_test_variable") }}'
- - type: vertical-stack
- title: Button card with glow when on
- cards:
- - type: grid
- cards:
- - type: custom:button-card
- layout: icon_name
- entity: light.living_room1
- label: lamp
- show_state: false
- show_name: false
- show_label: true
- color: auto
- styles:
- grid:
- - grid-template-rows: 42px 0px auto
- - grid-template-columns: 42px auto
- icon:
- - height: 30px
- - width: 30px
- card:
- - border-radius: 15px
- - height: 76px
- - width: 76px
- - margin: 5px 5px 0px 0px
- - padding: 0px 0px
- label:
- - justify-self: end
- - align-self: end
- - padding: 9px 10px
- - font-size: 12px
- - text-transform: capitalize
- state:
- - value: 'on'
- styles:
- card:
- - '--paper-card-background-color': rgba(40, 40, 40)
- - box-shadow: inset 0px 0px 10px 3px yellow
- name:
- - color: white
- state:
- - color: white
- label:
- - color: white
- - value: 'off'
- styles: null
- tap_action:
- action: toggle
- - type: custom:button-card
- layout: icon_name
- entity: light.living_room1
- label: lamp
- show_state: false
- show_name: false
- show_label: true
- color: auto
- styles:
- grid:
- - grid-template-rows: 42px 0px auto
- - grid-template-columns: 42px auto
- icon:
- - height: 30px
- - width: 30px
- card:
- - border-radius: 15px
- - height: 76px
- - width: 76px
- - margin: 5px 5px 0px 0px
- - padding: 0px 0px
- label:
- - justify-self: center
- - align-self: end
- - padding: 9px 10px
- - font-size: 12px
- - text-transform: capitalize
- state:
- - value: 'on'
- styles:
- card:
- - '--paper-card-background-color': rgba(40, 40, 40)
- - box-shadow: inset 0px 0px 10px 3px yellow
- name:
- - color: white
- state:
- - color: white
- label:
- - color: white
- - value: 'off'
- styles: null
- tap_action:
- action: toggle
- - type: vertical-stack
- title: Templated sensor (in configuration.yaml)
- cards:
- - type: grid
- columns: 2
- cards:
- - type: sensor
- entity: sensor.sensor_f2c
- graph: none
- - type: sensor
- entity: sensor.bathroom_door_temperature
- graph: none
- square: false
- - type: custom:button-card
- entity: sensor.bathroom_door_temperature
- name: '[[[ return Math.round(entity.state) + " °F" ]]]'
- state_display: '[[[ return Math.round(entity.state * 10) / 10 + " °F" ]]]'
- show_state: true
- show_icon: false
- - type: custom:stack-in-card
- mode: vertical
- title: Show an entity's attribute
- cards:
- - type: custom:button-card
- entity: light.living_room1
- name: '[[[ return entity.attributes.brightness]]]'
- show_icon: false
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: custom:button-card
- entity: light.living_room1
- name: '[[[ return entity.state ]]]'
- show_icon: false
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: custom:button-card
- entity: light.living_room1
- name: >-
- [[[ if (entity.state === "on") return "Yup"; if (entity.state ===
- "off") return "Nope"; else return "Dunno"]]]
- show_icon: false
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: custom:button-card
- entity: light.living_room1
- name: This is a test
- show_icon: false
- styles:
- name:
- - font-family: Wingdings
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: custom:apexcharts-card
- series:
- - entity: sensor.bathroom_door_temperature
- - type: custom:mushroom-media-player-card
- entity: media_player.plex_plex_for_windows_desktop_p54jk04
- name: Plex
- icon: mdi:plex
- use_media_info: true
- show_volume_level: true
- media_controls:
- - play_pause_stop
- volume_controls: []
- fill_container: true
- collapsible_controls: true
- hold_action:
- action: none
- double_tap_action:
- action: none
- icon_type: entity-picture
- - type: custom:button-card
- header: State modifiers
- entity: input_boolean.automation_override
- show_name: true
- show_state: true
- name: Automations
- icon: mdi:lightbulb-auto-outline
- state:
- - value: 'off'
- operator: '=='
- styles:
- icon:
- - color: red
- state_display: Automations are off.
- - value: 'on'
- operator: '=='
- styles:
- icon:
- - color: green
- - icon: mdi:lightbulb
- state_display: Automations are on.
- - type: custom:stack-in-card
- mode: vertical
- title: Icon based on another entity state
- cards:
- - type: custom:button-card
- entity: light.bedroom1
- name: Bedroom1
- color: auto
- icon: |
- [[[
- if (states['input_boolean.tester'].state === 'on')
- return 'mdi:lightbulb';
- else
- return 'mdi:lightbulb-auto';
- ]]]
- - type: custom:button-card
- entity: light.bedroom1
- name: Bedroom1
- color: auto
- icon: |
- [[[
- if (states['input_boolean.tester'].state == "on")
- return 'phu:ikea-blind-closed';
- if (states['input_boolean.tester'].state == "off")
- return 'phu:ikea-blind-open';
- ]]]
- - type: custom:button-card
- entity: light.bedroom1
- name: Bedroom1
- color: auto
- icon: |
- [[[
- if (entity.state == "on")
- return 'phu:ikea-blind-closed';
- if (entity.state == "off")
- return 'phu:ikea-blind-open';
- ]]]
- - type: custom:mini-media-player
- name: Desktop Plex
- entity: media_player.plex_plex_for_windows_desktop_p54jk04
- icon: mdi:plex
- artwork: full
- source: full
- mini-media-player-scale: 1
- hide:
- power_state: false
- power: true
- source: true
- name: true
- icon: true
- runtime: false
- controls: full
- volume: false
- progress: true
- - type: custom:stack-in-card
- title: Icon and color based on state (card_mod)
- mode: vertical
- cards:
- - type: entities
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- entities:
- - entity: light.hallway
- name: Entity card using one state
- card_mod:
- style: |-
- :host {
- {% if is_state('light.hallway', 'off') %}
- --card-mod-icon: mdi:light-switch-off;
- --card-mod-icon-color: red;
- {% else %}
- --card-mod-icon: mdi:light-switch;
- --card-mod-icon-color: green;
- {% endif %}
- }
- - entity: light.living_room_lights
- name: Entity card using time range
- card_mod:
- style: |-
- :host {
- {% if today_at('15:00') < now() < today_at('21:00') %}
- --card-mod-icon-color: green;
- {% else %}
- --card-mod-icon-color: red;
- {% endif %}
- --card-mod-icon: mdi:currency-usd;
- }
- - type: entities
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- entities:
- - entity: light.hallway
- name: Entity card using two states
- card_mod:
- style: |-
- :host {
- {% if is_state('light.hallway', 'off') and is_state('person.derek', 'home') %}
- --card-mod-icon: mdi:light-switch-off;
- --card-mod-icon-color: red;
- {% elif is_state('light.hallway', 'off') and is_state('person.derek', 'not_home') %}
- --card-mod-icon: mdi:chat-question;
- --card-mod-icon-color: white;
- {% else %}
- --card-mod-icon: mdi:light-switch;
- --card-mod-icon-color: yellow;
- {% endif %}
- }
- - type: button
- name: Button card with one state
- show_name: true
- show_icon: true
- entity: light.hallway
- tap_action:
- action: toggle
- card_mod:
- style: |-
- :host {
- {% if is_state('light.hallway', 'off') %}
- --card-mod-icon: mdi:light-switch-off;
- --card-mod-icon-color: red;
- {% else %}
- --card-mod-icon: mdi:light-switch;
- --card-mod-icon-color: yellow;
- {% endif %}
- }
- ha-card {
- border: none;
- }
- - type: button
- name: Button card comparing numbers
- show_name: true
- show_icon: true
- tap_action:
- action: none
- card_mod:
- style: |-
- :host {
- background-color: dimgray;
- {% set level = states('sensor.s22_ultra_battery_level') | int %}
- {% if level >= 80 %}
- --card-mod-icon: mdi:check;
- --card-mod-icon-color: green;
- {% elif level >= 40 %}
- --card-mod-icon: mdi:thumb-up;
- --card-mod-icon-color: yellow;
- {% else %}
- --card-mod-icon: mdi:thumb-down;
- --card-mod-icon-color: red;
- {% endif %}
- }
- ha-card {
- border: none;
- --primary-text-color: hotpink;
- --secondary-text-color: blue;
- }
- - type: vertical-stack
- title: Trigger an automation
- cards:
- - type: custom:mushroom-entity-card
- entity: automation.test_automation
- icon: mdi:controller
- icon_color: deep-orange
- layout: vertical
- secondary_info: none
- name: Call Automation
- tap_action:
- action: call-service
- service: automation.trigger
- service_data:
- entity_id: automation.test_automation
- - type: vertical-stack
- title: Tap navigate based on variable from entity
- cards:
- - type: entities
- entities:
- - input_select.navigation_test_variable
- - type: custom:button-card
- entity: input_select.navigation_test_variable
- size: 25px
- name: '[[[ return entity.state ]]]'
- tap_action:
- action: navigate
- navigation_path: '[[[ return entity.state ]]]'
- - type: vertical-stack
- title: Return count of lights on in group
- cards:
- - type: custom:button-card
- entity: light.all_lights
- name: >
- [[[ var i; var entities = entity.attributes.entity_id; var count =
- 0; for (i = 0; i < entities.length; i++) {
- var state = states[entities[i]].state;
- if (state == 'on') {count += 1;}
- }
- if (count == entities.length) return 'All ' + entities.length + '
- lights on'; if (count == 0) return 'No lights on'; return 'Lights
- on: ' + count + ' of ' + entities.length; ]]]
- - type: vertical-stack
- title: State-switch card (Door open > 30 sec)
- cards:
- - type: custom:state-switch
- entity: template
- template: >-
- {% if is_state('binary_sensor.living_room_door_on_off', 'on') and
- (as_timestamp(now()) -
- as_timestamp(states.binary_sensor.living_room_door_on_off.last_updated))|int
- > 30 %} open_too_long {% endif %}
- states:
- open_too_long:
- type: custom:mushroom-chips-card
- chips:
- - type: template
- icon_color: red
- icon: mdi:door-open
- card_mod:
- style: |
- ha-card {
- animation: blink 1s linear infinite;
- --chip-icon-size: 0.6em;
- }
- hold_action:
- action: navigate
- navigation_path: /fire-main/sensors
- - type: vertical-stack
- title: Custom button with multiple IFs
- cards:
- - type: custom:button-card
- variables:
- temperature: |
- [[[
- var temperature = states["sensor.bedroom_temperature"].state;
- if (temperature >= 74) return "high";
- else if (temperature <= 60) return "low";
- else return true
- ]]]
- humidity: |
- [[[
- var humidity = states["sensor.bedroom_humidity"].state;
- if (humidity >= 60) return "high";
- else if (humidity <= 30) return "low";
- else return true
- ]]]
- name: >
- [[[
- if (variables.temperature == true && variables.humidity == true)
- return "Temperature & Humidity Good";
- if (variables.temperature != true && variables.humidity == true)
- return "Temperature " + variables.temperature;
- if (variables.temperature == true && variables.humidity != true)
- return "Humidity " + variables.humidity;
- if (variables.temperature != true && variables.humidity != true)
- return "Temperature " + variables.temperature + " & humidity " +
- variables.humidity;
- else return "unknown";
- ]]]
- icon: >
- [[[ if (variables.temperature == true && variables.humidity ==
- true) return "mdi:check";
- if (variables.temperature != true && variables.humidity == true)
- return "mdi:thermometer";
- if (variables.temperature == true && variables.humidity != true)
- return "mdi:water";
- if (variables.temperature != true && variables.humidity != true)
- return "mdi:thermometer-water";
- else return "mdi:minus-circle-outline"; ]]]
- styles:
- icon:
- - color: >
- [[[ if (variables.temperature == true && variables.humidity
- == true) return "white" ; else return "black"; ]]]
- card:
- - color: >
- [[[ if (variables.temperature == true && variables.humidity
- == true) return "white" ; else return "black"; ]]]
- - background-color: >
- [[[ if (variables.temperature == true && variables.humidity
- == true) return 'green'; else return 'red'; ]]]
- - type: custom:button-card
- entity: light.bedroom1
- template: chips
- tap_action:
- action: toggle
- entity: '[[[ return variables.ulm_chip_mdi_icon_only_entity ]]]'
- show_icon: true
- icon: '[[[ return variables.ulm_chip_mdi_icon_only_icon ]]]'
- styles:
- grid:
- - grid-template-areas: '''i'''
- icon:
- - color: '[[[ return variables.ulm_chip_mdi_icon_only_icon_color; ]]]'
- variables:
- ulm_chip_mdi_icon_only_entity: light.bedroom1
- ulm_chip_mdi_icon_only_icon: mdi:lightbulb
- ulm_chip_mdi_icon_only_icon_color: white
- - type: custom:button-card
- entity: input_number.temp_helper
- name: |
- [[[
- var value = states["input_number.temp_helper"].state;
- if (value >= 20) return "Full";
- if (value >= 10) return "Half";
- if (value < 10) return "Empty";
- else return "Unknown";
- ]]]
- icon: |
- [[[
- var value = states["input_number.temp_helper"].state;
- if (value >= 20) return "mdi:circle";
- if (value >= 10) return 'mdi:circle-half-full';
- if (value < 10) return 'mdi:circle-outline';
- else return
- ]]]
- - type: custom:button-card
- show_icon: false
- entity: input_boolean.tester
- name: |-
- [[[
- var t = states['timer.tester'].attributes.finishes_at;
- if (entity.state === "on") return "Apple";
- if (entity.state === "off") return t
- ]]]
- - type: vertical-stack
- title: Hiding entity/cards based on state
- cards:
- - type: entities
- title: Using an entities card with conditional
- entities:
- - entity: input_boolean.tester
- name: Enable automation?
- - type: conditional
- conditions:
- - entity: input_boolean.tester
- state: 'on'
- row:
- entity: input_datetime.automation_nighttime_motion_detection_start
- name: Start Time
- - type: conditional
- conditions:
- - entity: input_boolean.tester
- state: 'on'
- row:
- entity: input_datetime.automation_nighttime_motion_detection_end
- name: End Time
- - type: custom:stack-in-card
- title: Using a conditional card
- mode: vertical
- cards:
- - type: entities
- entities:
- - entity: input_boolean.tester
- name: Enable automation?
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: conditional
- conditions:
- - entity: input_boolean.tester
- state_not: 'off'
- card:
- type: vertical-stack
- cards:
- - type: entities
- entities:
- - entity: >-
- input_datetime.automation_nighttime_motion_detection_start
- name: Start time
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: entities
- entities:
- - entity: >-
- input_datetime.automation_nighttime_motion_detection_end
- name: End time
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: custom:button-card
- entity: person.derek
- name: >-
- [[[ if (entity.state === "home") return "At the house"; else return
- "Not at the house" ]]]
- - type: custom:button-card
- entity: sensor.bedroom_temperature
- name: '[[[ return parseFloat(entity.state).toFixed(1) + "°F" ]]]'
- - type: vertical-stack
- title: Stack-in-card with borders removed
- cards:
- - type: custom:stack-in-card
- mode: vertical
- cards:
- - type: horizontal-stack
- cards:
- - show_name: true
- show_icon: true
- type: button
- tap_action:
- action: toggle
- entity: light.living_room_lights
- icon: mdi:sleep
- name: Sleep
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - show_name: true
- show_icon: true
- type: button
- tap_action:
- action: toggle
- entity: light.living_room_lights
- icon: mdi:sleep
- name: Sleep
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - show_name: true
- show_icon: true
- type: button
- tap_action:
- action: toggle
- entity: light.living_room_lights
- icon: mdi:sleep
- name: Sleep
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - type: horizontal-stack
- cards:
- - show_name: true
- show_icon: true
- type: button
- tap_action:
- action: toggle
- entity: light.living_room_lights
- icon: mdi:sleep
- name: Sleep
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - show_name: true
- show_icon: true
- type: button
- tap_action:
- action: toggle
- entity: light.living_room_lights
- icon: mdi:sleep
- name: Sleep
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - show_name: true
- show_icon: true
- type: button
- tap_action:
- action: toggle
- entity: light.living_room_lights
- icon: mdi:sleep
- name: Sleep
- card_mod:
- style: |
- ha-card {
- border: none;
- }
- - show_name: true
- show_icon: true
- show_state: true
- type: glance
- entities:
- - entity: light.bedroom2
- - entity: sensor.canon_laser_printer
- - entity: button.fire_living_room_restart_browser
- columns: 4
- - type: grid
- columns: 4
- card_mod:
- style: |
- ha-card {
- padding: 0px !important;
- margin: 0px;
- }
- cards:
- - type: custom:button-card
- entity: light.living_room_lights
- name: Lights
- card_mod:
- style: |
- ha-card {
- padding: 0px !important;
- margin: 0px !important;
- }
- - type: custom:button-card
- entity: light.living_room_lights
- name: Lights
- - type: custom:button-card
- entity: light.living_room_lights
- name: Lights
- - type: custom:button-card
- entity: light.living_room_lights
- name: Lights
- - type: entities
- entities:
- - sensor.s22_ultra_battery_level
- card_mod:
- style: |-
- :host {
- {% set phlevel = states('sensor.s22_ultra_battery_level') | float %}
- {% if phlevel < 7.2 %}
- --card-mod-icon-color: red;
- --card-mod-icon: mdi:stop-circle-outline;
- --primary-text-color: red;
- {% elif phlevel > 7.2 and phlevel < 7.39 %}
- --card-mod-icon: mdi:sign-caution
- --card-mod-icon-color: yellow;
- {% elif phlevel > 7.4 and phlevel < 7.59 %}
- --card-mod-icon-color: green;
- {% elif phlevel >= 7.6 and phlevel <= 7.79 %}
- --card-mod-icon-color: yellow;
- {% elif phlevel >= 7.80 %}
- --card-mod-icon: mdi:alert;
- --card-mod-icon-color: yellow;
- --primary-text-color: yellow;
- {% else %}
- --card-mod-icon: mdi:head-question;
- --card-mod-icon-color: grey;
- --card-mod-text-color: red;
- --primary-text-color: red;
- --secondary-text-color: blue;
- {% endif %}
- }
- - type: custom:frigate-card
- cameras:
- - camera_entity: camera.rtsp
- view:
- dark_mode: 'on'
- menu:
- buttons:
- frigate:
- enabled: false
- live:
- enabled: false
- cameras:
- enabled: false
- camera_ui:
- enabled: true
- substreams:
- enabled: false
- style: none
- live:
- preload: true
- controls:
- builtin: false
- performance:
- features:
- animated_progress_indicator: false
- - type: custom:banner-card
- row_size: 3
- background: '#B0C2ED'
- heading:
- - mdi:shower
- - Bathroom
- color: red
- link: /lovelace/living_room
- entities:
- - entity: sensor.living_room_door_temperature
- name: Temp
- - type: custom:button-card
- show_name: true
- show_icon: true
- show_state: false
- entity: media_player.plex_plex_for_windows_desktop_p54jk04
- name: >-
- [[[ return
- states['media_player.plex_plex_for_windows_desktop_p54jk04'].state;
- ]]]
- icon: |
- [[[
- if (entity.state == "playing") return 'mdi:play';
- if (entity.state == "paused") return 'mdi:play-pause';
- else return 'mdi:stop';
- ]]]
- - type: custom:button-card
- entity: person.derek
- aspect_ratio: 1/1
- name: Person
- show_entity_picture: true
- show_name: false
- hold_action:
- action: none
- state:
- - value: home
- styles:
- custom_fields:
- icon:
- - border-color: '#77c66e'
- - value: not_home
- styles:
- card:
- - background-color: '#dedede'
- custom_fields:
- icon:
- - border-color: deepskyblue
- styles:
- card:
- - background-color: white
- - border-radius: 5%
- - padding: 5%
- - color: gray
- - font-size: 10px
- - text-shadow: 0px 0px 0px black
- - text-transform: capitalize
- - justify-self: end
- - align-self: middle
- grid:
- - grid-template-areas: '"icon status" "n n" "battery proximity" "wifi ss" "sd sd"'
- - grid-template-columns: 2fr 1fr
- - grid-template-rows: 1fr min-content min-content min-content min-content
- name:
- - font-size: 15px
- - align-self: middle
- - justify-self: start
- - padding-bottom: 10px
- custom_fields:
- icon:
- - clip-path: circle()
- - width: 80%
- - pointer-events: none
- - display: grid
- - border: 5px solid
- - border-color: gray
- - border-radius: 500px
- - margin: 0 +10% 0 0
- - justify-self: end
- - opacity: 1
- status:
- - align-self: start
- - justify-self: end
- - color: gray
- proximity:
- - padding: 0.5em 0px
- - align-self: middle
- - justify-self: start
- - color: gray
- wifi:
- - padding: 0.5em 0px
- - align-self: middle
- - justify-self: start
- - color: gray
- - '--text-wifi-color-sensor': >-
- [[[ if (states["person.derek"].attributes.wifi_on == 'false')
- return "#aaaaaa"; ]]]
- battery:
- - padding: 0.5em 0px
- - align-self: middle
- - justify-self: start
- - color: gray
- - '--text-color-sensor': >-
- [[[ if (states["person.derek"].attributes.battery_level < 50)
- return "#EF4F1A"; ]]]
- custom_fields:
- icon: >
- [[[ return entity === undefined ? null : `<img
- src="https://frazhome.zapto.org/local/alex.png" width="100%">`; ]]]
- status: |
- [[[
- if (states['person.derek'].state =='not_home') {
- return `<ha-icon icon="mdi:home-export-outline"
- style="width: 20px; height: 20px; color: '#888888';">
- </ha-icon><span> Away</span>`;
- }
- if (states['person.derek'].state =='home') {
- return `<ha-icon
- icon="mdi:home"
- style="width: 20px; height: 20px; color: 888888;">
- </ha-icon><span> ${entity.state}</span>`;
- } else {
- return `<ha-icon
- icon="mdi:map-marker-radius"
- style="width: 20px; height: 20px; color: 888888;">
- </ha-icon><span> ${entity.state}</span>`;
- }
- ]]]
- battery: |
- [[[
- if (states['person.derek'].attributes.battery_charging =='true') {
- return `<ha-icon
- icon="mdi:battery-charging"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['person.derek'].attributes.battery_level}% battery</span></span>`;
- } else {
- return `<ha-icon
- icon="mdi:battery"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['person.derek'].attributes.battery_level}% battery</span></span>`;
- }
- ]]]
- wifi: |
- [[[
- if (states['person.derek'].attributes.wifi_on =='false') {
- return `<ha-icon
- icon="mdi:wifi"
- style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
- </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`;
- } else {
- return `<ha-icon
- icon="mdi:wifi"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['person.derek'].attributes.wifi_on}</span></span>`;
- }
- ]]]
- - type: custom:button-card
- entity: person.derek
- aspect_ratio: 1/1
- name: Person
- show_entity_picture: true
- show_name: false
- hold_action:
- action: none
- state:
- - value: home
- styles:
- custom_fields:
- icon:
- - border-color: '#77c66e'
- - value: not_home
- styles:
- card:
- - background-color: '#dedede'
- custom_fields:
- icon:
- - border-color: '#EF4F1A'
- - value: Work
- styles:
- custom_fields:
- icon:
- - border-color: deepskyblue
- styles:
- card:
- - background-color: transparent
- - border-radius: 5%
- - padding: 5%
- - color: gray
- - font-size: 10px
- - text-shadow: 0px 0px 0px black
- - text-transform: capitalize
- - justify-self: end
- - align-self: middle
- - width: 200px
- - height: 200px
- grid:
- - grid-template-areas: '"icon icon" "n n" "battery status" "s s" "wifi steps" "sd sd"'
- - grid-template-columns: 1fr 1fr
- - grid-template-rows: 1fr min-content min-content min-content min-content
- name:
- - font-size: 15px
- - align-self: middle
- - justify-self: start
- - padding-bottom: 10px
- custom_fields:
- icon:
- - clip-path: circle()
- - width: 60%
- - pointer-events: none
- - display: grid
- - border: 5px solid
- - border-color: gray
- - border-radius: 500px
- - margin: 0 15% 0 0
- - justify-self: end
- - opacity: 1
- status:
- - padding: 0.5em
- - align-self: middle
- - justify-self: right
- - color: gray
- steps:
- - padding: 0.5em
- - align-self: middle
- - justify-self: right
- - color: gray
- wifi:
- - padding: 0.5em 0px
- - align-self: middle
- - justify-self: start
- - color: gray
- - '--text-wifi-color-sensor': >-
- [[[ if (states["sensor.s22_ultra_wifi_connection"].state ==
- '<not connected>') return "#aaaaaa"; ]]]
- battery:
- - padding: 0.5em 0px
- - align-self: middle
- - justify-self: start
- - color: gray
- - '--text-color-sensor': >-
- [[[ if (states["sensor.s22_ultra_battery_level"].state < 50)
- return "#EF4F1A"; ]]]
- custom_fields:
- icon: >
- [[[ return entity === undefined ? null : `<img
- src="${states[entity.entity_id].attributes.entity_picture}"
- width="100%">`; ]]]
- status: |
- [[[
- if (states['person.derek'].state =='not_home') {
- return `<ha-icon icon="mdi:home-export-outline"
- style="width: 20px; height: 20px; color: '#888888';">
- </ha-icon><span> Away</span>`;
- }
- if (states['person.derek'].state =='home') {
- return `<ha-icon
- icon="mdi:home"
- style="width: 20px; height: 20px; color: 888888;">
- </ha-icon><span> ${entity.state}</span>`;
- } else {
- return `<ha-icon
- icon="mdi:map-marker-radius"
- style="width: 20px; height: 20px; color: 888888;">
- </ha-icon><span> ${entity.state}</span>`;
- }
- ]]]
- steps: |
- [[[
- return `<ha-icon
- icon="mdi:walk"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span>\<span style="color: var(--text-color-sensor);">${parseInt(states['sensor.watch5_daily_steps'].state)} steps</span></span>`
- ]]]
- battery: |
- [[[
- if (states['sensor.s22_ultra_battery_state'].state =='charging') {
- return `<ha-icon
- icon="mdi:battery-charging"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.s22_ultra_battery_level'].state}% battery</span></span>`;
- } else {
- return `<ha-icon
- icon="mdi:battery"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.s22_ultra_battery_level'].state}% battery</span></span>`;
- }
- ]]]
- wifi: |
- [[[
- if (states['sensor.s22_ultra_wifi_connection'].state =='<not connected>') {
- return `<ha-icon
- icon="mdi:wifi"
- style="width: 20px; height: 20px; color: var(--text-wifi-color-sensor);">
- </ha-icon> <span><span style="color: var(--text-wifi-color-sensor);">Disconnected</span></span>`;
- } else {
- return `<ha-icon
- icon="mdi:wifi"
- style="width: 20px; height: 20px; color: #888888;">
- </ha-icon> <span><span style="color: var(--text-color-sensor);">${states['sensor.s22_ultra_wifi_connection'].state}</span></span>`;
- }
- ]]]
- - type: custom:button-card
- entity: sensor.s22_ultra_battery_level
- show_state: true
- variables:
- var_color: |-
- [[[
- var percentage = entity.state;
- var r = 0; var g = 0; var b = 0;
- if (percentage < 50 ) {
- var r = 255;
- var g = parseInt(5.1 * percentage);
- } else {
- var g = 255;
- var r = parseInt(510 - 5.10 * percentage);
- }
- var h = r * 0x10000 + g * 0x100 + b * 0x1;
- return '#' + ('000000' + h.toString(16)).slice(-6);
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- card:
- - height: 200px
- - width: 200px
- - type: grid
- cards:
- - type: gauge
- entity: sensor.s22_ultra_battery_level
- min: 0
- max: 100
- segments:
- - from: 0
- color: var(--gauge-gradient)
- needle: true
- card_mod:
- style: >
- :host { --gauge-gradient: url("data:image/svg+xml,%3Csvg
- xmlns='http://www.w3.org/2000/svg' width='100'
- height='100'%3E%3Cdefs%3E%3ClinearGradient id='linear' x1='0%25'
- y1='0%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25'
- stop-color='red'/%3E%3Cstop offset='50%25'
- stop-color='yellow'/%3E%3Cstop offset='100%25'
- stop-color='green'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E#linear");
- }
- - type: gauge
- entity: sensor.s22_ultra_battery_level
- min: 0
- max: 100
- segments:
- - from: 0
- color: var(--gauge-gradient)
- needle: true
- card_mod:
- style: |
- :host { --gauge-gradient: {% set percentage = 87 | int %}
- {% set r, g, b = 0, 0, 0 %}
- {% if (percentage <= 51) %}
- {% set r = 255 %}
- {% set g = (5.0 * percentage) | round | int %}
- {% else %}
- {% set g = 255 %}
- {% set r = (505 - 4.89 * percentage) | round | int %}
- {% endif %}
- {{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
- - type: gauge
- entity: sensor.s22_ultra_battery_level
- min: 0
- max: 100
- needle: true
- segments:
- - from: 0
- color: '#57bb8a'
- - from: 5
- color: '#63b682'
- - from: 10
- color: '#73b87e'
- - from: 15
- color: '#84bb7b'
- - from: 20
- color: '#94bd77'
- - from: 25
- color: '#a4c073'
- - from: 30
- color: '#b0be6e'
- - from: 35
- color: '#c4c56d'
- - from: 40
- color: '#d4c86a'
- - from: 45
- color: '#e2c965'
- - from: 50
- color: '#f5ce62'
- - from: 55
- color: '#f3c563'
- - from: 60
- color: '#e9b861'
- - from: 65
- color: '#e6ad61'
- - from: 70
- color: '#ecac67'
- - from: 75
- color: '#e9a268'
- - from: 80
- color: '#e79a69'
- - from: 85
- color: '#e5926b'
- - from: 90
- color: '#e2886c'
- - from: 90
- color: '#e0816d'
- - from: 100
- color: '#dd776e'
- - type: gauge
- entity: sensor.s22_ultra_battery_level
- name: Red-to-green
- min: 0
- max: 100
- needle: true
- segments:
- - from: 0
- color: '#FF0000'
- - from: 3
- color: '#FF1100'
- - from: 7
- color: '#FF2200'
- - from: 10
- color: '#FF3300'
- - from: 13
- color: '#FF4400'
- - from: 17
- color: '#FF5500'
- - from: 20
- color: '#FF6600'
- - from: 23
- color: '#FF7700'
- - from: 27
- color: '#FF8800'
- - from: 30
- color: '#FF9900'
- - from: 33
- color: '#FFAA00'
- - from: 37
- color: '#FFBB00'
- - from: 40
- color: '#FFCC00'
- - from: 43
- color: '#FFDD00'
- - from: 47
- color: '#FFEE00'
- - from: 50
- color: '#FFFF00'
- - from: 53
- color: '#EEFF00'
- - from: 57
- color: '#DDFF00'
- - from: 60
- color: '#CCFF00'
- - from: 63
- color: '#BBFF00'
- - from: 67
- color: '#AAFF00'
- - from: 70
- color: '#99FF00'
- - from: 73
- color: '#88FF00'
- - from: 77
- color: '#77FF00'
- - from: 80
- color: '#66FF00'
- - from: 83
- color: '#55FF00'
- - from: 87
- color: '#44FF00'
- - from: 90
- color: '#33FF00'
- - from: 93
- color: '#22FF00'
- - from: 97
- color: '#11FF00'
- - from: 100
- color: '#00FF00'
- - type: gauge
- entity: sensor.s22_ultra_battery_level
- name: Green-to-red
- min: 0
- max: 100
- needle: true
- segments:
- - from: 0
- color: '#00FF00'
- - from: 3
- color: '#11FF00'
- - from: 7
- color: '#22FF00'
- - from: 10
- color: '#33FF00'
- - from: 13
- color: '#44FF00'
- - from: 17
- color: '#55FF00'
- - from: 20
- color: '#66FF00'
- - from: 23
- color: '#77FF00'
- - from: 27
- color: '#88FF00'
- - from: 30
- color: '#99FF00'
- - from: 33
- color: '#AAFF00'
- - from: 37
- color: '#BBFF00'
- - from: 40
- color: '#CCFF00'
- - from: 43
- color: '#DDFF00'
- - from: 47
- color: '#EEFF00'
- - from: 50
- color: '#FFFF00'
- - from: 53
- color: '#FFEE00'
- - from: 57
- color: '#FFDD00'
- - from: 60
- color: '#FFCC00'
- - from: 63
- color: '#FFBB00'
- - from: 67
- color: '#FFAA00'
- - from: 70
- color: '#FF9900'
- - from: 73
- color: '#FF8800'
- - from: 77
- color: '#FF7700'
- - from: 80
- color: '#FF6600'
- - from: 83
- color: '#FF5500'
- - from: 87
- color: '#FF4400'
- - from: 90
- color: '#FF3300'
- - from: 93
- color: '#FF2200'
- - from: 97
- color: '#FF1100'
- - from: 100
- color: '#FF0000'
- - type: custom:button-card
- entity: light.office1
- name: Office
- icon: mdi:wall-sconce-flat
- styles:
- card:
- - height: 100px
- icon:
- - width: 25%
- name:
- - padding: 5px 0px
- - font-size: 15px
- - text-overflow: unset
- - white-space: unset
- - word-break: break-word
- state:
- - value: 'on'
- color: yellow
- - value: 'off'
- styles:
- icon:
- - opacity: 0.5
- - type: entities
- entities:
- - entity: light.living_room1
- type: custom:multiple-entity-row
- name: One entity
- secondary_info: last-changed
- entities:
- - sensor.bedroom_max_temp
- icon: >
- [[[ return `<ha-icon icon="mdi:circle-small" style="width: 25px;
- height:25px;"> </ha-icon>`; ]]]
- - entity: light.hallway
- name: Entity card using one state
- type: custom:multiple-entity-row
- secondary_info: last-changed
- toggle: true
- card_mod:
- style: |-
- :host {
- {% if is_state('light.hallway', 'off') %}
- --card-mod-icon: mdi:light-switch-off;
- --card-mod-icon-color: red;
- {% else %}
- --card-mod-icon: mdi:light-switch;
- --card-mod-icon-color: green;
- {% endif %}
- }
- - type: custom:button-card
- entity: light.bedroom1
- template:
- - onstate
- - offstate
- - path: mushroom
- icon: mdi:mushroom
- theme: Derek Dark Theme
- badges: []
- cards:
- - type: vertical-stack
- title: Mushroom light card with brightness control
- cards:
- - type: custom:mushroom-light-card
- entity: light.living_room_lights
- fill_container: false
- use_light_color: true
- show_brightness_control: true
- show_color_control: false
- show_color_temp_control: false
- collapsible_controls: true
- layout: horizontal
- card_mod:
- style: |
- mushroom-chips-card {
- --ha-card-background: transparent;}
- - type: custom:mushroom-chips-card
- chips:
- - type: entity
- entity: person.derek
- - type: entity
- entity: sensor.s22_ultra_battery_level
- use_entity_picture: false
- - type: entity
- entity: input_boolean.guest_mode
- double_tap_action:
- action: more-info
- name: Guest
- use_entity_picture: false
- content_info: name
- icon_color: green
- tap_action:
- action: toggle
- card_mod:
- style: |
- ha-card {
- {% if states('input_boolean.guest_mode') == 'on' %}
- --card-mod-icon-color: green;
- {% elif states('input_boolean.guest_mode') == 'off' %}
- --card-mod-icon-color: red;
- {% endif %}
- }
- - type: custom:mushroom-chips-card
- chips:
- - type: entity
- entity: person.derek
- - type: template
- content: |-
- {% if states.light | selectattr('state', 'eq', 'on')
- | map(attribute='entity_id') | map('area_name')
- | select('in', ['Living Room'])
- | list | count == 0 %}
- {0}
- {%else %}
- {{states.light | selectattr('state', 'eq', 'on')
- | map(attribute='entity_id') | map('area_name')
- | select('in', ['Living Room'])
- | list | count}}
- {%- endif %}
- icon: mdi:lightbulb
- icon_color: |-
- {% if (states.light | selectattr('state', 'eq', 'on')
- | map(attribute='entity_id') | map('area_name')
- | select('in', ['Living Room'])
- | list | count) >= 1 -%}
- yellow
- {%- else -%}
- white
- {%- endif %}
- hold_action:
- action: call-service
- service: light.turn_off
- service_data: {}
- target:
- area_id: living_room
- - type: template
- entity: input_boolean.guest_mode
- content: Guest Mode
- icon: mdi:home
- icon_color: |
- {{ (states(entity)=="on") | iif("green", "red") }}
- press_action:
- action: toggle
- - type: vertical-stack
- title: Icon based on charging state (chip)
- cards:
- - type: custom:mushroom-chips-card
- chips:
- - type: template
- entity: sensor.fire_computer_desk_battery_level
- content: '{{ states(''sensor.fire_computer_desk_battery_level'') }} %'
- icon: >
- {{
- (states("binary_sensor.fire_computer_desk_plugged_in")=="off")
- | iif("mdi:tablet-dashboard", "mdi:flash") }}
- icon_color: >-
- {{ is_state('binary_sensor.fire_computer_desk_plugged_in',
- 'on') | iif('yellow', 'gray') }}
- - type: vertical-stack
- title: Icon based on charging state (mushroom)
- cards:
- - type: custom:mushroom-template-card
- entity: sensor.fire_computer_desk_battery_level
- primary: '{{ states("sensor.fire_computer_desk_battery_level") }} %'
- icon: >-
- {{ is_state('binary_sensor.fire_computer_desk_plugged_in', 'on') |
- iif('mdi:battery', 'mdi:power-plug') }}
- icon_color: >-
- {{ is_state('binary_sensor.fire_computer_desk_plugged_in', 'on')
- | iif('red', 'green') }}
- - type: custom:mushroom-template-card
- primary: Hello, {{user}}
- secondary: How are you?
- icon: mdi:home
- card_mod:
- style: |
- :host {
- --mush-icon-size: 50px;
- }
- ha-card {
- --card-primary-font-size: 15px;
- --card-secondary-font-size: 10px;
- }
- mushroom-shape-icon {
- --shape-color: none !important;
- --shape-color-disabled: none !important;
- }
- - type: vertical-stack
- title: Mushroom template card with colors based on battery level
- cards:
- - type: custom:mushroom-template-card
- entity: sensor.s22_ultra_battery_level
- primary: S22
- secondary: >-
- {{ states(entity) }} {{ state_attr(entity, "unit_of_measurement")
- }}
- icon: |
- {% set state = (states(entity) | int) %}
- {% if state >= 75 %} mdi:battery-90
- {% elif state >= 33 %} mdi:battery-40
- {% else %} mdi:battery-10
- {% endif %}
- icon_color: |
- {% set state = (states(entity) | int) %}
- {% if state >= 90 %} green
- {% elif state >= 70 %} light-green
- {% elif state >= 50 %} orange
- {% elif state >= 30 %} yellow
- {% else %} red
- {% endif %}
- tap_action:
- action: none
- hold_action:
- action: none
- double_tap_action:
- action: none
- - type: vertical-stack
- title: Swipe card (auto scrolling)
- cards:
- - type: custom:swipe-card
- parameters:
- autoHeight: false
- initialSlide: 1
- centeredSlides: true
- effect: cards
- loop: false
- followfinger: true
- autoplay:
- delay: 3000
- cards:
- - type: custom:mushroom-chips-card
- chips:
- - type: action
- tap_action:
- action: navigate
- navigation_path: /lovelace/WoonKamer
- icon: mdi:sofa
- icon_color: deep-purple
- style: |
- ha-card {
- --chip-height: 50px;
- }
- - type: action
- icon: mdi:door-closed
- tap_action:
- action: navigate
- navigation_path: /lovelace/gang
- icon_color: brown
- style: |
- ha-card {
- --chip-height: 50px;
- }
- - type: action
- icon: mdi:cctv
- icon_color: white
- tap_action:
- action: navigate
- navigation_path: /lovelace/Camera
- style: |
- ha-card {
- --chip-height: 50px;
- }
- - type: custom:mushroom-chips-card
- chips:
- - type: entity
- entity: person.derek
- use_entity_picture: true
- card_mod:
- style: |
- ha-card {
- border: unset;
- --chip-background: none
- --chip-font-size: 0.4em;
- --chip-padding: 0 0.3em;
- --chip-box-shadow: none;
- - type: entity
- entity: sensor.s22_ultra_battery_level
- use_entity_picture: false
- - type: template
- entity: input_boolean.guest_mode
- content: Guest Mode
- icon: >
- {{ (states(entity)=="on") | iif("mdi:home",
- "mdi:home-off-outline") }}
- icon_color: |
- {{ (states(entity)=="on") | iif("green", "red") }}
- press_action:
- action: toggle
- - type: template
- entity: input_boolean.automation_override
- content: Automations
- icon: >
- {{ (states(entity)=="off") | iif("mdi:lightbulb-auto",
- "mdi:lightbulb-auto-outline") }}
- icon_color: |
- {{ (states(entity)=="off") | iif("green", "red") }}
- press_action:
- action: toggle
- hold_action:
- action: navigate
- navigation_path: /fire-main/automations
- - type: template
- entity: input_boolean.automation_interior_motion_detectors
- content: Motion Detectors
- icon: >
- {{ (states(entity)=="on") | iif("mdi:motion-sensor",
- "mdi:motion-sensor-off") }}
- icon_color: |
- {{ (states((entity))=="on") | iif("green", "red") }}
- press_action:
- action: toggle
- - type: conditional
- conditions:
- - entity: binary_sensor.living_room_motion_detector_on_off
- state: 'on'
- chip:
- type: template
- icon_color: red
- icon: mdi:motion-sensor
- card_mod:
- style: |
- ha-card {
- animation: blink 1s linear infinite;
- --chip-icon-size: 0.6em;
- }
- hold_action:
- action: navigate
- navigation_path: /fire-main/sensors
- - type: custom:mushroom-template-card
- primary: S22
- secondary: >-
- {{ states(entity) }} {{ state_attr(entity,
- "unit_of_measurement") }}
- icon: |
- {% set state = (states(entity) | int) %}
- {% if state >= 75 %} mdi:battery-90
- {% elif state >= 33 %} mdi:battery-40
- {% else %} mdi:battery-10
- {% endif %}
- entity: sensor.s22_ultra_battery_level
- icon_color: |
- {% set state = (states(entity) | int) %}
- {% set state = (80) %}
- {% if state >= 90 %} green
- {% elif state >= 70 %} lime
- {% elif state >= 40 %} orange
- {% elif state >= 30 %} yellow
- {% else %} red
- {% endif %}
- tap_action:
- action: none
- hold_action:
- action: none
- double_tap_action:
- action: none
- - type: vertical-stack
- title: Mushroom chip icon/color based on power usage
- cards:
- - type: custom:mushroom-chips-card
- chips:
- - type: template
- content: >
- {{ ((states("sensor.tv_plug_active_power") | int) > 5) |
- iif("TV is on", "TV is off") }}
- icon: >
- {{ ((states("sensor.tv_plug_active_power") | int) > 5) |
- iif("mdi:television", "mdi:television-off") }}
- icon_color: >
- {{ ((states("sensor.tv_plug_active_power") | int) > 5) |
- iif('green', 'red') }}
- - type: template
- entity: sensor.tv_plug_active_power
- content: >
- {{ ((states(entity) | int) > 5) | iif("TV is on", "TV is off")
- }}
- icon: |
- {{ ((states(entity) | int) > 5) | iif("mdi:television",
- "mdi:television-off") }}
- icon_color: |
- {{ ((states(entity) | int) > 5) | iif('green', 'red') }}
- tap_action:
- action: none
- hold_action:
- action: none
- double_tap_action:
- action: none
- - type: vertical-stack
- title: Mushroom chip styling (card_mod)
- cards:
- - type: custom:mushroom-chips-card
- chips:
- - type: entity
- entity: person.derek
- use_entity_picture: true
- card_mod:
- style: |
- ha-card {
- border: unset;
- --chip-box-shadow: none;
- --chip-background: none;
- --chip-font-size: 24px;
- --chip-padding: 0 0.3em;
- --text-color: red;
- --chip-height: 75px;
- --chip-border-radius: 45px;
- }
- - type: vertical-stack
- title: Mushroom template animation WIP
- cards:
- - type: custom:mushroom-template-card
- primary: Robot
- icon: mdi:robot-outline
- icon_color: deep-purple
- entity: input_boolean.tester
- card_mod:
- style:
- mushroom-shape-icon$: |
- ha-icon {
- --icon-animation: rotation 2s linear infinite
- }
- @keyframes rotation {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
- }
- .shape {
- --shape-animation: ping 2s infinite;
- }
- @keyframes ping {
- 60% { box-shadow: 0 0 0 0 rgba(var(--rgb-green), 0.7); }
- 100% { box-shadow: 0 0 5px 15px transparent; }
- }
- - type: custom:mushroom-template-card
- primary: Robot
- icon: mdi:robot-outline
- icon_color: deep-purple
- entity: input_boolean.tester
- card_mod:
- style: |
- ha-card {
- animation: rotation linear infinite;
- {% if states('input_boolean.guest_mode') == 'on' %}
- animation-duration: 3s;
- icon_color: green;
- {%- else -%}
- color: inherit;
- {%- endif %}
- }
- @keyframes rotation {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
- - type: custom:mushroom-template-card
- primary: Robot
- icon: mdi:robot-outline
- icon_color: deep-purple
- entity: input_boolean.tester
- card_mod:
- style: |
- ha-state-icon {
- animation: rotation linear infinite 3s;
- }
- @keyframes rotation {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg);}
- }
- - type: custom:mushroom-template-card
- primary: Robot
- icon: mdi:robot-outline
- icon_color: deep-purple
- entity: input_boolean.tester
- card_mod:
- style: |
- ha-state-icon {
- animation: rotation 3s linear infinite;
- }
- @keyframes rotation {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
- }
- - type: vertical-stack
- title: Mushroom multiline_secondary spacing
- cards:
- - type: custom:mushroom-template-card
- primary: Bedroom
- multiline_secondary: true
- secondary: >-
- {{ states('sensor.bedroom_temperature')|int }}°F {{
- states('sensor.bedroom_humidity')|int }}%
- - type: vertical-stack
- title: Custom last updated info
- cards:
- - type: custom:mushroom-template-card
- primary: 'Travel time: {{ states("sensor.waze_travel_time") }} minutes'
- secondary: >-
- Last updated: {% set t = ((as_timestamp(now()) -
- as_timestamp(states.sensor.waze_travel_time.last_updated)) | int)
- %} {% if t <= 10 %} Just now {% elif t <= 60 %} {{ t }}
- seconds {% elif t < 3600 %}
- {{ (t / 60) | int }} min {{ (t % 60) }} sec
- {% elif t >= 3600 %}
- {{ (t / 3600) | int }} hr {{ (t / 60) | int }} min {{ (t % 60) }} sec
- {% else %} error {% endif %}
- - type: custom:mushroom-template-card
- primary: 'Status: {{ states("light.living_room_lights") }}'
- secondary: >-
- {% set t = ((as_timestamp(now()) -
- as_timestamp(states.light.living_room_lights.last_changed)) | int)
- %}
- {% if t < 60 %}
- {% elif t < 3600 %} {{ (t / 60) | int }} min
- {% elif t >= 3600 %} {{ (t / 3600) | int }} hr {{ (t / 60) | int
- }} min
- {% else %} error
- {% endif %}
- - type: custom:mushroom-template-card
- entity: light.living_room1
- primary: 'Show attribute '
- secondary: '{{ state_attr("light.living_room1", "brightness") }}'
- icon: mdi:check
- icon_color: |-
- {% if states("light.living_room1") == "on" %}
- green
- {% else %}
- red
- {% endif %}
- tap_action:
- action: none
- hold_action:
- action: none
- double_tap_action:
- action: none
- badge_icon: mdi:home
- badge_color: green
- picture: ''
- card_mod:
- style: |
- ha-card {
- --ha-card-background: rgb(5, 48, 104);
- font-family: 'Comfortaa';
- filter:
- drop-shadow(2.5px 2.5px 0.125rem rgb(48, 48, 51));
- }
- - type: custom:mushroom-template-card
- primary: Hello, {{ user }} !
- secondary: '{{ states("sensor.time") }}'
- fill_container: false
- multiline_secondary: false
- card_mod:
- style: |
- :host {
- --primary-text-color: red;
- --secondary-text-color: red;
- --ha-card-background: transparent;
- --ha-card-border-width: 0;
- text-align: center;
- --card-primary-font-size: 26px !important;
- --card-secondary-font-size: 18px !important;
- font-family: 'Comfortaa';
- }
- - type: vertical-stack
- cards:
- - type: custom:mushroom-template-card
- entity: person.derek
- primary: '{{ state_attr(entity, "friendly_name").upper() }}'
- secondary: '{{ states(entity).capitalize() }}'
- layout: vertical
- icon: mdi:check
- icon_color: |-
- {% if states("person.derek").lower() == "home" %}
- green
- {% else %}
- red
- {% endif %}
- - type: custom:mushroom-entity-card
- entity: person.derek
- primary: '{{ entity }}'
- secondary: '{{ states(entity) }}'
- layout: vertical
- icon: mdi:check
- card_mod:
- style: |
- :host {
- --mush-icon-size: 60px;
- --card-primary-font-size: 30px !important;
- --card-secondary-font-size: 10px !important;
- }
- mushroom-shape-icon {
- --shape-color: red !important;
- --shape-color-disabled: none !important;}
- }
- - type: custom:mushroom-template-card
- entity: sensor.s22_ultra_battery_level
- primary: '{{ state_attr(entity, "friendly_name").title() }}'
- secondary: '{{ states(entity) + "%" }}'
- layout: vertical
- icon: >
- {% set battery_level = states(entity) | int // 10 * 10 %}
- {% set charging_state = states('sensor.s22_ultra_charger_type')
- %}
- {% set is_charging =
- is_state('binary_sensor.s22_ultra_is_charging', 'on') | iif(True,
- False) %}
- {% set map = {"none":"",
- "ac":"charging-","wireless":"charging-wireless-"} %}
- {% set charging = map[states('sensor.s22_ultra_charger_type')] %}
- {% if battery_level == 100 and is_charging == True %}
- mdi:battery-charging
- {% elif battery_level == 100 %} mdi:battery
- {% elif battery_level >= 10 %}
- mdi:battery-{{charging}}{{battery_level}}
- {% elif battery_level >= 0 %} mdi:battery-{{charging}}outline
- {% else %} mdi:battery-unknown
- {% endif %}
- icon_color: |-
- {% set percentage = states(entity) | int %}
- {% set r, g, b = 0, 0, 0 %}
- {% if (percentage <= 51) %}
- {% set r = 255 %}
- {% set g = (5.0 * percentage) | round | int %}
- {% else %}
- {% set g = 255 %}
- {% set r = (505 - 4.89 * percentage) | round | int %}
- {% endif %}
- {{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
- - type: custom:button-card
- show_entity_picture: true
- state:
- - value: 'on'
- icon: mdi:garage-open
- color: red
- label: Open
- - value: 'off'
- icon: mdi:garage-lock
- color: green
- label: Closed
- tap_action:
- action: toggle
- entity: input_boolean.tester
- show_state: false
- show_label: true
- size: 20%
- label: |
- [[[
- if (entity.state === "on")
- return "closed";
- else if (entity.state === "off")
- return "open";
- ]]]
- - type: custom:mushroom-template-card
- entity: input_boolean.tester
- secondary: >-
- Last changed: {% set t = ((as_timestamp(now()) -
- as_timestamp(states.input_boolean.tester.last_updated)) | int) %} {%
- if t <= 10 %} Just now {% elif t <= 60 %} {{ t }} seconds {% elif t
- < 3600 %}
- {{ (t / 60) | int }} min {{ (t % 60) }} sec
- {% elif t >= 3600 %}
- {{ (t / 3600) | int }} hr {{ (t / 60) | int }} min {{ (t % 60) }} sec
- {% else %} error {% endif %}
- primary: '{{ ''Stop drumming'' if states(entity) == ''on'' else ''Start drumming'' }}'
- icon: >-
- {{ 'mdi:music-box' if states(entity) == 'on' else
- 'mdi:music-box-outline' }}
- icon_color: '{{ ''green'' if states(entity) == ''on'' else ''red'' }}'
- tap_action:
- action: call-service
- service: automation.trigger
- service_data:
- entity_id: >
- {{ (states(entity)=="on") | iif("automation.test_automation",
- "automation.test_automation") }}
- double_tap_action:
- action: call-service
- service: automation.trigger
- service_data:
- entity_id: >
- {{ "automation.test_automation" if
- is_state("input_boolean.tester", 'on') else
- "automation.test_automation" }}
- - type: custom:button-card
- show_entity_picture: true
- entity: binary_sensor.shelly1_98cdac0ce253_input
- name: Call service - different entity
- state:
- - value: 'off'
- icon: mdi:garage-open
- color: rgba(146,107,199,255)
- - value: 'on'
- icon: mdi:garage
- color: rgba(68,115,158,255)
- tap_action:
- action: call-service
- service: switch.toggle
- service_data:
- entity_id: switch.shelly1_98cdac0ce253
- show_state: false
- - type: grid
- columns: 4
- cards:
- - type: custom:mushroom-template-card
- entity: sensor.s22_ultra_battery_level
- primary: S22
- secondary: 25%
- layout: vertical
- icon: mdi:battery-20
- icon_color: |-
- {% set percentage = states(entity) | int %}
- {% set percentage = 25 | int %}
- {% set r, g, b = 0, 0, 0 %}
- {% if (percentage <= 51) %}
- {% set r = 255 %}
- {% set g = (5.0 * percentage) | round | int %}
- {% else %}
- {% set g = 255 %}
- {% set r = (505 - 4.89 * percentage) | round | int %}
- {% endif %}
- {{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
- - type: custom:mushroom-template-card
- entity: sensor.s22_ultra_battery_level
- primary: S22
- secondary: 50%
- layout: vertical
- icon: mdi:battery-charging-50
- icon_color: |-
- {% set percentage = states(entity) | int %}
- {% set percentage = 50 | int %}
- {% set r, g, b = 0, 0, 0 %}
- {% if (percentage <= 51) %}
- {% set r = 255 %}
- {% set g = (5.0 * percentage) | round | int %}
- {% else %}
- {% set g = 255 %}
- {% set r = (505 - 4.89 * percentage) | round | int %}
- {% endif %}
- {{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
- - type: custom:mushroom-template-card
- entity: sensor.s22_ultra_battery_level
- primary: S22
- secondary: 75%
- layout: vertical
- icon: mdi:battery-charging-wireless-70
- icon_color: |-
- {% set percentage = states(entity) | int %}
- {% set percentage = 75 | int %}
- {% set r, g, b = 0, 0, 0 %}
- {% if (percentage <= 51) %}
- {% set r = 255 %}
- {% set g = (5.0 * percentage) | round | int %}
- {% else %}
- {% set g = 255 %}
- {% set r = (505 - 4.89 * percentage) | round | int %}
- {% endif %}
- {{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
- - type: custom:mushroom-template-card
- entity: sensor.s22_ultra_battery_level
- primary: S22
- secondary: 100%
- layout: vertical
- icon: mdi:battery-charging
- icon_color: |-
- {% set percentage = states(entity) | int %}
- {% set percentage = 100 | int %}
- {% set r, g, b = 0, 0, 0 %}
- {% if (percentage <= 51) %}
- {% set r = 255 %}
- {% set g = (5.0 * percentage) | round | int %}
- {% else %}
- {% set g = 255 %}
- {% set r = (505 - 4.89 * percentage) | round | int %}
- {% endif %}
- {{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
- - square: true
- type: grid
- columns: 4
- cards:
- - type: custom:button-card
- entity: sensor.s22_ultra_battery_level
- name: S22
- state_display: 25 %
- icon: mdi:battery-20
- show_state: true
- variables:
- var_color: |-
- [[[
- var percentage = entity.state;
- var percentage = 25;
- var r = 0; var g = 0; var b = 0;
- if (percentage < 50 ) {
- var r = 255;
- var g = parseInt(5.1 * percentage);
- } else {
- var g = 255;
- var r = parseInt(510 - 5.10 * percentage);
- }
- var h = r * 0x10000 + g * 0x100 + b * 0x1;
- return '#' + ('000000' + h.toString(16)).slice(-6);
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- - type: custom:button-card
- entity: sensor.s22_ultra_battery_level
- name: S22
- state_display: 50 %
- icon: mdi:battery-charging-50
- show_state: true
- variables:
- var_color: |-
- [[[
- var percentage = entity.state;
- var percentage = 50;
- var r = 0; var g = 0; var b = 0;
- if (percentage < 50 ) {
- var r = 255;
- var g = parseInt(5.1 * percentage);
- } else {
- var g = 255;
- var r = parseInt(510 - 5.10 * percentage);
- }
- var h = r * 0x10000 + g * 0x100 + b * 0x1;
- return '#' + ('000000' + h.toString(16)).slice(-6);
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- - type: custom:button-card
- entity: sensor.s22_ultra_battery_level
- name: S22
- state_display: 75 %
- icon: mdi:battery-charging-wireless-70
- show_state: true
- variables:
- var_color: |-
- [[[
- var percentage = entity.state;
- var percentage = 75;
- var r = 0; var g = 0; var b = 0;
- if (percentage < 50 ) {
- var r = 255;
- var g = parseInt(5.1 * percentage);
- } else {
- var g = 255;
- var r = parseInt(510 - 5.10 * percentage);
- }
- var h = r * 0x10000 + g * 0x100 + b * 0x1;
- return '#' + ('000000' + h.toString(16)).slice(-6);
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- - type: custom:button-card
- entity: sensor.s22_ultra_battery_level
- name: S22
- state_display: 100 %
- icon: mdi:battery-charging
- show_state: true
- variables:
- var_color: |-
- [[[
- var percentage = entity.state;
- var percentage = 100;
- var r = 0; var g = 0; var b = 0;
- if (percentage < 50 ) {
- var r = 255;
- var g = parseInt(5.1 * percentage);
- } else {
- var g = 255;
- var r = parseInt(510 - 5.10 * percentage);
- }
- var h = r * 0x10000 + g * 0x100 + b * 0x1;
- return '#' + ('000000' + h.toString(16)).slice(-6);
- ]]]
- styles:
- icon:
- - color: '[[[ return variables.var_color ]]]'
- - theme: Derek Dark Theme
- icon: mdi:video-vintage
- type: panel
- visible:
- - user: 533e51fcaca94bfbbc41b474e0b127af
- - user: f1ff35aa97074588beee1542d27c4d95
- badges: []
- cards:
- - type: custom:plex-meets-homeassistant
- protocol: http
- sort: ''
- playTrailer: false
- showExtras: false
- showSearch: false
- ip: 10.10.10.6
- token: iG5A9nVLfa-6Zyh3s6wN
- port: '32400'
- entity:
- cast: media_player.plex_plex_for_windows_desktop_p54jk04
- libraryName: Deck
- maxCount: '20'
- maxRows: ''
- useHorizontalScroll: 'Yes'
- useShuffle: 'No'
- displayTitleMain: 'Yes'
- displaySubtitleMain: 'Yes'
- minWidth: ''
- minEpisodeWidth: ''
- minExpandedWidth: ''
- fontSize1: ''
- fontSize2: ''
- fontSize3: ''
- fontSize4: ''
- minExpandedHeight: ''
- title: Plex
- runBefore: ''
- runAfter: ''
Advertisement
Add Comment
Please, Sign In to add comment