I think @Mariusthvdb reported similar earlier in the thread here Lovelace: Decluttering Card but I did not see a response.
I have a custom button that simulates the multiple-entity-row
card. To demonstrate the issue more clearly, if I put 3 one after the other, I get this:
If I change them to a decluttering-card
template, I get this:
Note the shadow at the top of each row when created via a decluttering-card
template.
My decluttering-card
template is:
multi_entity_row: # This is the name of a template
default:
- secondary-info: last-changed
card:
type: custom:button-card
entity: '[[entity]]'
icon: 'mdi:[[icon]]'
secondary-info: '[[secondary-info]]'
name: '[[name]]'
show_state: false
show_label: true
show_last_changed: true
styles:
card:
- padding: 0px 16px 16px 16px # top right bottom left
grid:
- grid-template-areas: '"i n left_state right_state" "i l left_state right_state"'
- grid-template-columns: min-content 2fr 0.5fr 0.5fr
- grid-template-rows: 1em 1em
img_cell:
- align-self: start
- text-align: start
- width: 40px
- height: 40px
icon:
- height: 24px
- width: 24px
name:
- justify-self: start
- margin-left: 16px
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
label:
- justify-self: start
- margin-left: 16px
- color: var(--secondary-text-color)
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
- color: var(--secondary-text-color)
state:
- justify-self: end
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
custom_fields:
left_state:
- justify-self: end
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
right_state:
- justify-self: end
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
custom_fields:
left_state: >
[[[
return `<span style="color: var(--secondary-text-color); font-size: 10px;">Local</span><br>${states['sensor.ha_local_version'].state}`
]]]
right_state: >
[[[
return `<span style="color: var(--secondary-text-color); font-size: 10px;">Remote</span><br>${states['sensor.ha_remote_version'].state}`
]]]
My stack-in-card
is as follows (note: I changed this to a standard vertical-stack
card to eliminate the stack-in-card
from the equation, and I see the same results, so its not related to the stack-in-card
):
- type: custom:stack-in-card
mode: vertical
keep:
background: true
cards:
### Header
- type: custom:button-card
color_type: label-card
color: rgb(129, 0, 0)
name: Uptime & Updates
- type: entities
entities:
- entity: sensor.ha_uptime
icon: mdi:clock
name: Home Assistant Uptime
Then where I use the decluttering-card
option, this is appended to the end 3 times:
- type: custom:decluttering-card
template: multi_entity_row
variables:
- entity: sensor.ha_local_version
- icon: home-assistant
- name: Home Assistant Versions
Or if I use the custom-button
directly, this is appended 3 times:
- type: custom:button-card
entity: sensor.ha_local_version
icon: mdi:home-assistant
secondary-info: last-changed
show_state: false
show_label: true
show_last_changed: true
name: Home Assistant Versions
styles:
card:
- padding: 0px 16px 16px 16px # top right bottom left
grid:
- grid-template-areas: '"i n left_state right_state" "i l left_state right_state"'
- grid-template-columns: min-content 2fr 0.5fr 0.5fr
- grid-template-rows: 1em 1em
img_cell:
- align-self: start
- text-align: start
- width: 40px
- height: 40px
icon:
- height: 24px
- width: 24px
name:
- justify-self: start
- margin-left: 16px
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
label:
- justify-self: start
- margin-left: 16px
- color: var(--secondary-text-color)
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
- color: var(--secondary-text-color)
state:
- justify-self: end
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
custom_fields:
left_state:
- justify-self: end
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
right_state:
- justify-self: end
- font-size: var(--paper-font-body1_-_font-size)
- font-weight: var(--paper-font-body1_-_font-weight)
custom_fields:
left_state: >
[[[
return `<span style="color: var(--secondary-text-color); font-size: 10px;">Local</span><br>${states['sensor.ha_local_version'].state}`
]]]
right_state: >
[[[
return `<span style="color: var(--secondary-text-color); font-size: 10px;">Remote</span><br>${states['sensor.ha_remote_version'].state}`
]]]
I think that covers everything!
Thanks all.