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

Try like this:

card_mod:
  style:
    mushroom-shape-icon$: |
      .shape {
        --shape-animation: ping 2s infinite;
      }
      @keyframes ping {
        60% { box-shadow: 0 0 0 0 rgba(var(--rgb-green), 0.7); }
        100% { box-shadow: 0 0 5px 15px transparent; }
      }
    .: |
      ha-state-icon {
        animation: clip 2s steps(1) infinite;
      }
      @keyframes clip {
        0% { clip-path: circle(0% at 50% 85%); }
        20% { clip-path: circle(30% at 50% 85%); }
        40% { clip-path: circle(55% at 50% 85%); }
        60% { clip-path: circle(80% at 50% 85%); }
      }
1 Like

Worked immediately. That’s what I was trying to do but had it reversed. Thanks a lot!

Its not just about reversing.

You cant refer to ha-icon under mushroom-shape-icon anymore.

You also have to use ha-state-icon instead of ha-icon and --icon-animation is now just animation.

The only reason ha-state-icon is at the bottom is because i used .: | to reset it back to style: | so that i can put ha-state-icon on its own outside of the mushroom-shape-icon.

1 Like

Aaaah, thank you @paddy0174 I was trying to put them in Automations, too bloody tired I think LOL
I’ll give that a crack, cheers for your help!

1 Like

Could someone assist me in icon animation, i know its been a breaking change in animaion.
@rhysb

- type: custom:mushroom-template-card
            primary: ""
            secondary: Energy
            icon: mdi:lightning-bolt
            icon_color: amber
            layout: vertical
            tap_action:
              action: navigate
              navigation_path: energy
            card_mod:
              style:
                mushroom-shape-icon$: |
                  ha-state-icon {
                    animation: charge 1s linear infinite;
                  }

                  @keyframes charge {
                    0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% { transform: translate(0, 0); }
                    5% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    15% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    25% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    35% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    45% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    55% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    65% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    75% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    85% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                    95% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
                  }

              .: |
                ha-card {
                  background: var(--card-background-color);
                  #width: 66px;
                  border-radius: 30px;
                  margin-left: auto;
                  margin-right: auto;
                  margin-bottom: 2px;
                }

Like this:

card_mod:
  style: |
      ha-state-icon {
        animation: charge 1s linear infinite;
      }
      @keyframes charge {
        0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% { transform: translate(0, 0); }
        5% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        15% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        25% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        35% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        45% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        55% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        65% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        75% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        85% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
        95% { transform: translate({{ range(-10, 10) | random / 10 }}px, {{ range(-10, 10) | random / 10 }}px); }
      }
      ha-card {
        background: var(--card-background-color);
        #width: 66px;
        border-radius: 30px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 2px;
      }

Hi all!
can you share yours media player solutions?
thank you

I am using input boolean to make dropdown cards.

How can I reset the the state of an input boolean so when a dashboard is opened, dropdown cards are collapsed?

I understand if this is a little off topic, though I’m hoping this is an easy fix.

I’ve got the kiosk mode enabled, though it still leaves behind a blue banner at the very top when viewing on iOS app. Is it possible to make this the same as the background colour?

Hi, this is my alarm clock alarm panel, does anyone have any suggestions for improvement?

For me it still looks not enough like mushroom. Ideas are welcome :slight_smile:

Screen Recording 2023-08-18 at 12.49.27

short functionality explanation:

