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

This explains how these symbols work :slight_smile:

2 Likes

Does anybody know how to minimize the delay between clicking the up or down arrow on a mushroom number card and the actual update of the input number value ? I’ve already tried to lower the values of ‘mush-slider-treshold’ and ‘mush-input-number-debounce’ with card-mod and in my theme but the delay of approximately 2 seconds won’t change.

I’m trying to use custom:mushroom-select-card as an overlay to a custom:button-card.
Essentially, I just want the select-option part to be visible once the card is clicked, the rest should be transparent.
I’m pretty close to the result (see code below) but two issues remain:

1- can the “bottom bar” be hidden / made transparent?

image

2- is it possible to custom size the clickable zone so it covers the full card (see gray zone when cursor hovers the card)? I’ve tried changing the font size hoping it would expand the zone but it doesn’t.

2023-10-17 102351

type: custom:layout-card
layout_type: grid
layout:
  grid-template-columns: 25% 25% 25% 25%
  grid-template-areas: |
    "A1 A2 A3 A4"
cards:
  - type: horizontal-stack
    view_layout:
      grid-area: A1
    cards:
      - type: custom:button-card
        name: ' '
        entity: input_select.ir_command_ac2_mode
        show_state: true
        show_entity_picture: true
        entity_picture: \local\!MYDATA\WEATHER\temperature2.png
        styles:
          card:
            - font-size: 2rem
            - font-weight: bold
          icon:
            - height: 4rem
            - width: 4rem
  - type: horizontal-stack
    view_layout:
      grid-area: A1
    cards:
      - type: custom:mushroom-select-card
        entity: input_select.ir_command_ac2_mode
        secondary_info: none
        icon_type: none
        fill_container: true
        card_mod:
          style:
            mushroom-select-option-control$:
              mushroom-select$: |
                .mdc-select__anchor{
                  background: none !important
                  }
                .mdc-select__selected-text {
                  color: transparent !important;
                  }
                .mdc-select__dropdown-icon {
                  fill: transparent !important;  
                }
            .: |
              ha-card {
               background: none;
               }    

1 Like

I dont normally just figure out the answer for people, but i liked the use case so here you go!

type: custom:layout-card
layout_type: grid
layout:
  grid-template-columns: 25% 25% 25% 25%
  grid-template-areas: |
    "A1 A2 A3 A4"
cards:
  - type: horizontal-stack
    view_layout:
      grid-area: A1
    cards:
      - type: custom:button-card
        name: ' '
        entity: input_select.bedroom_fan_direction
        show_state: true
        show_entity_picture: true
        entity_picture: \local\!MYDATA\WEATHER\temperature2.png
        styles:
          card:
            - font-size: 2rem
            - font-weight: bold
          icon:
            - height: 4rem
            - width: 4rem
  - type: horizontal-stack
    view_layout:
      grid-area: A1
    cards:
      - type: custom:mushroom-select-card
        entity: input_select.bedroom_fan_direction
        secondary_info: none
        icon_type: none
        fill_container: true
        card_mod:
          style:
            mushroom-select-option-control$:
              mushroom-select$: |
                .mdc-select__anchor{
                  background: none !important;
                  border-radius: 20px !important;
                }
                .mdc-line-ripple::before {
                  border-bottom-width: 0px !important;
                }
                .mdc-line-ripple::after {
                  border-bottom-width: 0px !important;
                }
                .mdc-select__selected-text {
                  color: transparent !important;
                }
                .mdc-select__dropdown-icon {
                  fill: transparent !important;  
                }
                .mdc-select {
                  position: absolute !important;
                  width: 100% !important;
                  --select-height: 97px;
                  top: 0%;
                  right: 0%;
                }
            .: |
              ha-card {
               background: none;
              }

i had to set the position to absolute for the dropdown, so it may not work well in grids. but since its already in a layout card, perhaps it will, who knows! :slight_smile:

                .mdc-line-ripple::before {
                  border-bottom-width: 0px !important;
                }

