Mushroom Cards - Build a beautiful dashboard easily πŸ„ (Part 2)

Happy to assist!!

Just realized when the fan is off the icon does not go back to default color.

I am working on multiple threads. Can you post the code? It helps me expedite a resolution. :grinning:

1 Like

oh I meant the code you added the space for the timer. I completely missed that it does not go back to default. So expecting this

image

type: custom:stack-in-card
cards:
  - type: custom:mushroom-template-card
    entity: switch.bathroom_ixl_l1
    icon: mdi:fan
    icon_color: yellow
    primary: Bathroom Fan
    secondary: |
      {{states('switch.bathroom_ixl_l1') }}       
    card_mod:
      style:
        mushroom-state-info$: |
          .secondary::after {
            content: "{% set f = state_attr('timer.bathroom_fan', 'finishes_at') %} {{ "" if f
             == None else (as_datetime(f) - now()).total_seconds() |
             timestamp_custom('%H:%M:%S', false) }}";
            position: absolute;
            top:29px;
            left: 90px;
            color: lime;
            display: flex;
                   }
        .: |
          ha-card {
           padding-bottom: 10px !important;
           }

This should do it…

type: custom:stack-in-card
cards:
  - type: custom:mushroom-template-card
    entity: switch.bathroom_ixl_l1
    icon: mdi:fan
    icon_color: |
      {{ 'yellow' if is_state(config.entity, 'on') else 'grey' }}
    primary: Bathroom Fan
    secondary: |
      {{states(config.entity) }}       
    card_mod:
      style:
        mushroom-state-info$: |
          .secondary::after {
            content: "{% set f = state_attr('timer.bathroom_fan', 'finishes_at') %} {{ "" if f
             == None else (as_datetime(f) - now()).total_seconds() |
             timestamp_custom('%H:%M:%S', false) }}";
            position: absolute;
            top:29px;
            left: 90px;
            color: lime;
            display: flex;
                   }
        .: |
          ha-card {
           padding-bottom: 10px !important;
           }
1 Like

@LiQuid_cOOled after our discussion yesterday I have updated:

Thanks for the new style of template, much easier to follow.

THEMES FOR STICKY FLOATING NAVIGATION MENU - All Devices - Mushroom Chips Card

FULL CODE FOR CARD IS AVAILABLE FROM THIS LINK

CARD-MOD COLOURED PEBBLE

  • No Transparency

CARD-MOD COLOURED GLASS

  • Allows to see through buttons and any information they may be blocking

INNER GLOW

  • Allows to see through buttons and any information they may be blocking

INNER GLOW OUTLINE

  • Allows to see through buttons and any information they may be blocking

DASHBOARD MUSHROOM THEME SELECTOR IS HERE

  • custom:mushroom-select-card
  • Add to dashboard via GUI
  • Change themes right from the dashboard

image

Awesome. Any reason why this button shows on/off as opposed to On/Off like my other buttons?

Regular button

image

type: custom:mushroom-light-card
entity: switch.bathroom_ixl_l1
icon: mdi:lightbulb-on
name: Bathroom Light
icon_color: yellow

as opposed to

image
image

It the way the device reports the state. It is different amongst different devices. With a tempalte card you can use something similar to this:

 secondary: |
       {{ 'On' if is_state(config.entity, 'on') else 'Off' }}   

Legendary stuff

                                              - type: horizontal-stack
                                                cards:
                                                  - type: custom:mushroom-template-card
                                                    secondary: Oefenzaal
                                                  - type: custom:mushroom-chips-card
                                                    chips:
                                                      - type:  template
                                                        tap_action:
                                                          action: perform-action
                                                          perform_action: script.climate_increase_decrease_temp_airco
                                                          target: {}
                                                          data:
                                                            entity_id: input_number.volume_oefenzaal
                                                            step: -0.2
                                                        icon: mdi:minus
                                                  - type: custom:mushroom-template-card
                                                    secondary: '{{ states(''input_number.volume_oefenzaal'')}}'
                                                  - type: custom:mushroom-chips-card
                                                    chips:
                                                      - type:  template
                                                        tap_action:
                                                          action: perform-action
                                                          perform_action: script.climate_increase_decrease_temp_airco
                                                          target: {}
                                                          data:
                                                            entity_id: input_number.volume_oefenzaal
                                                            step: +0.2
                                                        icon: mdi:plus