on the right and left side can be easily set with plus and minus the time, I’m not a friend of manual input and find this easier. In the middle is displayed hour and minute, above the mode can be selected, off, on, alarm clock only weekdays. with the function smart the time is set to the next sunrise

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-title-card
        title: ''
        subtitle: ' Wecker'
      - type: vertical-stack
        cards:
          - type: custom:mushroom-title-card
            title: ''
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                icon: |-
                  {% if is_state('input_select.wecker_scedule', 'Ein') %}
                    mdi:clock
                  {% elif is_state('input_select.wecker_scedule', 'Aus') %}
                    mdi:clock-remove
                  {% elif is_state('input_select.wecker_scedule', 'Werktags') %}
                    mdi:briefcase
                  {% elif is_state('input_select.wecker_scedule', 'Smart') %}
                    mdi:sun-wireless
                  {% else %}
                    red
                  {% endif %}
                picture: ''
                content: '{{ states(''input_select.wecker_scedule'') }}'
                entity: input_select.wecker_scedule
                icon_color: |-
                  {% if is_state('input_select.wecker_scedule', 'Ein') %}
                    green
                  {% elif is_state('input_select.wecker_scedule', 'Aus') %}
                    red
                  {% elif is_state('input_select.wecker_scedule', 'Werktags') %}
                    blue
                  {% elif is_state('input_select.wecker_scedule', 'Smart') %}
                    orange
                  {% else %}
                    red
                  {% endif %}
                tap_action:
                  action: call-service
                  service: input_select.select_next
                  target:
                    entity_id: input_select.wecker_scedule
                  data:
                    cycle: true
            alignment: end
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-title-card
        title: ''
        subtitle: ''
      - type: vertical-stack
        cards:
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                icon: mdi:plus
                content: ''
                tap_action:
                  action: call-service
                  service: input_number.increment
                  target:
                    entity_id: input_number.wecker_stunde
                  data: {}
                entity: input_number.wecker_stunde
                hold_action:
                  action: call-service
                  service: input_number.set_value
                  target:
                    entity_id: input_number.wecker_stunde
                  data:
                    value: 7
            alignment: center
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                icon: mdi:minus
                icon_color: ''
                tap_action:
                  action: call-service
                  service: input_number.decrement
                  target:
                    entity_id: input_number.wecker_stunde
                  data: {}
            alignment: center
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-template-card
            primary: '{{ states(''input_number.wecker_stunde'') }}'
            secondary: |
              {{ states('input_number.wecker_minute') }}
            tap_action:
              action: none
            icon: ''
            icon_color: ''
            fill_container: true
            multiline_secondary: true
            layout: vertical
            badge_icon: ''
            double_tap_action:
              action: none
            hold_action:
              action: none
            badge_color: ''
      - type: vertical-stack
        cards:
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                icon: mdi:plus
                content: ''
                tap_action:
                  action: call-service
                  service: input_number.increment
                  target:
                    entity_id: input_number.wecker_minute
                  data: {}
                hold_action:
                  action: call-service
                  service: input_number.set_value
                  target:
                    entity_id: input_number.wecker_minute
                  data:
                    value: 40
            alignment: center
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                icon: mdi:minus
                icon_color: ''
                tap_action:
                  action: call-service
                  service: input_number.decrement
                  target:
                    entity_id: input_number.wecker_minute
                  data: {}
                hold_action:
                  action: call-service
                  service: input_number.set_value
                  target:
                    entity_id: input_number.wecker_minute
                  data:
                    value: 5
            alignment: center
      - type: custom:mushroom-title-card
        title: ''

8 Likes

I can not add more than 6 chips, what am I doing wrong?
image

