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

Is it possible to utilize the user variable in an action? This doesn’t work.

- type: horizontal-stack
  cards:
    - type: custom:mushroom-template-card
      primary: Launch Navigation
      secondary: ''
      icon: mdi:target
      layout: horizontal
      icon_color: red
      tap_action:
        action: call-service
        service: script.launch_google_maps
        data:
          person: test
          users_phone: '{{ user }}'
      card_mod:
        style: |
          ha-card {
            width: 155px;
            margin-left: auto;
            margin-right: auto;
            background: rgba(var(--rgb-red), 0.1);
            margin-bottom: 12px !important;
          }

Thanks it works great!

When I use the media player card, it only displays the song name. How can I show the artist? I’m using Squeezebox.

type: custom:mushroom-media-player-card
entity: media_player.lms
use_media_info: true

This is the result:
image

1 Like

Hello, is it possible to change the distance to the edge of a “custom:mushroom-template-card”? I tried it via “padding” but it doesn’t work with card mod or styles either. Maybe it just doesn’t work with this card?
Many Thanks

Thanks, the steps, and resting heart rate are coming from the Garmin connect integration.

Here is the person’s card code.

type: custom:stack-in-card
mode: horizontal
card_mod:
  style:
    .: |
      ha-card {
        box-shadow: none;
        background: transparent;
        margin-bottom: 30px
      }
    hui-horizontal-stack-card$: |
      #root {
        justify-content: center;
      }