I want the - temp and + closer to each other and more space for the first mushroom card, how do I achieve this ?

I’d suggest using the layout-card Swap your entities for mine.

type: custom:layout-card
layout_type: custom:grid-layout
layout:
      grid-template-columns: 40% 20% 10% 10%
      margin: 0px 0px 0px 0px
cards:
  - type: custom:mushroom-template-card
    secondary: Oefenzaal
  - type: custom:mushroom-template-card
    secondary: "{{ states('input_number.sprinkler_number')}}"
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        tap_action:
          action: perform-action
          perform_action: script.sprinkler_timer_finish
          target: {}
          data:
            entity_id: input_number.sprinkler_number
            step: 0.2
        icon: mdi:plus
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        tap_action:
          action: perform-action
          perform_action: script.sprinkler_timer_finish
          target: {}
          data:
            entity_id: input_number.sprinkler_number
            step: -0.2
        icon: mdi:minus

image

1 Like

I do similar, using a mushroom template card:

image

type: custom:mushroom-template-card
primary: Desk Plug
secondary: >-
  {{states('switch.desk_plug') | title }} Β·
  {{states('sensor.desk_plug_power')}}W
icon: mdi:desk
entity: switch.desk_plug
icon_color: |-
  {% if is_state('switch.desk_plug', 'on') %}
    blue
  {% else %}
    grey
  {% endif %}

Your code appears to be fine.

I’d look at your Display precision for that device

Can you use this instead ?

{{ states(config.entity) | title }}

I was replying to a post above

Not sure I have seen that method before. If you want to display an attribute I use something like this:

secondary: |
      {{ state_attr('light.toilet_1', 'max_mireds') }}

Not to display an attribute, to capitalise the state, instead of this:

 secondary: |
       {{ 'On' if is_state(config.entity, 'on') else 'Off' }}   

This is one method I know about. Your method works well, apparently I missed your point. Appreciate the education, always learning! :brain:

    secondary: |
      {{states(config.entity)}}   
    card_mod:
      style:
        mushroom-state-info$: |
          .secondary { 
            text-transform: capitalize;
            }

These can be used too

``
{{ states(β€˜sensor.devonport_fire_danger_0’) | upper }}

      {{ states('sensor.devonport_fire_danger_0') | capitalize }}
2 Likes

Hello,

sorry for my bad paint skills :slight_smile:

How can i change reduze the padding on the left side.

Screenshot 2025-01-17 133857

type: custom:mushroom-template-card
entity: switch.ps5_tom_power
primary: PS5 Ben
secondary: |
  {% if is_state('switch.ps5_726_power', 'on') %}
    {% if is_state('sensor.ps5_726_activity', 'idle') %}
      Ruhemodus
    {% elif is_state('sensor.ps5_726_activity', 'playing') %}
      {{ state_attr('sensor.ps5_726_activity', 'title_name') or states('sensor.ps5_726_activity') }}
    {%- else -%}
      {{ state_attr('sensor.ps5_726_activity', 'title_name') or states('sensor.ps5_726_activity') }}
    {%- endif -%}
  {%- elif is_state('switch.ps5_726_power', 'unavailable') -%}
   Aus
  {%- elif is_state('switch.ps5_726_power', 'off') -%}
   Aus
  {%- else -%}
    {{ states('switch.ps5_726_power') }}
  {%- endif -%}
picture: |
  {% if is_state('sensor.ps5_726_activity', 'playing') %}
  {{state_attr('sensor.ps5_726_activity', 'title_image')}}
  {% else %}
  /local/playstation.jpg
  {% endif %}
card_mod:
  style: |
    ha-card {
      height: 48px !important;
      border-radius: 100px;
      --icon-size: 40px;
    }
    :host {
      --mush-icon-size: 40px;
    }