type: custom:vertical-stack-in-card
cards:
  - type: custom:mushroom-template-card
    primary: Master Bedroom
    secondary: |-
      {{ states('sensor.tv_ac_room_temperature') }}°c |  {{ states
            ('sensor.tv_ac_humidity') | int }} %
    icon: |-
      {% if is_state('light.master_bedroom_dimmer', 'on') %}
        mdi:bed-king
      {% elif is_state('light.master_bedroom_dimmer', 'off') %}
        mdi:bed-king    
      {% elif is_state('light.master_bedroom_dimmer', 'unavailable') %}
        mdi:lightbulb-question
      {% else %}
        mdi:lightbulb-question
      {% endif %}
    entity: light.master_bedroom_dimmer
    icon_color: |-
      {% if is_state('light.master_bedroom_dimmer', 'on') %}
        amber
      {% elif is_state('light.master_bedroom_dimmer', 'off') %}
        disabled
      {% elif is_state('light.master_bedroom_dimmer', 'unavailable') %}
        disabled
      {% else %}

      {% endif %}
    fill_container: true
    multiline_secondary: true
    tap_action:
      action: navigate
      navigation_path: /lovelace/master
    hold_action:
      action: toggle
    double_tap_action:
      action: none
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        entity: binary_sensor.ds_master_bedroom
        icon: |-
          {% if is_state('binary_sensor.ds_master_bedroom', 'off') %}
             mdi:door   
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('binary_sensor.ds_master_bedroom', 'off') %}
               #d8a159   
          {% else %}
                        
          {% endif %}
        double_tap_action:
          action: none
        tap_action:
          action: more-info
        hold_action:
          action: none
      - type: template
        entity: binary_sensor.pir_master_bedroom
        icon: |-
          {% if is_state('binary_sensor.pir_master_bedroom', 'on') %}
          mdi:motion-sensor 
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('binary_sensor.pir_master_bedroom', 'on') %}
             blue   
          {% else %}
                        
          {% endif %}
        double_tap_action:
          action: none
        tap_action:
          action: more-info
        hold_action:
          action: none
      - type: template
        entity: light.master_bedroom_dimmer
        icon: |-
          {% if is_state('light.master_bedroom_dimmer', 'off') %}
          mdi:lightbulb-on   
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('light.master_bedroom_dimmer', 'off') %}
              amber   
          {% else %}
                        
          {% endif %}
        tap_action:
          action: more-info
      - type: template
        entity: light.master_bedroom_wall_1
        icon: |-
          {% if is_state('light.master_bedroom_wall_1', 'off') %}
          mdi:wall-sconce
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('light.master_bedroom_wall_1', 'off') %}
              amber   
          {% else %}
                        
          {% endif %}
        tap_action:
          action: more-info
      - type: template
        entity: light.master_bedroom_wall_2
        icon: |-
          {% if is_state('light.master_bedroom_wall_2', 'off') %}
          mdi:wall-sconce
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('light.master_bedroom_wall_2', 'off') %}
              amber   
          {% else %}
                        
          {% endif %}
        tap_action:
          action: more-info
      - type: template
        entity: light.master_bedroom_wall_3
        icon: |-
          {% if is_state('light.master_bedroom_wall_3', 'off') %}
          mdi:wall-sconce
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('light.master_bedroom_wall_3', 'off') %}
              amber   
          {% else %}
                        
          {% endif %}
        tap_action:
          action: more-info
      - type: template
        entity: binary_sensor.master_window
        icon: |-
          {% if is_state('binary_sensor.master_window', 'on') %}
             mdi:window-open
          {% else %}
                        
          {% endif %}
        icon_color: |-
          {% if is_state('binary_sensor.master_window', 'on') %}
              green   
          {% else %}
                        
          {% endif %}
        double_tap_action:
          action: none
        tap_action:
          action: more-info
        hold_action:
          action: none
    alignment: center
    card_mod:
      style:
        mushroom-template-chip:nth-child(6)$: |
          ha-state-icon {
              animation: boing 4s ease infinite;
              transform-origin: 50% 90%;
            }
            @keyframes boing {
                      0% { transform: scale3d(1, 1, 1); }
                      7% { transform: scale3d(1.25, 0.75, 1); }
                      10% { transform: scale3d(0.75, 1.25, 1); }
                      12% { transform: scale3d(1.15, 0.85, 1); }
                      16% { transform: scale3d(0.95, 1.05, 1); }
                      19% { transform: scale3d(1.05, 0.95, 1); }
                      25% { transform: scale3d(1, 1, 1); }
            }  
        mushroom-template-chip:nth-child(1)$: |
          ha-state-icon {
            animation: open 6s ease-in-out infinite;
            transform-origin: 30%;
          }
          @keyframes open {
           0%, 66% { transform: rotateY(0deg); }
           33% { transform: rotateY(-120deg); }          
          }
          .shape {
           perspective: 45px;
          }
        mushroom-template-chip:nth-child(3)$: |
          ha-state-icon {
            animation: illumination 2s infinite;
          }
          @keyframes illumination {
            0%, 100% { clip-path: inset(0 0 0 0); }
            80% { clip-path: polygon(0% 99%, 20% 55%, 22% 37%, 39% 20%, 61% 21%, 77% 35%, 79% 57%, 99% 100%); }
          }
        mushroom-template-chip:nth-child(4)$: |
          ha-state-icon {
              animation: boing 2s ease infinite;
              transform-origin: 50% 90%;
            }
            @keyframes boing {
                      0% { transform: scale3d(1, 1, 1); }
                      7% { transform: scale3d(1.25, 0.75, 1); }
                      10% { transform: scale3d(0.75, 1.25, 1); }
                      12% { transform: scale3d(1.15, 0.85, 1); }
                      16% { transform: scale3d(0.95, 1.05, 1); }
                      19% { transform: scale3d(1.05, 0.95, 1); }
                      25% { transform: scale3d(1, 1, 1); }
            }
        mushroom-template-chip:nth-child(5)$: |
          ha-state-icon {
              animation: boing 6s ease infinite;
              transform-origin: 50% 90%;
            }
            @keyframes boing {
                      0% { transform: scale3d(1, 1, 1); }
                      7% { transform: scale3d(1.25, 0.75, 1); }
                      10% { transform: scale3d(0.75, 1.25, 1); }
                      12% { transform: scale3d(1.15, 0.85, 1); }
                      16% { transform: scale3d(0.95, 1.05, 1); }
                      19% { transform: scale3d(1.05, 0.95, 1); }
                      25% { transform: scale3d(1, 1, 1); }
            } 
        mushroom-template-chip:nth-child(2)$: |
          ha-state-icon {
              animation: motion 2s linear infinite;
              animation: clip 2s linear infinite;
            }
            @keyframes clip {
                50% { clip-path: polygon(0 0, 55% 0, 100% 100%, 0 100%); }
            }
        mushroom-template-chip:nth-child(7)$: |
          ha-state-icon {
              animation: boing 2s ease infinite;
              transform-origin: 50% 90%;
            }
            @keyframes boing {
                      0% { transform: scale3d(1, 1, 1); }
                      7% { transform: scale3d(1.25, 0.75, 1); }
                      10% { transform: scale3d(0.75, 1.25, 1); }
                      12% { transform: scale3d(1.15, 0.85, 1); }
                      16% { transform: scale3d(0.95, 1.05, 1); }
                      19% { transform: scale3d(1.05, 0.95, 1); }
                      25% { transform: scale3d(1, 1, 1); }
            } 
            
        card_mod: null
        style: |
          ha-card {
          --chip-box-shadow: 0px 0px;
          }