removes the line before you clicked.

                .mdc-line-ripple::after {
                  border-bottom-width: 0px !important;
                }

removes the blue line from after you have clicked.

2 Likes

Amazing. Thanks for the extra mile. Glad you like the use case =)
This will be a great building block for my dashboard. Thank you!
Just to improve my search skills, was this documented in your guide or elsewhere?

1 Like

Not really. i have a section for the selection value in the select card in my guide. but it doesnt mention removing the line.

Select Card is in the same post as the person card.
then go to the selection value sections of this post.

i did answer the question regarding the line removal recently here:

so perhaps i will update my guide to include it :slight_smile:

1 Like

Hi all,

I’m using mushroom-entity-buttons to highlight which rooms my vacuum should clean. I had the intention that every button would light up when I press it, but unfortunately they all light up when I press only one.
Is it possible because they all refer to the same script (but with different parameters) ?

Does anyone have a clue how to change that ?

Here’s my code:

          - type: horizontal-stack
            cards:

                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_room_cleaner
                      service_data:
                        room: bartjessie
                    entity: script.jarvis_room_cleaner
                    icon_height: 30px
                    icon: mdi:bed-king-outline
                    layout: vertical
                    name: Master
                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_room_cleaner
                      service_data:
                        room: joosarne
                    entity: script.jarvis_room_cleaner
                    icon_height: 30px
                    icon: mdi:bed-queen-outline
                    layout: vertical
                    name: Pubers
                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_room_cleaner
                      service_data:
                        room: bentjesse
                    entity: script.jarvis_room_cleaner
                    icon_height: 30px
                    icon: mdi:bed-single-outline
                    layout: vertical
                    name: Kids                   
          - type: horizontal-stack
            cards:
                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_room_cleaner
                      service_data:
                        room: hallway
                    entity: script.jarvis_room_cleaner
                    icon_height: 30px
                    icon: mdi:hanger
                    layout: vertical
                    name: Gang                    
                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_room_cleaner
                      service_data:
                        room: berging
                    entity: script.jarvis_room_cleaner
                    icon_height: 30px
                    layout: vertical
                    icon: mdi:vacuum-outline
                    name: Berging
                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_room_cleaner
                      service_data:
                        room: kitchen
                    entity: script.jarvis_room_cleaner
                    icon_height: 30px
                    icon: mdi:silverware-fork-knife
                    name: Keuken
                    layout: vertical
            columns: 4
            square: false
    

Thanks a lot in advance !

Kr,

Bart

Yes. it will be because your entity is the same script. your tap action has no bearing on what the card does. it is the fact that the script is being ran that changes the state of the entity in your card, which is the same between all cards.

I would make the amount of scripts you need for each card. they can even do identical things and you can keep your service data as is, if you like. but the scripts need to be different if you are referring to them in in this way as your entity.

Thanks Dimitri,

The only problem is, as far as I think it’s a problem, is that the script is needed to fill up a queue. With other words, more buttons can be pushed at the same time that fill the queue. Don’t know if ‘a script per button’ will result in the same.

I’ll show you the script below:

jarvis_room_cleaner:
  alias: Jarvis Room Cleaner
  max: 20
  mode: queued
  fields:
    room:
      name: room
      required: true
      selector:
        select:
          options:
          - bathroom
          - bedroom
          - hallway
          - kitchen
          - living_room
          - joosarne
          - bentjesse
          - berging
  sequence:
  - choose:
    - conditions:
      - condition: or
        conditions:
        - condition: state
          entity_id: vacuum.jarvis
          state: cleaning
        - condition: state
          entity_id: vacuum.jarvis
          state: error
      sequence:
      - wait_for_trigger:
        - platform: state
          entity_id: vacuum.jarvis
          to: returning
        - platform: state
          entity_id: vacuum.jarvis
          to: docked
        continue_on_timeout: false
        timeout: 01:30:00
      - service: vacuum.send_command
        target:
          device_id: xxxxxxxxxxxxxxxxxxx
        data_template:
          command: app_segment_clean
          params: >
           {% set room_id = states("input_number.roborock_room_enum_" + room)
            | int(0) %} {{ room_id }}
      - wait_for_trigger:
        - platform: state
          entity_id: vacuum.jarvis
          to: returning
        - platform: state
          entity_id: vacuum.jarvis
          to: docked
        continue_on_timeout: false
        timeout: 01:30:00
    - conditions:
      - condition: or
        conditions:
        - condition: state
          entity_id: vacuum.jarvis
          state: returning
        - condition: state
          entity_id: vacuum.jarvis
          state: docked
        - condition: state
          entity_id: vacuum.jarvis
          state: idle
      sequence:
      - service: vacuum.send_command
        target:
          device_id: xxxxxxxxxxxxxxxxxxxx
        data_template:
          command: app_segment_clean
          params: >
            {% set room_id = states("input_number.roborock_room_enum_" + room)
             | int(0) %} {{ room_id }}

      - wait_for_trigger:
        - platform: state
          entity_id: vacuum.jarvis
          to: returning
        - platform: state
          entity_id: vacuum.jarvis
          to: docked
        continue_on_timeout: false
        timeout: 01:30:00
    default: []

Kr,

Bart

This may not be good advice, but a script can run a script. so again maybe make a script per button, but each just calls your main script?

sounds like plan ! I’ll give it a try and report back with feedback

thx again !

still related to the same overlay card:
not a big deal but wondering if this is also customizable;
once a selection is made, the mushroom select card stays “selected” (greyed out) unless you click elsewhere.
Any way to hide / make this transparent as well? Thanks!

Animation

1 Like

this should do it. but then your hover is also gone.

                .mdc-select__ripple::before {
                  background: none !important;
                }

you could add a new hover back like this:

                .mdc-select__anchor:hover {
                  background-color: rgba(var(--rgb-grey), 0.05) !important;
                }
1 Like

:+1: Perfect. Thank you!
Animation

3 Likes

Unfortunately, the HA-alerts do not work in the template-card:
e.g.

<ha-alert alert-type="error"> Your alert text </ha-alert>

Can I integrate them by other code or is it possible to integrate them?

I’ve made a button-specific script to call the main script after push of the button, but all buttons are still activated, probably because of the fact that the script calls the same entity.

jarvis_bathroom:
  alias: Jarvis Bathroom
  sequence:
  - service: script.jarvis_room_cleaner
    data:
      room: bathroom

And the script behind my bathroom button:

                  - type: custom:mushroom-entity-card
                    tap_action:
                      action: call-service
                      service: script.jarvis_bathroom
                    entity: script.jarvis_bathroom
type or paste code here

So, this doesn’t work and I can’t figure out why not

Kr,

Bart

Can you show me the yaml for the entire card please?

Spotify Card V3 with Room Presence

Page Properties:

  • White and Dark Theme Ready.
  • 2 different card styles for white and dark template in one single card!!
  • Design changes on white theme.
  • Switch between white and dark modes with one click
  • Beatiful artwork design for every song.
  • Room Presence. Start the music in your last entered room (More effective on single occupancy)
  • Media Player controls
  • Music Follow. Let the music follow you around the house automatically.
  • Hidden playlist. Activate your favorite songs with a single click.
  • Exclusively designed for Spotify control.
  • Ambilight animations. Glowing light in all over the card.
  • Browser Mode integration.
  • Minimalistic design. You can hide spotify playlist.
  • The playing media player is highlighted in a circle.
  • Rewind - Forward your music.
  • Developed on the basis of Amazon Echo devices but you can also use it with any other media player type.
  • Can easily be installed with the given manual

You can find the page code and ultra-detailed user manual in the link below.:

11 Likes

Why not use simple input boolean for each area and then one script that builds the list of rooms based on the input boolean state?

alias: Run Vacuum
sequence:
  - service: roborock.vacuum_clean_segment
    data_template:
      segments: |
        {% set vacrooms = namespace(roomid=[]) %}
        {% for rooms in state_attr('sensor.roborock_rooms','rooms') -%}
          {% if is_state(rooms.boolean,'on') %}
            {% set room = rooms.id %}
            {% set vacrooms.roomid = vacrooms.roomid + [room] %}
          {% endif %}
        {%- endfor %}
        {{ vacrooms.roomid }}
    target:
      entity_id: vacuum.roborock_s7
mode: single
icon: mdi:robot-vacuum

With a series of input booleans created from a REST sensor and a local JSON file (probably a better way):

{
    "rooms": [
        {
            "name": "kitchen",
            "boolean": "input_boolean.vac_kitchen",
            "id": "17"
            },
        {
            "name": "dining_room",
            "boolean": "input_boolean.vac_dining_room",
            "id": "16"
            },
        {
            "name": "foyer",
            "boolean": "input_boolean.vac_foyer",
            "id": "18"
            },
        {
            "name": "laundry",
            "boolean": "input_boolean.vac_laundry",
            "id": "20"
            },
        {
            "name": "living_room",
            "boolean": "input_boolean.vac_living_room",
            "id": "19"
            },
        {
            "name": "master_bedroom",
            "boolean": "input_boolean.vac_master_bedroom",
            "id": "21"
            },
        {
            "name": "master_bathroom",
            "boolean": "input_boolean.vac_master_bathroom",
            "id": "22"
            },
        {
            "name": "guest_bathroom",
            "boolean": "input_boolean.vac_guest_bathroom",
            "id": "23"
            }
    ],
    "points": [
        {
            "name": "sink",
            "x": 17989,
            "y": 25491
         }
    ]
}

And

##
## Roborock Rooms 
##
- platform: rest
  name: roborock_rooms
  resource: http://192.168.1.245:8123/local/Roborock/roborock.json
  value_template: "{{ now() }}"
  json_attributes:
    - rooms
    - points

image

I select one or more rooms and push “Clean” which runs the “Run Vacuum” script. One additional script turns off the buttons when the vacuum returns to the dock.

4 Likes

Hello all,

Not sure if this is the right spot for this…so please kindly correct me if I’m wrong!
After recent updates to HA, Mushroom Card, Card Mod, etc. I’ve noticed that my chip-card automations no longer work.
Apparently there is some language adjustments but I have not had success finding documentation on these changes.

Hoping someone has a good idea on how to resolve this.
Please see below my setup:

And the below code that powers it:
I know it’s a lot, so please focus on the last lines for the card mod, just wanted to show it all in case it’s helpful at all (a lot of tap-actions have been removed as there is a character limit here!)

