Mushroom Inspiration!

A few weeks back I saw the great work on a minimalist inspired room card by @theandouz and had the same thoughts as @PatrickJanson for a smaller version to be able to fit more cards on the screen at once.

I re-worked things a bit to make it smaller and added a few extra “features”.

  • The secondary text displays temp and humidity, color is based on the room’s climate devices hvac state (heating, cooling) as well as an icon to quickly display the state.
  • The light chip is constant and supports the light entity’s color or a default color if there isn’t one. Single tap brings up a quick popup to show all light entities in that room.
  • Can display up to 4 conditional chips at a time (You can add as many as you like but only 4 display) with certain chips bringing up a popup including the beautiful media card from @rhysb. I personally preferred the conditional chips to just display the icon without the circle around it. I found it easier to notice.

minimalist-style-card

Here’s the code. Certainly open to any additional ideas or tweaks.

Minimalist Room Card
type: custom:vertical-stack-in-card
cards:
  - type: custom:mushroom-template-card
    entity: group.master_bedroom
    icon: mdi:bed
    icon_color: |
      {% if is_state(entity, 'on') %}
        #03A9F4
      {% else %}  
        grey
      {% endif %}
    primary: Master Bedroom
    secondary: >-
      {{ states('sensor.thermostat_master_bedroom_local_temperature') | round(0)
      }}°C | {{ states('sensor.thermostat_master_bedroom_humidity') |
      round(0) }}%
    layout: horizontal
    tap_action:
      action: navigate
      navigation_path: /mobile-dashboard/master-bedroom
    double_tap_action:
      action: navigate
      navigation_path: /mobile-dashboard/master-bedroom
    hold_action:
      action: toggle
    badge_icon: >
      {% if is_state_attr('climate.thermostat_master_bedroom', 'hvac_action',
      'heating') %}
        mdi:radiator
      {% elif is_state_attr('climate.thermostat_master_bedroom', 'hvac_action',
      'cooling') %}
        mdi:snowflake
      {% else %}  {% endif %}
    badge_color: >
      {% if is_state_attr('climate.thermostat_master_bedroom', 'hvac_action',
      'heating') %}
        red
      {% elif is_state_attr('climate.thermostat_master_bedroom', 'hvac_action',
      'cooling') %}
        #03A9F4
      {% else %} {% endif %}
    card_mod:
      style:
        mushroom-state-info$: |
          .primary {
            font-size: 16px !important;
            position: relative;
            top: -50px;
            left: -155px;
            overflow: visible !important;
            white-space: normal !important;
          }
          .secondary {
            position: relative;
            overflow: visible !important;
            top: -52px;
            left: -155px;
          }
        mushroom-shape-icon$: |
          .shape {
            position: relative;
            left: -43px;
            top: 55px;
          }
        .: |
          :host {
            --mush-icon-size: 146px;
            --secondary-text-color: 
              {% if is_state_attr('climate.thermostat_master_bedroom', 'hvac_action', 'heating') %}
                red
              {% elif is_state_attr('climate.thermostat_master_bedroom', 'hvac_action', 'cooling') %}
                #03A9F4
              {% else %}
                #6c6c75
              {% endif %}
          }
        style: |
          mushroom-badge-icon {
            left: 69px;
            top: 25px;
          }
  - type: custom:mushroom-template-card
    primary: none
    icon_color: disabled
    icon: mdi:lightbulb
    secondary: none
    entity: light.master_bedroom_light
    tap_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.popup
        data:
          title: Master Bedroom Lights
          content:
            type: vertical-stack
            cards:
              - type: custom:mushroom-light-card
                entity: light.master_bedroom_light
                name: Master Bedroom Light
                use_light_color: true
                show_brightness_control: true
                show_color_temp_control: false
                show_color_control: false
                collapsible_controls: true
                card_mod:
                  style: |
                    ha-card {
                      --ha-card-border-width: 0;
                    }
              - type: custom:mushroom-light-card
                entity: light.closet_light
                use_light_color: true
                show_brightness_control: true
                show_color_temp_control: false
                show_color_control: false
                collapsible_controls: true
                card_mod:
                  style: |
                    ha-card {
                      --ha-card-border-width: 0;
                    }
            card_mod:
              style: |
                ha-card {
                  --ha-card-border-width: 0;
                }
    hold_action:
      action: toggle
    double_tap_action:
      action: more-info
    card_mod:
      style:
        mushroom-shape-icon$: |
          .shape {
            {% if is_state(config.entity, 'on') %}
              {% if state_attr(config.entity, 'rgb_color') == none %}
                --icon-color: rgb(255,190,137) !important;
                --shape-color: rgb(255,190,137, 0.2 ) !important;
              {% else %}
                {% set r = state_attr(config.entity, 'rgb_color')[0] %}
                {% set g = state_attr(config.entity, 'rgb_color')[1] %}
                {% set b = state_attr(config.entity, 'rgb_color')[2] %}
                --icon-color: rgb( {{r}}, {{g}}, {{b}} ) !important;
                --shape-color: rgba( {{r}}, {{g}}, {{b}}, 0.2 ) !important;
              {% endif %}
            {% endif %}
          }
        .: |
          ha-card {
            width: 66px;
            margin-left: 68%;
            top: -178px;
            background: none;
          }
          :host {
            --mush-icon-size: 38px;
          }
  - type: custom:mushroom-chips-card
    chips:
      - type: conditional
        conditions:
          - entity: input_boolean.in_bed
            state: 'on'
        chip:
          type: entity
          entity: input_boolean.in_bed
          icon: mdi:bed
          icon_color: blue
          content_info: none
      - type: conditional
        conditions:
          - entity: binary_sensor.motion_master_bedroom_occupancy
            state: 'on'
        chip:
          type: entity
          entity: binary_sensor.motion_master_bedroom_occupancy
          icon: mdi:motion-sensor
          icon_color: blue
          content_info: none
      - type: conditional
        conditions:
          - entity: fan.master_bedroom_fan
            state: 'on'
        chip:
          type: entity
          entity: fan.master_bedroom_fan
          icon: mdi:fan
          icon_color: blue
          content_info: none
          tap_action:
            action: fire-dom-event
            browser_mod:
              service: browser_mod.popup
              data:
                title: Master Bedroom Fan
                content:
                  type: custom:mushroom-fan-card
                  entity: fan.master_bedroom_fan
                  name: Master Bedroom Fan
                  icon_animation: true
                  fill_container: false
                  show_percentage_control: true
                  show_oscillate_control: false
                  collapsible_controls: true
                  card_mod:
                    style: |
                      ha-card {
                        --ha-card-border-width: 0;
                      }
      - type: conditional
        conditions:
          - entity: switch.plug_master_bedroom
            state: 'on'
        chip:
          type: entity
          entity: switch.plug_master_bedroom
          icon: mdi:power-plug
          icon_color: blue
          content_info: none
          tap_action:
            action: fire-dom-event
            browser_mod:
              service: browser_mod.popup
              data:
                title: Master Bedroom Plugs
                content:
                  type: custom:mushroom-entity-card
                  entity: switch.plug_master_bedroom
                  name: Master Bedroom Plug
                  icon: mdi:power-plug
                  icon_color: '#03A9F4'
                  tap_action:
                    action: toggle
                  card_mod:
                    style: |
                      ha-card {
                        --ha-card-border-width: 0;
                      }
      - type: conditional
        conditions:
          - entity: media_player.emby_bedroom
            state: playing
        chip:
          type: entity
          entity: media_player.emby_bedroom
          icon: mdi:play-pause
          icon_color: blue
          content_info: none
          tap_action:
            action: fire-dom-event
            browser_mod:
              service: browser_mod.popup
              data:
                title: Master Bedroom Media Player
                content:
                  type: custom:stack-in-card
                  cards:
                    - type: custom:mushroom-media-player-card
                      entity: media_player.emby_bedroom
                      icon: mdi:play
                      use_media_info: true
                      use_media_artwork: false
                      show_volume_level: false
                      media_controls:
                        - play_pause_stop
                        - previous
                        - next
                      volume_controls:
                        - volume_buttons
                        - volume_set
                      fill_container: false
                      card_mod:
                        style: |
                          mushroom-shape-icon {
                            display: flex;
                            {% set media_type = state_attr(config.entity, 'media_content_type') %}
                            {% if media_type == 'tvshow' %}
                              --card-mod-icon: mdi:television-classic;
                              animation: flicker 1s linear infinite alternate;
                            {% elif media_type == 'movie' %}
                              --card-mod-icon: mdi:movie-roll;
                              animation: spin 2s linear infinite reverse;
                            {% elif media_type == 'music' %}
                              --card-mod-icon: mdi:music;
                              animation: beat 1.3s ease-out infinite both;
                            {% elif media_type == 'playlist' %}
                              --card-mod-icon: mdi:music;
                              animation: beat 1.3s ease-out infinite both;
                            {% else %}
                              --card-mod-icon: mdi:play;
                            {% endif %}
                          }
                          @keyframes flicker {
                            0%, 31.98%, 32.98%, 34.98%, 36.98%, 39.98%, 67.98%, 68.98%, 95.98%, 96.98%, 97.98%, 98.98%, 100% { --icon-color: rgba(var(--rgb-indigo), 1); }
                            32%, 33%, 35%, 36%, 37%, 40%, 68%, 69%, 96%, 97%, 98%, 99% { --icon-color: rgba(var(--rgb-indigo), 0.6); }
                          }
                          @keyframes beat {
                            0%, 60% { --icon-symbol-size: 21px; }
                            5%, 17%, 57% { --icon-symbol-size: 22px; }
                            10%, 20%, 51% { --icon-symbol-size: 23px; }
                            25%, 45% { --icon-symbol-size: 24px; }
                            30%, 39% { --icon-symbol-size: 25px; }
                            33% { --icon-symbol-size: 26px; }
                          }
                          ha-card {
                            --ha-card-border-width: 0;
                          }
                          ha-card:before {
                            transform: translate3d(0,0,0);
                            -webkit-transform: translate3d(0,0,0);
                            content: "";

                            background: url('/local/idle_art.png') center no-repeat;
                            {% if not is_state(config.entity, 'idle') %}
                              background: url( '{{ state_attr(config.entity, "entity_picture") }}') center no-repeat;
                            {% endif %}

                            background-size: contain;
                            margin: 4px 4px 16px;
                            filter: drop-shadow(4px 4px 6px rgba(0, 0, 0, 0.5));
                            border-radius: var(--control-border-radius);

                            {% set media_type = state_attr(config.entity, 'media_content_type') %}
                            {% if media_type == 'tvshow' %}
                              aspect-ratio: 16 / 9;
                            {% elif media_type == 'movie' %}
                              aspect-ratio: 2 / 3;
                            {% else %}
                              aspect-ratio: 1 / 1;
                            {% endif %}
                          }
                    - type: conditional
                      conditions:
                        - entity: media_player.emby_bedroom
                          state_not: 'off'
                        - entity: media_player.emby_bedroom
                          state_not: idle
                      card:
                        entity: media_player.emby_bedroom
                        hide:
                          icon: true
                          name: true
                          runtime: true
                          source: true
                          power: true
                          state_label: true
                          volume: true
                          info: true
                          progress: false
                          controls: true
                        more_info: false
                        type: custom:mini-media-player
                        toggle_power: false
                        group: true
                        card_mod:
                          style:
                            mmp-progress$: |
                              paper-progress {
                                {{ '--paper-progress-container-color: rgba(var(--rgb-indigo-color), 0.2) !important;' if is_state(config.entity, 'playing') }}
                              }
                            .: |
                              ha-card {
                                margin: 0px 12px 12px;
                                --mmp-progress-height: 12px !important;
                                height: var(--mmp-progress-height);
                                --mmp-accent-color: rgb(var(--rgb-indigo-color));
                                --mmp-border-radius: 12px !important;
                                --ha-card-border-width: 0;
                              }
                  card_mod:
                    style: |
                      ha-card:before {
                        transform: translate3d(0,0,0);
                        -webkit-transform: translate3d(0,0,0);
                        content: "";
                        position: absolute;
                        height: 100%;
                        width: 100%;

                        background: url('/local/idle_art.png') center no-repeat;
                        {% if not is_state('media_player.emby_bedroom', 'idle') %}
                          background: url( '{{ state_attr('media_player.emby_bedroom', "entity_picture") }}' ) center no-repeat;
                        {% endif %}

                        filter: blur(150px) saturate(200%);
                        background-size: 100% 100%;
                      }
                      ha-card {
                        transform: translate3d(0,0,0);
                        -webkit-transform: translate3d(0,0,0);
                      }
    card_mod:
      style:
        .: |
          ha-card {
            width: 66px;
            margin-left: 76%;
            top: -186px;
            background: none;
            --chip-border-width: 0;
          }
          :host {
            --mush-icon-size: 20px;
            --mush-chip-spacing: -2.9px
          }
card_mod:
  style: |
    ha-card {
      height: 178px !important;
      width: 178px !important;
    }

60 Likes