2 Likes

Hello Moss, i used your code and i thank you.
progess bar is not visible. can you help me please?

@rhysb
I have spent at least 2 days in trying to figure out the box shadows in my tablet dashboard. This is what I am aiming for:

What_I_want

I am interested in getting the “glow effect” around the card. I am using Mushroom Shadow theme on my tablet. I have studied --ha card-box-shadow: under card-mod.

Please see my code below for one of the cards.

mode: vertical
cards:
  - type: custom:mushroom-template-card
    primary: Kitchen
    secondary: 🌡{{ states('sensor.kitchen_temperature') }}°C
    icon: mdi:countertop
    card_mod:
      style: |
        --ha-card {
        background: none;
        --ha-card-box-shadow: "0px 0px 12px 10px #56DD3F";
        }
    icon_color: |-
      {% set state=states('light.kitchen_cabinet_lights') %}
      {% if state=='on' %}
      green
      {% elif state=='off' %}
      grey
      {% else %}
      grey
      {% endif %}
    layout: horizontal
    multiline_secondary: false
    tap_action:
      action: navigate
      navigation_path: /dashboard-cards/kitchen
    hold_action:
      action: none
    double_tap_action:
      action: none
    style: |
      :host([dark-mode]) {
        background: rgba(var(--rgb-primary-background-color), 0.2);
      } 
      :host {
        background: rgba(var(--rgb-primary-text-color), 0.025);
      } 
  - type: custom:mushroom-chips-card
    style: |
      ha-card {
        --chip-box-shadow: none;
        --chip-background: none;
        --chip-spacing: 0;
      }
    alignment: end
    chips:
      - type: conditional
        conditions:
          - entity: light.kitchen_cabinet_lights
            state: 'on'
        chip:
          type: entity
          entity: light.kitchen_cabinet_lights
          icon_color: amber
          tap_action:
            action: call-service
            service: light.turn_off
            service_data: {}
            target:
              entity_id: light.kitchen_cabinet_lights
          content_info: none
          icon: mdi:lightbulb
      - type: conditional
        conditions:
          - entity: switch.fridge
            state: 'on'
        chip:
          type: entity
          entity: switch.fridge
          icon_color: red
          tap_action:
            action: call-service
            service: switch.turn_off
            service_data: {}
            target:
              entity_id: switch.fridge
          content_info: none
          icon: mdi:fridge-variant
      - type: conditional
        conditions:
          - entity: switch.deep_freezer
            state: 'on'
        chip:
          type: entity
          entity: switch.deep_freezer
          icon_color: deep-purple
          tap_action:
            action: call-service
            service: switch.turn_off
            service_data: {}
            target:
              entity_id: switch.deep_freezer
          content_info: none
          icon: mdi:treasure-chest
      - type: conditional
        conditions:
          - entity: fan.kitchen_exhaust_fan
            state: 'on'
        chip:
          type: entity
          entity: fan.kitchen_exhaust_fan
          icon_color: green
          card_mod: null
          style: |
            @keyframes rotation {
              0% {
                transform: rotate(0deg);
              }
              100% {
                transform: rotate(360deg);
              }
            }
            ha-card {
              animation: rotation linear infinite;
              {% if states('fan.kitchen_exhaust_fan') == 'on' %}
               animation-duration: 1s;
              {%- else -%}
              {%- endif %}
            }
          tap_action:
            action: call-service
            service: fan.turn_off
            service_data: {}
            target:
              entity_id: fan.kitchen_exhaust_fan
          content_info: none
          icon: mdi:fan