cards:
  - type: custom:stack-in-card
    keep:
      box_shadow: false
      outer_padding: true
    card_mod:
      style: |
        ha-card {
          box-shadow: none;
          background: transparent;
          position: relative;
          overflow: visible !important;
          padding-right: 10px;
        }

        ha-card:after {
          content: '';
          position: absolute;
          right: -8px;
          top: 25%;
          width: 1px;
          height: 45%;
          background: var(--divider-color);
        }

        :host {
          flex-grow: 0 !important;
          min-width: fit-content !important;
        }
    cards:
      - type: custom:mushroom-person-card
        entity: person.person1
        icon_type: entity-picture
        fill_container: false
        secondary_info: ''
        primary_info: ''
        layout: vertical
        card_mod:
          style:
            .: |
              :host {
                --mush-icon-size: 60px;
                --mush-badge-size: 20px;
              }

              ha-card {
                padding-bottom: 0 !important;
              }
      - type: custom:mushroom-chips-card
        alignment: center
        card_mod:
          style: |
            ha-card {
              --chip-box-shadow: none;
              --chip-spacing: 0px;
              --chip-background: transparent;
              --chip-padding: 0 3px;
            }
        chips:
          - type: template
            entity: sensor.pixel_3_xl_battery_level
            content: '{{ states(entity) }} %'
            icon: >-
              {% set bl = states(entity) | int %} {% if bl < 10 %}
              mdi:battery-outline {% elif bl < 20 %} mdi:battery-10 {% elif bl <
              30 %} mdi:battery-20 {% elif bl < 40 %} mdi:battery-30 {% elif bl
              < 50 %} mdi:battery-40 {% elif bl < 60 %} mdi:battery-50 {% elif
              bl < 70 %} mdi:battery-60 {% elif bl < 80 %} mdi:battery-70 {%
              elif bl < 90 %} mdi:battery-80 {% elif bl < 100 %} mdi:battery-90
              {% elif bl == 100 %} mdi:battery {% else %} mdi:battery-unknown {%
              endif %}
            icon_color: >-
              {% set bl = states(entity) | int %} {% if bl < 10 %} red {% elif
              bl < 20 %} red {% elif bl < 30 %} orange {% elif bl < 40 %} orange
              {% elif bl < 50 %} amber {% elif bl < 60 %} amber {% elif bl < 70
              %} green {% elif bl < 80 %} green {% elif bl < 90 %} green {% elif
              bl < 100 %} green {% elif bl == 100 %} green {% else %} grey {%
              endif %}
            tap_action:
              action: more-info
          - type: template
            entity: sensor.total_steps
            content: '{{ states(entity) }}'
            icon: mdi:walk
            icon_color: blue
            tap_action:
              action: more-info
          - type: template
            entity: sensor.resting_heart_rate
            content: '{{ states(entity) }}'
            icon: mdi:heart-pulse
            icon_color: red
            tap_action:
              action: more-info
  - type: custom:stack-in-card
    keep:
      box_shadow: false
      outer_padding: true
    card_mod:
      style: |
        ha-card {
          box-shadow: none;
          background: transparent;
          padding-left: 10px;
        }

        :host {
          flex-grow: 0 !important;
          min-width: fit-content !important;
        }
    cards:
      - type: custom:mushroom-person-card
        entity: person.person2
        icon_type: entity-picture
        fill_container: false
        secondary_info: ''
        primary_info: ''
        layout: vertical
        card_mod:
          style: |
            :host {
              --mush-icon-size: 60px;
              --mush-badge-size: 20px;
            }

            ha-card {
              padding-bottom: 0 !important;
            }
      - type: custom:mushroom-chips-card
        alignment: center
        card_mod:
          style: |
            ha-card {
              --chip-box-shadow: none;
              --chip-spacing: 0px;
              --chip-background: transparent;
              --chip-padding: 0 3px;
            }
        chips:
          - type: template
            entity: sensor.pixel_6_battery_level
            content: '{{ states(entity) }} %'
            icon: >-
              {% set bl = states(entity) | int %} {% if bl < 10 %}
              mdi:battery-outline {% elif bl < 20 %} mdi:battery-10 {% elif bl <
              30 %} mdi:battery-20 {% elif bl < 40 %} mdi:battery-30 {% elif bl
              < 50 %} mdi:battery-40 {% elif bl < 60 %} mdi:battery-50 {% elif
              bl < 70 %} mdi:battery-60 {% elif bl < 80 %} mdi:battery-70 {%
              elif bl < 90 %} mdi:battery-80 {% elif bl < 100 %} mdi:battery-90
              {% elif bl == 100 %} mdi:battery {% else %} mdi:battery-unknown {%
              endif %}
            icon_color: >-
              {% set bl = states(entity) | int %} {% if bl < 10 %} red {% elif
              bl < 20 %} red {% elif bl < 30 %} orange {% elif bl < 40 %} orange
              {% elif bl < 50 %} amber {% elif bl < 60 %} amber {% elif bl < 70
              %} green {% elif bl < 80 %} green {% elif bl < 90 %} green {% elif
              bl < 100 %} green {% elif bl == 100 %} green {% else %} grey {%
              endif %}
            tap_action:
              action: more-info
          - type: template
            entity: sensor.total_steps_2
            content: '{{ states(entity) }}'
            icon: mdi:walk
            icon_color: blue
            tap_action:
              action: more-info
          - type: template
            entity: sensor.resting_heart_rate_2
            content: '{{ states(entity) }}'
            icon: mdi:heart-pulse
            icon_color: red
            tap_action:
              action: more-info

1 Like

Could anyone provide me pointers on how to adjust the card size, so that the CCTV ones, for example, become smaller, and the alarm one can occupy more space?

p.s. The CCTV images are not in the screenshot :stuck_out_tongue:

cards:
  - cards:
      - type: custom:mushroom-entity-card
        name: Garage
        icon: mdi:garage
        entity: script.open_garage_door
        fill_container: true
        layout: vertical
        hold_action:
          action: none
        double_tap_action:
          action: none
        secondary_info: none
        tap_action:
          action: call-service
          service: script.open_garage_door
          data: {}
          target: {}
      - type: custom:mushroom-lock-card
        entity: lock.nuki_galaxy_lock
        secondary_info: state
        fill_container: true
        layout: vertical
        primary_info: name
        hold_action:
          action: none
        double_tap_action:
          action: none
        name: 'Home '
      - type: custom:mushroom-lock-card
        entity: lock.nuki_alpha_centaurious_lock
        fill_container: true
        layout: vertical
        name: Building
    type: horizontal-stack
  - cards:
      - type: custom:mushroom-light-card
        entity: switch.storage_camera
        name: Storage
        layout: vertical
        use_light_color: false
        fill_container: true
        hold_action:
          action: none
        double_tap_action:
          action: none
        icon: mdi:cctv
      - type: custom:mushroom-light-card
        entity: switch.hall_camera
        name: Hall
        layout: vertical
        use_light_color: false
        fill_container: true
        hold_action:
          action: none
        double_tap_action:
          action: none
        icon: mdi:cctv
      - type: custom:mushroom-alarm-control-panel-card
        entity: alarm_control_panel.mqtt_alarm
        states:
          - armed_away
          - armed_night
        name: Alarm
        fill_container: true
    type: horizontal-stack
  - cards:
      - type: custom:frigate-card
        cameras:
          - camera_entity: camera.hall
            live_provider: ha
    type: horizontal-stack
  - cards:
      - type: picture-entity
        show_state: false
        show_name: false
        camera_view: auto
        entity: camera.doorbell
        name: Doorbell
      - type: custom:frigate-card
        cameras:
          - camera_entity: camera.storage
            live_provider: ha
    type: horizontal-stack
type: vertical-stack

could you please share the code from your “bad” card ?

Are you able to display the memojis without the surrounding circle or does it just look like it because of the your black background?

      - type: custom:stack-in-card
        cards:
          - type: custom:mushroom-template-card
            entity: light.bad
            primary: Bad
            tap_action:
              action: toggle
            icon_color: |-
              {% if states.light.bad.state == 'on' %}
              orange
              {% else %}
              grey
              {% endif %} 
            multiline_secondary: true
            secondary: >-
              {{ '%0.1f°C' | format(state_attr('climate.temperatur_bad',

              'current_temperature')) }} ({{ '%0.0f%%' |
              format(states.sensor.heizen_bad.state | int ) }})

              {{
                  state_attr('climate.temperatur_bad', 'preset_mode') 
                    | replace('away', 'Reduziert') 
                      | replace('eco', 'Frostschutz') 
                      | replace('sleep', 'Schlafen') 
                      | replace('comfort', 'Komfort') }} - {{ '%0.0f°C' |
              format(state_attr('climate.temperatur_bad', 'temperature')) }}
            icon: mdi:shower-head
            card_mod:
              style:
                mushroom-shape-icon$: |
                  .shape {
                    box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.16) !important;
                  }
                .: |
                  mushroom-shape-icon {
                    position: absolute;
                    --icon-size: 80px;
                    top: -60px;
                    left: -30px;
                  }
                  mushroom-state-item {
                    text-align: right;
                    transform: translateX(0%);
                  }
          - type: custom:mushroom-chips-card
            alignment: justify
            chips:
              - type: light
                entity: light.bad_spiegel
                content_info: none
              - type: entity
                entity: sensor.window_bad
                content_info: none
              - type: action
                icon: mdi:dots-horizontal
                tap_action:
                  action: navigate
                  navigation_path: /lovelace-details/bad

1 Like

Can we do the same with mushroom chip cards ? If yes kindly guide.

Screenshot 2022-12-27 at 9.49.38 AM

e.g. a ring outside this wifi icon!

There is no surrounding circle on my entity pictures, to use transparent PNG you will need to upload the memoji to the www directory and set the entity_picture in YAML.

homeassistant:
  customize:
    person.person1:
      entity_picture: "/local/person1.png"
    person.person2:
      entity_picture: "/local/person2.png"
1 Like

Hello all,

first of all I would like to thank everyone who is involved in this great project, no matter if developer or here in the forum - it is unbelievable what is possible. Thank you!

I’m trying to make a nice card which shows the status of my electric car. A few details do not fit yet.

  • I still see a border at the chips cards ? What am I missing ?

  • I would like the icon from the template card to pulse ‘green’ when the car is charging.
    Like in this example here from @rhysb => “Mushroom Chip Ping animation”.

Is this possible, I have failed with my attempts so far ?

  • And one last question: can I move the text from the template card by percentage ?
    If I set this to “center”, the text sits too close to the template icon.

skoda

thx!