type: horizontal-stack
cards:
  - type: custom:mushroom-chips-card
    chips:
      - type: entity
        entity: person.m
        use_entity_picture: true
      - type: entity
        entity: person.r
        use_entity_picture: true
      - type: template
        icon: |-
          {% if is_state('input_boolean.alarm_switch', 'on') %}
            mdi:home-alert
          {% else %} 
            mdi:security
          {% endif %}
        entity: alarm_control_panel.blink_cameras
        icon_color: >-
          {% if is_state('input_boolean.alarm_switch', 'on') %}
            red
          {% elif is_state('alarm_control_panel.blink_cameras', 'armed_away')
          %} 
            green
          {% elif is_state('alarm_control_panel.blink_cameras', 'disarmed') %}
            blue
          {% endif %}  
        content: >-
          {% if is_state('input_boolean.alarm_switch', 'on') %}
            INTRUDER!
          {% elif is_state('alarm_control_panel.blink_cameras', 'armed_away')
          %} 
            Armed
          {% elif is_state('alarm_control_panel.blink_cameras', 'disarmed') %}
            Disarmed
          {% endif %}       
      - type: entity
        entity: counter.chore_counter
        name: Chores Completed!
        icon: mdi:vacuum
        use_entity_picture: false
      - type: weather
        entity: weather.home
        show_conditions: false
        show_temperature: true
      - type: entity
        entity: sensor.processor_use
      - type: template
        icon: >-
          {% if is_state('binary_sensor.lumi_lumi_sensor_motion_aq2_iaszone',

          'unavailable') or
          is_state('binary_sensor.closet_motion_sensor_iaszone','unavailable')
          or is_state('binary_sensor.foyer_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.hallway_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.office_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.kitchen_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.living_room_motion_sensor_iaszone','unavailable')
          %}
            mdi:emoticon-confused-outline
          {% elif is_state('binary_sensor.motion_sensors', 'on') %}
            mdi:motion-sensor
          {% else %} 
            mdi:motion-sensor-off
          {% endif %}
        entity: binary_sensor.motion_sensors
        icon_color: >-
          {% if is_state('binary_sensor.lumi_lumi_sensor_motion_aq2_iaszone',

          'unavailable') or
          is_state('binary_sensor.closet_motion_sensor_iaszone','unavailable')
          or is_state('binary_sensor.foyer_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.hallway_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.office_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.kitchen_motion_sensor_iaszone','unavailable')
          or
          is_state('binary_sensor.living_room_motion_sensor_iaszone','unavailable')
          %}
            red
          {% elif is_state('binary_sensor.motion_sensors', 'on') %}
            yellow
          {% else %} 
            grey
          {% endif %}
      - type: conditional
        conditions:
          - entity: timer.laundry_tts_second_reminder
            state: active
        chip:
          type: template
          entity: timer.laundry_tts_second_reminder
          icon: mdi:washing-machine-alert
          icon_color: red
          content: Laundry!?
          tap_action: null
      - type: conditional
        conditions:
          - entity: timer.laundry_tts_first_reminder
            state: active
        chip:
          type: template
          entity: timer.laundry_tts_first_reminder
          icon: mdi:washing-machine
          icon_color: yellow
          content: null
          tap_action: null
      - type: template
        icon: |-
          {% if is_state('media_player.speakers', 'on') %}
            mdi:speaker-wireless        
          {% elif is_state('media_player.speakers', 'playing') %}
            mdi:speaker-wireless               
          {% else %} 
            mdi:speaker
          {% endif %}
        entity: media_player.speakers
        icon_color: |-
          {% if is_state('media_player.speakers', 'on') %}
            blue
          {% elif is_state('media_player.speakers', 'playing') %}
            blue
          {% else %}
            grey
          {% endif %}
      - type: entity
        entity: button.tab_a8_load_start_url
        name: Reload
        content_info: name
        tap_action:
          action: toggle
      - type: template
        entity: sensor.days_since_fed_leo
        icon: mdi:snake
        content: |
          {{states('sensor.days_since_fed_leo')}} days ago
        icon_color: |-
          {% if states('sensor.days_since_fed_leo') |int >13 %}
            red
          {% elif states('sensor.days_since_fed_leo') |int >7 %}
            yellow
          {% endif %}
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            data:
              title: Did you feed Leo?
              content:
                type: grid
                columns: 1
                square: false
                cards:
                  - type: custom:button-card
                    entity: input_boolean.fed_leo_switch
                    name: Tap here if you fed Leo!
                    size: 40px
                    style: |
                      ha-card {
                        background: radial-gradient(rgb(0,0,0, 0%) 45%, rgb(0,0,0, 50%));
                        border: none;
                       }                
                  - type: entities
                    style: |
                      ha-card {
                        background: radial-gradient(rgb(0,0,0, 0%) 45%, rgb(0,0,0, 50%));
                        border: none;
                       }
                    entities:
                      - entity: input_datetime.tank_heater_on_time
                        name: Tanks On
                      - entity: input_datetime.tank_heater_off_time
                        name: Tanks Off
                      - entity: switch.tank_lights
                    title: 'Tank Heaters '
                    show_header_toggle: false
      - type: template
        entity: binary_sensor.garage_door_sensor_opening
        icon: >-
          {% if is_state('binary_sensor.garage_door_sensor_opening', 'on' ) %}
            mdi:garage-alert
          {% elif is_state('binary_sensor.garage_door_sensor_opening', 'off' )
          %}
            mdi:garage
          {% endif %} 
        icon_color: >-
          {% if is_state('binary_sensor.garage_door_sensor_opening', 'on' ) %}
            red
          {% elif is_state('binary_sensor.garage_door_sensor_opening', 'off' )
          %}
            green
          {% endif %} 
        content: >-
          {% if is_state('binary_sensor.garage_door_sensor_opening', 'on' ) %}
            Garage Open! 
          {% elif is_state('binary_sensor.garage_door_sensor_opening', 'off' )
          %}
            
          {% endif %} 
        tap_action:
          action: more-info
    alignment: center
    card_mod:
      style:
        mushroom-template-chip:nth-child(3)$: |
          ha-icon {
            {{ 'animation: rotation 3s linear infinite;' if is_state('alarm_control_panel.blink_cameras', 'armed_away') }}
          }
          @keyframes rotation {
            0% {
              transform: rotate(0deg);
            }
            100% {
              transform: rotate(360deg);
            }
          }    
          ha-icon {
            {{ 'animation: pulse 0.7s  infinite; transform-origin: 50% 90%' if is_state('input_boolean.alarm_switch', 'on')}}
          }
          @keyframes pulse {
            0% { transform: scale(1); }
            10% { transform: scale(2); }
            17% { transform: scale(2.5); }
            25% { transform: scale(3.5); }        
            33% { transform: scale(1.5); }
            60% { transform: scale(1); } 
          }      
        mushroom-template-chip:nth-child(10)$: |
          ha-icon {
            {{ 'animation: boing 2s  infinite; transform-origin: 50% 90%' if is_state('media_player.speakers', 'on') or is_state('media_player.speakers', 'playing') }}
          }
          @keyframes boing {
            0% {transform: scale3d(1, 1, 1); }
            10% {transform: scale3d(1.5, 0.75, 1); }
            15% {transform: scale3d(0.75, 1.5, 1); }
            20% {transform: scale3d(1.25, 0.85, 1); }        
            30% {transform: scale3d(0.95, 1.15, 1); }
            40% {transform: scale3d(1.5, 0.95, 1); }   
            60% {transform: scale3d(1, 1, 1; }
          }                 
        mushroom-template-chip:nth-child(7)$: |
          ha-icon {
            {{ 'animation: pulse 3s linear infinite; transform-origin: 50% 60%;' if is_state('binary_sensor.motion_sensors', 'on') }}
          }
          @keyframes pulse {
            0% { transform: scale(1); }
            10% { transform: scale(1.1); }
            17% { transform: scale(1.05); }
            33% { transform: scale(1.25); }
            60% { transform: scale(1); } 
          }        
        mushroom-template-chip:nth-child(12)$: |
          ha-icon {
            {{ 'animation: pulse 0.7s  infinite; transform-origin: 50% 90%' if states('sensor.days_since_fed_leo') |int >13}}
          }
          @keyframes pulse {
            0% { transform: scale(1); }
            10% { transform: scale(1.5); }
            17% { transform: scale(1.75); }
            25% { transform: scale(2); }        
            33% { transform: scale(1.5); }
            60% { transform: scale(1); } 
          }          
view_layout:
  grid-area: header
  show:
    mediaquery: '(min-width: 800px)'