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

Copied your exact code and change the names to suit my own calendar and it works perfectly.

type: custom:mushroom-chips-card
chips:
  - type: template
    content: >-
      {{ state_attr('calendar.garbage_collection','message')}} in  {{
      ((state_attr('calendar.garbage_collection', 'end_time') | as_datetime |
      as_local - now()).total_seconds() / 60) | int }} minutes.
    card_mod:
      style: |
        ha-card {
          --ha-card-border-width: 0;
          --chip-background: none;
          --chip-height: 75px;
          --chip-padding:12px;
          --chip-box-shadow:none;
          --chip-border-width:0;
          border-width: 0;
        }
1 Like

Sure. Use the zone icon. Here is what I use.

        badge_icon: |2-
                    {% if is_state('person.john','home') %}
                      {{ state_attr('zone.home', 'icon') }}
                    {% else %}
                      mdi:home-off-outline
                    {% endif %}
        badge_color: |-
          {% if is_state('device_tracker.john','home') %}
            green
          {% else %}
            orange
          {% endif %}

How do i add an extra secondary line?

aware we can use:

    mush-rgb-state-cover-open: var(--mush-rgb-blue)
    mush-rgb-state-cover-closed: var(--mush-rgb-disabled)

but, given the new options in core theme coloring,

  state-cover-open-color: gold
  state-cover-opening-color: pink
  state-cover-closing-color: blue
  state-cover-unknown-color: slategrey
  state-cover-closed-color: black
  state-cover-inactive-color: maroon

I was wondering if we also can set a variable on opening and closing. didnt find anything in the Mushroom theme docs on that, so maybe Paul should add it :wink: ?

This is nice. Please can you tweak the icon size/color of the fold entity row if there are more of them. E.g. 3 folding rows with entities inside 1 card. This example affects only first fold entity row.

Many thanks

1 Like

this looks great please share all the details of how you got this working, helpers etc

Yes, you can apply the same styling to all like this:

card_mod:
  style:
    div:
      fold-entity-row$: |
        ha-icon {

Or to a specific child like this:

card_mod:
  style:
    div:nth-child(2):
      fold-entity-row$: |
        ha-icon {

You may need to tweak it to start_time instead of end_time, depending on how things are set up in your calendar. Mine come from Todoist, and it sometimes like to say the events are starting right now instead of when they actually are, so the end_time tends to be more accurate for me.

Having something like fold-entity-row implemented into Mushroom was also discussed on GitHub, but without much progress yet:

right now i use a template card for a room that shows various informations.
the icon changes if the light in the room is on.

image

Icon-color:
{{ '#ff9800' if is_state(entity,'on') else '' }}

recently i added an led-strip to the room, that i don´t want to control using the template card but i´d like to see on the icon if the stripe is on.

so, if the light OR the stripe in the room is on, the icon color should change.

is something like this possible?

{{ '#ff9800' if is_state(entity,'on') or is_state('light.wled_tv', 'on') else '' }}

Following a post in this thread i found this code for the fold-entity-row card:

                      - type: custom:fold-entity-row
                        head:
                          type: custom:mushroom-entity-card
                          entity: group.nuvole_giorno
                          name: Nuvolosità Giorno
                          icon: mdi:script-outline
                          icon_color: light-blue              
                        padding: 0
                        entities:
                          - type: custom:auto-entities
                            card:
                              type: custom:mushroom-entity-card
                              cards: []
                              layout_type: masonry
                            sort:
                              method: first                
                            filter:
                              include:
                                - group: group.nuvole_giorno
                                  options:
                                    type: custom:mushroom-entity-card
                                    icon_color: light-blue
                                    tap_action:
                            card:
                              type: custom:layout-card
                              cards: []
                              layout_type: masonry
                            sort:
                              method: first  
#                              reverse: true                              
                        card_mod:
                          style: |
                            :host {
                              --masonry-view-card-margin: -12px 8px 0px 8px; 
                              --ha-card-border-width: 0;
                              --ha-card-background: none;
                              --ha-card-box-shadow: 0;
                            }
                    card_mod:
                      style:
                        fold-entity-row$: |
                          ha-icon {
                            background: none !important;
                            margin-right: 24px !important;
                            --toggle-icon-width: 21px !important;
                            color: rgb(var(--rgb-disabled-color));
                          }
                        .: |
                          .card-content {
                            padding: 0;
                          }

And what i get is this:

Schermata 2023-02-06 alle 13.49.12

How to put the content inside the card? What to change in the code?
And how to have smaller fonts?

many thanks, works great

1 Like

Is it possible to have a mushroom-cover-card control multiple entities? I have four shades that I would like to operate as one (so that they are always at the same height).

yes, simple group them up and controll the group with the cover-cards.
that‘s how i do it

You could create a Threshold helper for that. That creates a new binary sensor that is on/off if the value of another specified sensor is above or below a certain value.

Then the condition on the chip would just check if the helper entity was on or off.

Mine is similar to this, but I’m also using the icon of the specific zone when not at home too. I have a handful of the most common zones already defined (e.g. work place, schools, grocery stores) with distinct icons:

{% set zn = states(entity) %}
{% if zn == ‘not_home’ %}
mdi:home-export-outline
{% else %}
{{ state_attr(‘zone.’ + zn|regex_replace(“'| |-”,“_”),‘icon’) }}
{% endif %}

Which theme are you currently using?

I created a theme and added just

mush-control-height: 15px
modes:
    light: {}
    dark: {}

and it successfully reduces the size of the bar height for the light

Dear Mush and CSS friends,

I love your guidance to achieve the following (as the beginnings of a person card):
(mind you, this is a manipulated image of my ultimate goal)

Screenshot 2023-02-06 at 20.40.57

I currently have a mushroom-template-card as the base:
Screenshot 2023-02-06 at 20.40.57 copy

And a mushroom-chip-card as the “person” picture:
Screenshot 2023-02-06 at 20.41.25

Is there any way to visually combine them as shown above ?

I do not care what type of card the picture will be, as long as it the result is achieved.

My code for the “base” mushroom-template-card:

type: custom:vertical-stack-in-card
cards:
  - type: custom:mushroom-template-card
    entity: person.admin
    icon: none
    icon_color: |
      {% if is_state(entity, 'home') %}
        #03A9F4
      {% else %}  
        grey
      {% endif %}
    primary: ''
    secondary: ''
    layout: horizontal
    tap_action:
      action: navigate
      navigation_path: /home-yaml/lichten
    badge_icon: mdi:home
    badge_color: |
      {% if is_state(entity, 'home') %}
        #357b8c
      {% else %}  
        grey
      {% endif %}
    card_mod:
      style:
        mushroom-state-info$: |
          .primary {
            font-size: 14px !important;
            position: relative;
            top: -50px;
            left: -110px;
            overflow: visible !important;
            white-space: normal !important;
          }
          .secondary {
            position: relative;
            overflow: visible !important;
            top: -52px;
            left: -155px;
          }
        mushroom-shape-icon$: |
          .shape {
            position: relative;
            left: -72px;
            top: 8px;
            box-shadow: 0px 0px 8px 6px rgba(50,150,150,0.96) !important;
          }
        .: |
          :host {
            --mush-icon-size: 96px;
            --secondary-text-color: red;
          }
          mushroom-badge-icon {
            left: 1px !important;
            top: 1px !important;
          }
          ha-card {
            --badge-icon-size: 20px;
            --badge-size: 28px;
          }
card_mod:
  style: |
    ha-card {
      height: 92px !important;
      width: 192px !important;
    }

Anyone have a solution for getting consistent card heights when secondary info is meant to be blank? I’m new to mushroom cards and this has got to be something someone else has encountered (and solved!).