Code
square: true
columns: 2
type: grid
cards:
  - type: custom:vertical-stack-in-card
    cards:
      - type: custom:mushroom-template-card
        entity: sensor.evcc_lp1_connected
        multiline_secondary: true
        primary: |
          {{ states('sensor.evcc_lp1_vehicle_title') }}
        secondary: |-
          {% set connected = states(entity) %}
          {% set charging = states('sensor.evcc_lp1_charging') %}
          {% if connected == 'true' and charging == 'true' %} wird geladen ...
          {% elif connected == 'true' and charging == 'false' %} verbunden
          {% else %} nicht verbunden
          {% endif %}
        icon: mdi:car
        icon_color: |-
          {% set connected = states(entity) %}
          {% if connected == 'true' %} green
          {% else %} grey
          {% endif %}
        badge_icon: |-
          {% set charging = states('sensor.evcc_lp1_charging') %}
          {% if charging == 'true' %} mdi:flash
          {% endif %}
        badge_color: green
        fill_container: false
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.16) !important;
              }
              ha-card {
                animation: 
                {% if is_state('sensor.evcc_lp1_charging', 'true')  %} 
                 ping 2s ease-out infinite;
                {% endif %}
              }
              @keyframes ping {
                0% {
                  box-shadow: 0 0 50px 1px rgba(var(--rgb-red), 1);
                }
                100% {
                  box-shadow: 0 0 5px 10px rgba(var(--rgb-red), 0);
                }
              }
            .: |
              mushroom-shape-icon {
                position: absolute;
                --icon-size: 80px;
                top: -50px;
                left: -25px;
              }
              mushroom-state-item {
                text-align: center;
                transform: translateX(0%);
              }
      - type: custom:mushroom-chips-card
        alignment: justify
        chips:
          - type: template
            content: |-
              {{ states('sensor.evcc_lp1_vehicle_soc') }}% | 
              {{ states('sensor.evcc_lp1_target_soc') }}%
            icon: mdi:battery-charging
            icon_color: green
            double_tap_action:
              action: more-info
            tap_action:
              action: more-info
            hold_action:
              action: more-info
          - type: template
            content: >-
              {{ states('sensor.evcc_lp1_mode') }}   
              {% set phases = states('sensor.evcc_lp1_phases_active') | int %}    
              {% if phases== 1 %} | L1    
              {% else %} | L1,L2,L3    
              {% endif %}
          - type: action
            icon: mdi:dots-horizontal
            tap_action:
              action: navigate
              navigation_path: /49686a9f_evcc/dashboard

does anyone have an idea how i can make this (AC options)?

Thanks a lot! That did the trick! However, I have one question left. How can I reduce the space between the memoji and the person’s name? Currently, it looks like this which is too much spacing for my liking.

grafik

Does anybody know what the best way is to do the next thing:

image

  • Show the open/close image for the door
  • Name of the door
  • State of the door (in text)
  • At the right bottom the last changed date (in a good format)

With the mushroom entity card almost everything is automatically be done:

  - type: custom:mushroom-entity-card
    entity: binary_sensor.voordeur

but this is missing the last changed date/time. So I thought you need the template card:

type: custom:mushroom-template-card
primary: Voordeur
secondary: |
  {% if states('binary_sensor.voordeur') == 'on' %}
    Open ({{ states.binary_sensor.voordeur.last_changed }} )
  {% else %}
    Dicht ({{ states.binary_sensor.voordeur.last_changed }} )
  {% endif %}
icon: |
  {% if states('binary_sensor.voordeur') == 'on' %}
    mdi:door-open
  {% else %}
    mdi:door-closed
  {% endif %}
icon_color: |
  {% if states('binary_sensor.voordeur') == 'on' %}
    blue  
  {% else %} {% endif %}
entity: binary_sensor.voordeur

But how can I place this last_changed date/time to the bottom right?

You can adjust the spacing between picture and the primary/secondary info as follows with card_mod

:host {
   --mush-spacing: 2px;
}
1 Like

I’m already a step further, but doesn’t look optimal yet. tips anyone?

image

where is the code for this?

I checked the doc and couldn’t find any.
image

Use the visual editor in a spare dashboard and copy from there :slight_smile:

thanks. I mixed up big time between minimalist-ui and mushroom :stuck_out_tongue: