Hello,
I created a person card with some additional chips. Those chips need to be positioned and resized. I achieved the desired look, but when the page is loaded, I can see how the chips are moved and resized until they reach the final position (on PC and mobile phone). Sometimes those chips are completely missing and only a person entity is shown. When I use this person’s cards on the main/home page, I can see that they are loaded with significant delay, sometimes. It seems to be related to the view type. If I use Vertical (layout-card) then there is this rendering problem. Is this a desired behavior? Or is there a way how to fix delays or missing chips? When I switch to the Mansory (default) the rendering problem and delays disappear and everything works fine. Maybe Vertical (layout-card) issue?
Any suggestions for the cards? Is there a better way how to achieve the desired look?
Here is the code and I using Mushroom Square Shadow theme:
square: false
columns: 3
type: grid
cards:
- type: custom:vertical-stack-in-card
cards:
- type: custom:mushroom-person-card
entity: person.dano
use_entity_picture: true
hide_name: false
layout: horizontal
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Dano
content:
type: custom:mod-card
style: |
ha-card {
--padding-right: 15px;
--padding-left: 15px;
--padding-bottom: 15px;
--box-shadow: 0px 0px;
--ha-card-border-width: 0px;
}
card:
type: vertical-stack
cards:
- type: custom:mushroom-template-card
entity: sensor.s23_dano_geocoded_location
primary: '{{ states.person.dano.state | capitalize }}'
secondary: '{{ states.sensor.s23_dano_geocoded_location.state }}'
icon: mdi:map-marker
icon_color: blue
- type: map
entities:
- zone.work
- zone.work_sisa
- zone.chalupka
- zone.home
- zone.garage
- zone.lubo
- zone.tomas
- person.dano
auto_fit: true
aspect_ratio: '3:2'
default_zoom: 17
- type: custom:mushroom-chips-card
chips:
- type: template
entity: binary_sensor.s23_dano_mobile_data
icon: '{{ state_attr(entity, ''icon'') }}'
icon_color: '{{ ''blue'' if is_state(entity, "on") else ''disabled'' }}'
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
- type: template
entity: binary_sensor.s23_dano_wifi_state
icon: '{{ state_attr(entity, ''icon'') }}'
icon_color: '{{ ''green'' if is_state(entity, "on") else ''disabled'' }}'
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
- type: template
entity: sensor.s23_dano_battery_level
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
ha-card:after {
content: "{{ states('sensor.s23_dano_battery_level') }}%";
position: absolute;
display: flex;
justify-content: center;
align-items: center;
font-weight: bolder;
border-radius: 50%;
top: -7px;
right: 0px;
width: 16px;
height: 16px;
font-size: 11px;
}
icon: >
{% set battery_level = states(entity) | int // 10 * 10 %}
{% set charging_state = states('sensor.s23_dano_charger_type')
%}
{% set is_charging =
is_state('binary_sensor.s23_dano_is_charging', 'on') | iif(True,
False) %}
{% set map = {"none":"", "ac":"charging-",
"wireless":"charging-wireless-"} %}
{% set charging = map[states('sensor.s23_dano_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 = 200 %}
{% set g = (5.0 * percentage) | round | int %}
{% else %}
{% set g = 200 %}
{% set r = (505 - 4.89 * percentage) | round | int %}
{% endif %}
{{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
tap_action:
action: more-info
alignment: center
card_mod:
style: |
ha-card {
--chip-box-shadow: 0px;
--chip-background: none;
--chip-spacing: 0px;
--chip-padding: 0 0em;
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:mushroom-person-card
entity: person.sisa
use_entity_picture: true
hide_name: false
layout: horizontal
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Sisa
content:
type: custom:mod-card
style: |
ha-card {
--padding-right: 15px;
--padding-left: 15px;
--padding-bottom: 15px;
--box-shadow: 0px 0px;
--ha-card-border-width: 0px;
}
card:
type: vertical-stack
cards:
- type: custom:mushroom-template-card
entity: sensor.s23fe_sisa_geocoded_location
primary: '{{ states.person.sisa.state | capitalize }}'
secondary: '{{ states.sensor.s23fe_sisa_geocoded_location.state }}'
icon: mdi:map-marker
icon_color: blue
- type: map
entities:
- zone.work
- zone.work_sisa
- zone.chalupka
- zone.home
- zone.garage
- zone.lubo
- zone.tomas
- person.sisa
auto_fit: true
aspect_ratio: '3:2'
default_zoom: 17
- type: custom:mushroom-chips-card
chips:
- type: template
entity: binary_sensor.s23fe_sisa_mobile_data
icon: '{{ state_attr(entity, ''icon'') }}'
icon_color: '{{ ''blue'' if is_state(entity, "on") else ''disabled'' }}'
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
- type: template
entity: binary_sensor.s23fe_sisa_wifi_state
icon: '{{ state_attr(entity, ''icon'') }}'
icon_color: '{{ ''green'' if is_state(entity, "on") else ''disabled'' }}'
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
- type: template
entity: sensor.s23fe_sisa_battery_level
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
ha-card:after {
content: "{{ states('sensor.s23fe_sisa_battery_level') }}%";
position: absolute;
display: flex;
justify-content: center;
align-items: center;
font-weight: bolder;
border-radius: 50%;
top: -7px;
right: 0px;
width: 16px;
height: 16px;
font-size: 11px;
}
icon: >
{% set battery_level = states(entity) | int // 10 * 10 %}
{% set charging_state = states('sensor.s23fe_sisa_charger_type')
%}
{% set is_charging =
is_state('binary_sensor.s23fe_sisa_is_charging', 'on') | iif(True,
False) %}
{% set map = {"none":"", "ac":"charging-",
"wireless":"charging-wireless-"} %}
{% set charging = map[states('sensor.s23fe_sisa_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 = 200 %}
{% set g = (5.0 * percentage) | round | int %}
{% else %}
{% set g = 200 %}
{% set r = (505 - 4.89 * percentage) | round | int %}
{% endif %}
{{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
tap_action:
action: more-info
alignment: center
card_mod:
style: |
ha-card {
--chip-box-shadow: 0px;
--chip-background: none;
--chip-spacing: 0px;
--chip-padding: 0 0em;
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:mushroom-person-card
entity: person.danko
use_entity_picture: true
hide_name: false
layout: horizontal
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Danko
content:
type: custom:mod-card
style: |
ha-card {
--padding-right: 15px;
--padding-left: 15px;
--padding-bottom: 15px;
--box-shadow: 0px 0px;
--ha-card-border-width: 0px;
}
card:
type: vertical-stack
cards:
- type: custom:mushroom-template-card
entity: sensor.s10e_danko_geocoded_location
primary: '{{ states.person.danko.state | capitalize }}'
secondary: '{{ states.sensor.s10e_danko_geocoded_location.state }}'
icon: mdi:map-marker
icon_color: blue
- type: map
entities:
- zone.work
- zone.work_sisa
- zone.chalupka
- zone.home
- zone.garage
- zone.lubo
- zone.tomas
- person.danko
auto_fit: true
aspect_ratio: '3:2'
default_zoom: 17
- type: custom:mushroom-chips-card
chips:
- type: template
entity: binary_sensor.s10e_danko_mobile_data
icon: '{{ state_attr(entity, ''icon'') }}'
icon_color: '{{ ''blue'' if is_state(entity, "on") else ''disabled'' }}'
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
- type: template
entity: binary_sensor.s10e_danko_wifi_state
icon: '{{ state_attr(entity, ''icon'') }}'
icon_color: '{{ ''green'' if is_state(entity, "on") else ''disabled'' }}'
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
- type: template
entity: sensor.s10e_danko_battery_level
card_mod:
style: |
ha-card {
justify-content: center;
min-width: 22px !important;
--chip-height: 30px;
--chip-icon-size: 18px;
}
ha-card:after {
content: "{{ states('sensor.s10e_danko_battery_level') }}%";
position: absolute;
display: flex;
justify-content: center;
align-items: center;
font-weight: bolder;
border-radius: 50%;
top: -7px;
right: 0px;
width: 16px;
height: 16px;
font-size: 11px;
}
icon: >
{% set battery_level = states(entity) | int // 10 * 10 %}
{% set charging_state = states('sensor.s10e_danko_charger_type')
%}
{% set is_charging =
is_state('binary_sensor.s10e_danko_is_charging', 'on') | iif(True,
False) %}
{% set map = {"none":"", "ac":"charging-",
"wireless":"charging-wireless-"} %}
{% set charging = map[states('sensor.s10e_danko_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 = 200 %}
{% set g = (5.0 * percentage) | round | int %}
{% else %}
{% set g = 200 %}
{% set r = (505 - 4.89 * percentage) | round | int %}
{% endif %}
{{ "#%0x" | format( r * 0x10000 + g * 0x100 + b * 0x1 ) }}
tap_action:
action: more-info
alignment: center
card_mod:
style: |
ha-card {
--chip-box-shadow: 0px;
--chip-background: none;
--chip-spacing: 0px;
--chip-padding: 0 0em;
}