Mushroom Cards - Build a beautiful dashboard easily 🍄 (Part 1)

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;}
    }

Yes, you can adjust the Mushroom Icon Shape size like this:

Mushroom Shape Size

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

What is the value range of your fan?

Hi, why this style doesn’t work for chips? How can i add style for all ships in one go?

2 Likes

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;
        }

Yes, you can change the Mushroom Icon with state using Card-Mod like this:

Mushroom Light Icon

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

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

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!

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

Isn’t that what Collapse controls when off already does?

You are right! I should have read that. It does exactly what I want.
Thank you :sweat_smile:

1 Like

What do you want the Chip to do?

Would love to know this aswell, looks great @Tim_Knowlden

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

Can you share your code and I’ll have a look.

0-100

step increments are 1

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?
image

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