Hi all, while searching for anything interesting that can apply to my dashboard I stumbled upon this post and the sixth post by @Thekholm
I loved the way he nested light cards under one card and decided to copy his code. I fiddled around with his code and managed to modify his design according to my needs…BUT, I have 2 things that I can’t find out how to change.
First thing is that when the group entity is on it states how many lights are on. What I would like is to have is the percentage of the overall lighting group.
The second one is that while the first card follows the dashboard theme, the cards nested under are not following the same theme. Is there a way to change the theme for the nested cards?
I want to mention here that I am a total noob considering coding and css styling but I don’t give up!!!
And here is my code
type: custom:vertical-stack-in-card
cards:
- type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: auto 33px
margin: '-4px -4px -8px -4px;'
cards:
- type: custom:mushroom-template-card
entity: light.studio
layout: horizontal
primary: Studio
secondary: >
{% set room = expand(area_entities('studio')) |selectattr('domain',
'eq',
'light')|rejectattr('attributes.is_hue_group', 'true') |list %}{% set
on =
room |selectattr('state', 'eq', 'on')|list |count %}{% set all = room
|count %}{% if on |int(0) > 0 %}{{ on }}/{{ all }}{% else %} Off {%
endif %} {% if is_state('light.studio', 'on') %} Lampor är på
{%else%}
{% endif %}
icon: mdi:lightbulb-group
icon_color: '{{ ''orange'' if is_state(entity, ''on'') else ''grey'' }}'
fill_container: false
multiline_secondary: false
use_light_color: true
show_brightness_control: true
card_mod:
style: |
ha-card {
background: none;
--ha-card-border-width: 0;
}
- type: custom:mushroom-template-card
entity: input_boolean.mushroom_matrum_card
icon: >-
{{ 'mdi:chevron-up' if is_state(entity, 'on') else 'mdi:chevron-down'
}}
icon_color: white
hold_action:
action: none
card_mod:
style: |
ha-card {
align-items: flex-end;
background: none;
--ha-card-border-width: 0;
}
mushroom-shape-icon {
--shape-color: none !important;
}
- type: conditional
conditions:
- entity: input_boolean.mushroom_matrum_card
state: 'on'
card:
type: custom:vertical-stack-in-card
cards:
- type: custom:mushroom-light-card
entity: light.pendant_2
layout: horizontal
use_light_color: true
show_brightness_control: true
card_mod:
style:
mushroom-state-info$: |
.container {
display: table !important;
}
.secondary {
display: table-cell;
text-align: right;
width: 100%;
}
.: |
ha-card:after {
content: '';
border-bottom: solid px rgba(var(--rgb-grey), 0.2);
margin: 12px 0px -12px;
}
- type: custom:mushroom-light-card
entity: light.desk
layout: horizontal
use_light_color: true
show_brightness_control: true
card_mod:
style:
mushroom-state-info$: |
.container {
display: table !important;
}
.secondary {
display: table-cell;
text-align: right;
width: 100%;
}
.: |
ha-card:after {
content: '';
border-bottom: solid px rgba(var(--rgb-grey), 0.2);
margin: 12px 0px -12px;
}
- type: custom:mushroom-light-card
entity: light.studio_strip
layout: horizontal
use_light_color: true
show_brightness_control: true
card_mod:
style:
mushroom-state-info$: |
.container {
display: table !important;
}
.secondary {
display: table-cell;
text-align: right;
width: 100%;
}
.: |
ha-card:after {
content: '';
border-bottom: solid px rgba(var(--rgb-grey), 0.2);
margin: 12px 0px -12px;
}
card_mod: null
style: |
ha-card {
--ha-card-border-width: 0;
}