rhysb
(Rhys)
September 3, 2022, 6:40am
2698
Try like this:
card_mod:
style: |
mushroom-shape-icon {
display: flex;
{% if is_state('binary_sensor.solar_pumpe', 'on')%}
animation: blink 2s linear infinite;
{% endif %}
}
@keyframes blink {
50% {opacity: 0;}
}
rhysb
(Rhys)
September 3, 2022, 7:00am
2699
Yes, you can adjust the Mushroom Icon Shape size like this:
type: custom:mushroom-template-card
primary: Mushroom
icon: mdi:mushroom
icon_color: red
card_mod:
style: |
mushroom-shape-icon {
--icon-symbol-size: 21px;
--icon-size: 63px;
}
3 Likes
rhysb
(Rhys)
September 3, 2022, 7:15am
2700
What is the value range of your fan?
Vlad_August
(Vlad August)
September 3, 2022, 8:06am
2701
Hi, why this style doesn’t work for chips? How can i add style for all ships in one go?
2 Likes
rhysb
(Rhys)
September 3, 2022, 8:45am
2702
Apply it to the Chips like this:
type: custom:stack-in-card
cards:
- type: custom:mushroom-chips-card
chips:
- type: entity
entity: switch.lounge_amp_front
icon_color: light-blue
name: Front
content_info: name
- type: entity
entity: switch.lounge_amp_center
icon_color: light-blue
name: Center
content_info: name
card_mod:
style: |
ha-card {
--chip-background: none;
--chip-box-shadow: none;
--chip-spacing: 0px;
}
rhysb
(Rhys)
September 3, 2022, 8:59am
2703
Yes, you can change the Mushroom Icon with state using Card-Mod like this:
type: custom:mushroom-light-card
entity: light.office_light
show_brightness_control: true
card_mod:
style: |
mushroom-shape-icon {
{{ '--card-mod-icon: mdi:lightbulb;' if is_state(config.entity, 'on') else '--card-mod-icon: mdi:lightbulb-off;' }}
}
3 Likes
rhysb
(Rhys)
September 3, 2022, 9:07am
2704
Had to change the styling a bit to get this working.
Mushroom Media Card with player name and dynamic icon:
type: custom:mushroom-media-player-card
entity: media_player.rhys_laptop_plexamp
use_media_info: true
show_volume_level: false
volume_controls:
- volume_set
- volume_mute
media_controls:
- previous
- play_pause_stop
- next
- shuffle
- repeat
icon: mdi:play
card_mod:
style: |
mushroom-state-item {
{% set media_type = state_attr(config.entity, 'media_content_type') %}
--card-mod-icon:
{% if media_type == 'tvshow' %}
mdi:television-classic
{% elif media_type == 'movie' %}
mdi:movie-open
{% elif media_type == 'music' %}
mdi:music
{% elif media_type == 'playlist' %}
mdi:music
{% else %}
mdi:play
{% endif %};
}
mushroom-state-info:before {
{% if not is_state(config.entity, 'off') and not is_state(config.entity, 'idle') %}
content: "{{ state_attr(config.entity, "friendly_name") }}";
font-size: 14px;
font-weight: bold;
{% endif %}
}
mushroom-state-info {
{% if not is_state(config.entity, 'off') and not is_state(config.entity, 'idle') %}
--card-primary-font-size: 12px;
font-weight: bold;
{% endif %}
}
4 Likes
filikun
(Filikun)
September 3, 2022, 9:07am
2705
Thanks a bunch, do you know if I can pass a variable to the --shape-color
from a button_card template? I have --shape-color
set as none in my theme and want a single menu to have the option on different colors without making seperate templates
Hi, is it possible to hide show_brightness_control
, show_color_temp_control
, show_color_control
of the mushroom-light-card depending on the current state of the entity?
hey can you also input select mediaplayer sourceshare can you share this so that I can also use it in your map in my dashboard? thanks in advance!
rhysb
(Rhys)
September 3, 2022, 9:51am
2708
Maybe, what state would you look for?
What I wish I could do is to hide those control bars when the light they are controlling is off.
Like so:
type: custom:mushroom-light-card
entity: light.table_lights
show_brightness_control: true # <- true if the entity (light.table_lights) is on, else false
show_color_temp_control: true # <- true if the entity (light.table_lights) is on, else false
show_color_control: true # <- true if the entity (light.table_lights) is on, else false
use_light_color: true
name: Table
icon: mdi:table-chair
hide_state: false
rhysb
(Rhys)
September 3, 2022, 10:00am
2710
Isn’t that what Collapse controls when off
already does?
leofabri
September 3, 2022, 10:09am
2711
You are right! I should have read that. It does exactly what I want.
Thank you
1 Like
rhysb
(Rhys)
September 3, 2022, 10:49am
2712
What do you want the Chip to do?
Airyphyla
(Airyphyla)
September 3, 2022, 10:53am
2713
Would love to know this aswell, looks great @Tim_Knowlden
rhysb
(Rhys)
September 3, 2022, 10:56am
2714
This is because the episode art is shorter that the fade width. You can decrease the fade width if this is a problem for you.
1 Like
rhysb
(Rhys)
September 3, 2022, 10:59am
2715
Can you share your code and I’ll have a look.
clmun
(Clmun)
September 3, 2022, 1:38pm
2717
Hello
I want to align the cards one under another. To have the icons aligned in 6 columns even in the next row I get some of them in groups.
I want to group them by room and sometimes i have 2 or 3 in group and then I can’t size them properly.
I tried but I can’t make it exactly. Can I have some tips how should I do it better?
type: horizontal-stack
cards:
- type: custom:vertical-stack-in-card
mode: vertical
title: Hol
cards:
- type: custom:vertical-stack-in-card
horizontal: true
cards:
- type: custom:mushroom-template-card
entity: light.hallway
layout: vertical
badge_icon: >-
{% if is_state('binary_sensor.motion_dinning_occupancy', 'on') %}
mdi:motion
{% elif is_state('binary_sensor.motion_dinning_occupancy', 'off')
%}
{% endif %}
badge_color: red
icon: mdi:key
icon_color: |-
{% if is_state('light.hallway', 'on') %}
amber
{% endif %}
style: |
ha-card > h1 {
padding: 2px 8px 0px;
font-size: 14px;
line-height: 30px;
#background: {% if is_state('binary_sensor.motion_dinning_occupancy','on') %} yellow {% endif %}
}
ha-card {
margin-left: 0%;
width: 40%;
#border-radius: 30px;
#border-right: {% if is_state('binary_sensor.motion_dinning_occupancy','on') %} solid 6px red {% endif %} ;
box-shadow: {% if is_state('light.hallway','on') %} 0px 0px 3px 3px var(--paper-item-icon-active-color) {% endif %} ;
#background: {% if is_state('binary_sensor.gate', 'on') %} red {% else %} white {% endif %};
}
- type: custom:vertical-stack-in-card
mode: vertical
title: Living Room
cards:
- type: custom:vertical-stack-in-card
horizontal: true
cards:
- type: custom:mushroom-template-card
entity: light.living1
layout: vertical
icon: mdi:ceiling-light
icon_color: |-
{% if is_state('light.living1', 'on') %}
amber
{% endif %}
badge_icon: >-
{% if is_state('binary_sensor.motion_living_2_occupancy', 'on') %}
mdi:motion
{% elif is_state('binary_sensor.motion_living_2_occupancy', 'off')
%}
{% endif %}
badge_color: red
- type: custom:mushroom-template-card
entity: light.living2
layout: vertical
icon: mdi:sofa
icon_color: |-
{% if is_state('light.living2', 'on') %}
amber
{% endif %}
badge_icon: >-
{% if is_state('binary_sensor.motion_living_2_occupancy', 'on') %}
mdi:motion
{% elif is_state('binary_sensor.motion_living_2_occupancy', 'off')
%}
{% endif %}
badge_color: red
- type: custom:mushroom-template-card
entity: light.shapes_c8b9
layout: vertical
icon: mdi:hexagon-multiple
icon_color: |-
{% if is_state('light.shapes_c8b9', 'on') %}
amber
{% endif %}
style: |
ha-card > h1 {
padding: 2px 8px 0px;
font-size: 14px;
line-height: 30px;
}
ha-card {
margin-left: -60%;
width: 160%;
#border-right: {% if is_state('binary_sensor.motion_living_occupancy','on') %} solid 6px red {% endif %} ;
#border-left: {% if is_state('binary_sensor.motion_living_2_occupancy','on') %} solid 6px red {% endif %} ;
box-shadow: {% if is_state('light.living_lights','on') %} 0px 0px 3px 3px var(--paper-item-icon-active-color) {% endif %} ;
#background: {% if is_state('binary_sensor.gate', 'on') %} red {% else %} white {% endif %};
}
- type: custom:vertical-stack-in-card
mode: vertical
title: Bucatarie
cards:
- type: custom:vertical-stack-in-card
horizontal: true
cards:
- type: custom:mushroom-template-card
entity: light.dinning
layout: vertical
icon: mdi:glass-cocktail
icon_color: |-
{% if is_state('light.dinning', 'on') %}
amber
{% endif %}
badge_icon: >-
{% if is_state('binary_sensor.motion_living_occupancy', 'on') %}
mdi:motion
{% elif is_state('binary_sensor.motion_living_occupancy', 'off')
%}
{% endif %}
badge_color: red
- type: custom:mushroom-template-card
entity: light.kitchen
layout: vertical
icon: mdi:silverware-fork-knife
icon_color: |-
{% if is_state('light.kitchen', 'on') %}
amber
{% endif %}
badge_icon: >-
{% if is_state('binary_sensor.motion_kitchen_occupancy', 'on') %}
mdi:motion
{% elif is_state('binary_sensor.motion_kitchen_occupancy', 'off')
%}
{% endif %}
badge_color: red
style: |
ha-card > h1 {
padding: 2px 8px 0px;
font-size: 14px;
line-height: 30px;
}
ha-card {
margin-left: 0%;
width: 100%;
#border-right: {% if is_state('binary_sensor.motion_kitchen_occupancy','on') %} solid 6px red {% endif %} ;
#border-left: {% if is_state('binary_sensor.motion_living_2_occupancy','on') %} solid 6px red {% endif %} ;
box-shadow: {% if is_state('light.kitchen_lights','on') %} 0px 0px 3px 3px var(--paper-item-icon-active-color) {% endif %} ;
#background: {% if is_state('binary_sensor.gate', 'on') %} red {% else %} white {% endif %};
}
1 Like