style: |
  ha-card {
    height: 100px;
    {% if is_state('light.kitchen_cabinet_lights', 'on') %}
       background: rgba(255, 152, 0, 0.1);
    {% endif %}
  }
view_layout:
  grid-area: cen4

This is what my card looks like at the moment:

my_card

I would like to know if it is possible to show multiple statuses with a mushroom-template-card.
My car has a trunk with two entities
1 - binary_sensor.cupra_born_trunk_lock_status
2 - binary_sensor.cupra_born_trunk_open_status

But if I use the code below then I only see the status of entity number 1 and not number 2 as well. While the car was unlocked and the trunk was open.

      - type: custom:mushroom-template-card
        primary: Achterklep
        entity: binary_sensor.cupra_born_trunk_lock_status
        secondary: |-
          {% set lock_state=states(entity) %}
              {% set door_state=states("binary_sensor.cupra_born_trunk_open_status") %}
              {% if door_state=='on' and lock_state=='on'%}
              Open, Ontgrendeld
              {% elif door_state=='off' and lock_state=='off' %}
              Dicht, Vergrendeld
              {% elif door_state=='off' and lock_state=='on' %}
              Dicht, Ontgrendeld
              {% endif %}
        icon: >-
          {% set door_state=states("binary_sensor.cupra_born_trunk_open_status")
          %} 
              {% if door_state=='on'%} 
              mdi:car-windshield
              {% elif door_state=='off'%} 
              mdi:car-windshield-outline 
              {% endif %}
        icon_color: >-
          {% set door_state=states("binary_sensor.cupra_born_trunk_open_status")
          %}  
              {% if door_state=='on'%} 
              red
              {% elif door_state=='off'%} 
              deep-orange  
              {% endif %}
        badge_icon: |-
          {% set lock_state=states(entity) %}
              {% if lock_state=='on'%} 
              mdi:lock-open-variant 
              {% elif lock_state=='off' %} 
              mdi:lock 
              {% endif %}
        badge_color: |-
          {% set lock_state=states(entity) %}   
              {% if lock_state=='on'%}   
              red
              {% elif lock_state=='off' %}   
              deep-orange  
              {% endif %}
        tap_action:
          action: more-info
        multiline_secondary: false

Instead of your:

    card_mod:
      style: |
        --ha-card {
        background: none;
        --ha-card-box-shadow: "0px 0px 12px 10px #56DD3F";
        }

Try this:

    card_mod:
      style: |
        ha-card {
          background: none;
          box-shadow: 0px 0px 12px 10px #56DD3F;
        }

just add ?kiosk to the end of the address your going to on the iphone…

I’m using the Home Assistant app so I don’t believe there’s a way to specify an address?

No luck. I tried your code.
Card still looks the same.
My dashboard is coming together so well except for this wanted feature and I am completely stumped on how to make it happen.

Please help.

Try with 1 more change :slight_smile:

card_mod:
  style: |
    ha-card {
      background: none !important;
      box-shadow: 0px 0px 12px 10px #56DD3F !important;
    }

If that doesnt work then i am not entirely sure what your theme is doing to your config tbh…

Wow, wonderful. Thank you for your quick responses. We are getting there.
!important worked. However, I am only getting shadow at the bottom of the card. I tried changing all 4 …px but it still showed the shadow at the bottom.

Here is my code now and the picture of the card.

    card_mod:
      style: |
        ha-card {
          background: none !important;
          box-shadow: 0px 0px 12px 10px #56DD3F !important;
        }

my_card_2