For the life of me I canāt seem to change the color of the background on the custom layout card that contains the other cards within it. Feels like Iām missing something very simple but Iāve spent hours with no luck. Anyone have any idea what Iām doing wrong? Excuse the poor mark-up, Iām working off a laptop.
- title: test
type: custom:horizontal-layout
cards:
- type: custom:layout-card
layout_type: custom:masonry-layout
layout:
width: 150
max_cols: 2
cards:
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: Main Gym Door
secondary: |-
{% if is_state('binary_sensor.main_gym_door','on') %}
Door Open
{% elif is_state('lock.main_gym','unlocked') %}
Unlocked
{% else %}
Locked
{% endif%}
icon: |-
{% if is_state('binary_sensor.main_gym_door','on') %}
mdi:door-open
{% elif is_state('lock.main_gym','unlocked') %}
mdi:lock-open
{% else %}
mdi:lock
{% endif%}
icon_color: >-
{% if is_state('lock.main_gym','locked') and
is_state('binary_sensor.main_gym_door','off') %}
red
{% elif is_state('binary_sensor.main_gym_door','on') %}
yellow
{% else %}
green
{% endif%}
badge_icon: >-
{% set battery_level = (states('sensor.main_gym_battery') |
int / 10) | round(0) | int * 10 %} {% if battery_level == 100
%} mdi:battery {% elif battery_level > 0 %} mdi:battery-{{
battery_level }} {% else %} mdi:battery-alert-variant-outline
{% endif %}
badge_color: >-
{% set battery_level = states('sensor.main_gym_battery') | int
%}
{% if battery_level > 90 %} green
{% elif battery_level > 60 %} light-green
{% elif battery_level > 50 %} lime
{% elif battery_level > 40 %} yellow
{% elif battery_level > 30 %} amber
{% elif battery_level > 20 %} orange
{% elif battery_level > 10 %} deep-orange
{% else %} red
{% endif %}
tap_action:
action: more-info
entity: sensor.main_gym_battery
layout: vertical
- type: custom:mushroom-lock-card
entity: lock.main_gym
name: Main Gym Door
primary_info: none
secondary_info: none
icon_type: none
card_mod:
style: |
ha-card {
{% if is_state('lock.main_gym','locked') and
is_state('binary_sensor.main_gym_door', 'off') %}
background: rgba(145,2,2,0.5);
{% elif is_state('binary_sensor.main_gym_door', 'on') %}
background: rgba(130,130,0,0.5);
{% else %}
background: rgba(2,61,2,0.5);
{% endif %}
}
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: Main Front Door
secondary: |-
{% if is_state('binary_sensor.main_front_door_door','on') %}
Door Open
{% elif is_state('lock.main_front_door','unlocked') %}
Unlocked
{% else %}
Locked
{% endif%}
icon: |-
{% if is_state('binary_sensor.main_front_door_door','on') %}
mdi:door-open
{% elif is_state('lock.main_front_door','unlocked') %}
mdi:lock-open
{% else %}
mdi:lock
{% endif%}
icon_color: >-
{% if is_state('lock.main_front_door','locked') and
is_state('binary_sensor.main_front_door_door','off') %}
red
{% elif is_state('binary_sensor.main_front_door_door','on') %}
yellow
{% else %}
green
{% endif%}
badge_icon: >-
{% set battery_level =
(states('sensor.main_front_door_battery') | int / 10) |
round(0) | int * 10 %} {% if battery_level == 100 %}
mdi:battery {% elif battery_level > 0 %} mdi:battery-{{
battery_level }} {% else %} mdi:battery-alert-variant-outline
{% endif %}
badge_color: >-
{% set battery_level =
states('sensor.main_front_door_battery') | int %}
{% if battery_level > 90 %} green
{% elif battery_level > 60 %} light-green
{% elif battery_level > 50 %} lime
{% elif battery_level > 40 %} yellow
{% elif battery_level > 30 %} amber
{% elif battery_level > 20 %} orange
{% elif battery_level > 10 %} deep-orange
{% else %} red
{% endif %}
tap_action:
action: more-info
entity: sensor.main_front_door_battery
layout: vertical
- type: custom:mushroom-lock-card
entity: lock.main_front_door
name: Main Front Door
primary_info: none
secondary_info: none
icon_type: none
card_mod:
style: |
ha-card {
{% if is_state('lock.main_front_door','locked') and
is_state('binary_sensor.main_front_door_door', 'off') %}
background: rgba(145,2,2,0.5);
{% elif is_state('binary_sensor.main_front_door_door', 'on') %}
background: rgba(130,130,0,0.5);
{% else %}
background: rgba(2,61,2,0.5);
{% endif %}
}
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: Main Hot Tub Door
secondary: >-
{% if
is_state('binary_sensor.main_basement_to_hot_tub_door','on')
%}
Door Open
{% elif is_state('lock.main_basement_to_hot_tub','unlocked')
%}
Unlocked
{% else %}
Locked
{% endif%}
icon: >-
{% if
is_state('binary_sensor.main_basement_to_hot_tub_door','on')
%}
mdi:door-open
{% elif is_state('lock.main_basement_to_hot_tub','unlocked')
%}
mdi:lock-open
{% else %}
mdi:lock
{% endif%}
icon_color: >-
{% if is_state('lock.main_basement_to_hot_tub','locked') and
is_state('binary_sensor.main_basement_to_hot_tub_door','off')
%}
red
{% elif
is_state('binary_sensor.main_basement_to_hot_tub_door','on')
%}
yellow
{% else %}
green
{% endif%}
badge_icon: >-
{% set battery_level =
(states('sensor.main_basement_to_hot_tub_battery') | int / 10)
| round(0) | int * 10 %} {% if battery_level == 100 %}
mdi:battery {% elif battery_level > 0 %} mdi:battery-{{
battery_level }} {% else %} mdi:battery-alert-variant-outline
{% endif %}
badge_color: >-
{% set battery_level =
states('sensor.main_basement_to_hot_tub_battery') | int %}
{% if battery_level > 90 %} green
{% elif battery_level > 60 %} light-green
{% elif battery_level > 50 %} lime
{% elif battery_level > 40 %} yellow
{% elif battery_level > 30 %} amber
{% elif battery_level > 20 %} orange
{% elif battery_level > 10 %} deep-orange
{% else %} red
{% endif %}
tap_action:
action: more-info
entity: sensor.main_basement_to_hot_tub_battery
layout: vertical
- type: custom:mushroom-lock-card
entity: lock.main_basement_to_hot_tub
name: Main Hot Tub Door
primary_info: none
secondary_info: none
icon_type: none
card_mod:
style: |
ha-card {
{% if is_state('lock.main_basement_to_hot_tub','locked') and
is_state('binary_sensor.main_basement_to_hot_tub_door', 'off') %}
background: rgba(145,2,2,0.5);
{% elif is_state('binary_sensor.main_basement_to_hot_tub_door', 'on') %}
background: rgba(130,130,0,0.5);
{% else %}
background: rgba(2,61,2,0.5);
{% endif %}
}
card_mod:
style: |
ha-card {
background-color: rgba(0,0,0,0.85);
}