Hi,
Iām facing an issue where I canāt get nested mushroom template chips (combined with different mushroom cards in a vertical-stack-in-card) to be visible in chrome or edge browser on e.g. desktop/tablet or the companion app on my phone.
However, it is working when showing the same view on my mobile in brave browser or opera on my desktop. And I can also see those conditional mushroom chips in edit mode, every time.
Is there anybody who has an idea, why that is the case? I canāt seem to figure out, why this is behaving so inconsistently.
Iāve already been playing around and tested different approaches (for the conditional visibility). I tried the āoriginalā approach, from the code example I started with, with the conditional card and also tried to achieve a similar behaviour with only a conditional if-clause in the icon-value.
I also played around with different margins and sizes in general. But it was never consistently showing in all contexts (except for the mentioned contexts where it always works, e.g. edit mode).
My current approach is using conditional if-clauses in the icon parameter value, instead of conditional cards. Hereās a code example.
- type: custom:vertical-stack-in-card
cards:
- type: custom:mushroom-template-card
entity: sensor.lights_currently_turned_on
icon: mdi:lightbulb-group
icon_color: |
{% if states('sensor.lights_currently_turned_on') == '0' %}
grey
{% else %}
#f39c12
{% endif %}
primary: Licht
secondary: |
{% if states('sensor.lights_currently_turned_on') == '0' %}
aus
{% else %}
{{ states('sensor.lights_currently_turned_on') }} eingeschaltet
{% endif %}
layout: horizontal
tap_action:
action: navigate
navigation_path: /dashboard-start/lichtsteuerung
double_tap_action:
action: navigate
navigation_path: /dashboard-start/lichtsteuerung
hold_action:
action: toggle
card_mod:
style:
mushroom-state-info$: |
.primary {
font-size: 14px !important;
position: relative;
top: -50px;
left: -160px;
overflow: visible !important;
white-space: normal !important;
}
.secondary {
position: relative;
overflow: visible !important;
top: -52px;
left: -160px;
}
mushroom-shape-icon$: |
.shape {
position: relative;
left: -50px;
top: 45px;
}
.: |
:host {
--mush-icon-size: 146px;
}
- type: custom:mushroom-chips-card
chips:
- type: template
entity: media_player.player
icon: >-
{% if is_state('media_player.player', 'on') or
is_state('media_player.player_zone_2', 'on') %}
{% if is_state('media_player.player', 'on') and (is_state_attr('media_player.player', 'source',
'strm-box') or
is_state_attr('media_player.player', 'source',
'video1') or
is_state_attr('media_player.player', 'source',
'video2') or
is_state_attr('media_player.player', 'source',
'video3') or
is_state_attr('media_player.player', 'source',
'video4') or
is_state_attr('media_player.player', 'source',
'video5') or
is_state_attr('media_player.player', 'source',
'video6')) %}
mdi:television-play
{% else %}
mdi:music
{% endif %}
{% else %}
{% endif %}
icon_color: blue
content_info: none
card_mod:
style:
.: |
ha-card {
width: 66px;
margin-left: 75%;;
top: -70px;
background: none;
--chip-border-width: 0;
}
:host {
--mush-icon-size: 20px;
--mush-chip-spacing: -2.9px;
}
The result remains the same.
In card-editor view the āconditional mushroom chipsā work like a charm.
In most contexts the āconditional mushroom template chipsā can only be seen, if the whole browser/app was stopped and re-run. Sometimes those chips become visible. But after some time it stops working again and needs a new restart-cycle, to maybe become visible again.