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

Hi, I tried that, still doesn’t work. I don’t get it!
Thanks for your help :slight_smile:

Now I think I found it…
icon_colour: |- is misspelled, should be icon_color: |-

Ahh yes! Well spotted, thank you. Now the icon is yellow all the time regardless of no lights or many lights, so |I guess there is an issue with my code. I’m looking at the demo template in dev tools and can’t see what I have done wrong, unless its syntax. But…I’m not getting any errors either. Shrug!

I do this:

{{ expand('group.all_light_entities')|selectattr('state','eq','on')|list|count }}

Create a template sensor and then a group for all lights I want to count.

If i use your code it shows I have two lights currently on… one of those is the ambilight on my philips TV which is currently off.

That way I only count the light entities I want to count.

  all_light_entities:
      entities:
        #Downstairs
        - light.lounge_ceiling_lights
        - light.tripod_light
        - light.kitchen_counter
        - light.kitchen_table
        - light.kitchen_spotlights
        - light.office_ceiling
        - light.office_sign
        - light.desk_lamp
        - light.hallway_light
        - light.garage_light
        #Upstairs
        - light.bedroom_spotlights
        - light.tim_bedside1
        - light.katie_bedside1
        - light.salt_lamp
        - light.grace_lamp
        - light.grace_ceiling
        - light.grace_bed
        - light.harper_ceiling
        - light.mirror

Hi - thanks Tim, that’s very neat, I’ll give it a go.

1 Like

1st Screenshot

2nd Screenshot:

Trying to create a volume slider with the mushroom theme and I can’t seem to figure it out. 2nd screenshot has it in the 1,000’s and obviosuly want it to be 0 - 100

Using the Roku Intergration, custom slider button card, media player card and mushroom card

Still don’t fully understand what I’m doing wrong

I think this is super simple but I’m just not understanding what’s going.

1st Screenshot Code:

type: custom:slider-button-card
entity: media_player.lr_tv
volume_controls:

  • volume_mute
  • volume_set
  • volume_buttons
    slider:
    direction: left-right
    background: gradient
    use_state_color: true
    use_percentage_bg_opacity: false
    show_track: false
    toggle_on_click: false
    force_square: false
    show_name: true
    show_state: true
    compact: false
    icon:
    show: true
    use_state_color: true
    tap_action:
    action: more-info
    action_button:
    mode: toggle
    icon: mdi:power
    show: true
    show_spinner: true
    tap_action:
    action: toggle

2nd Screenshot Code:

type: custom:stack-in-card
cards:

  • type: custom:mushroom-template-card
    name: Living Room TV Volume
    entity: input_number.living_room_sound_test
    icon: |
    {% set vol_level = states(entity) | float %}
    {% if vol_level == 0 %}
    mdi:volume-mute
    {% elif vol_level > 0.66 %}
    mdi:volume-high
    {% elif vol_level < 0.33 %}
    mdi:volume-low
    {% else %}
    mdi:volume-medium
    {% endif %}
    icon_color: indigo
    primary: Volume
    secondary: |
    {% set vol = states(entity) | float * 100 %}
    {{ vol | round | int }}%
  • type: custom:my-slider
    entity: input_number.living_room_sound_test
    radius: 12px
    height: 42px
    mainSliderColor: rgb(var(–mush-rgb-indigo))
    secondarySliderColor: rgba(var(–mush-rgb-indigo), 0.2)
    mainSliderColorOff: rgb(var(–mush-rgb-disabled))
    secondarySliderColorOff: rgba(var(–mush-rgb-disabled), 0.2)
    thumbHorizontalPadding: 0px
    thumbVerticalPadding: 0px
    thumbWidth: 0px
    card_mod:
    style: |
    ha-card {
    padding: 0px 11px 11px;
    –mush-rgb-disabled: 189,189,189;
    –mush-rgb-indigo: 63, 81, 181;
    }

Created some kind of room card with stack in a card.
image
Is it possible to reduche the gap betweentemplate card andchips card to reduce the hight.

type: custom:vertical-stack-in-card
cards:
  - type: custom:mushroom-template-card
    primary: Office
    secondary: ''
    icon: mdi:desk
    icon_color: blue
    tap_action:
      action: navigate
      navigation_path: office
  - type: custom:mushroom-chips-card
    alignment: end
    style: |
      ha-card {
        --chip-box-shadow: none;
        --chip-background: none;
        --chip-spacing: 0px;
        --chip-padding: 0 0.2em
      }
    chips:
      - type: template
        entity: sensor.rb_of_climatesensor_temperature
        content: '{{ states(''sensor.rb_of_climatesensor_temperature'') }}°C'
      - type: template
        entity: sensor.rb_of_climatesensor_co2
        content: '{{ states(''sensor.rb_of_climatesensor_co2'') }}ppm'
      - type: template
        entity: binary_sensor.rb_of_windows
        icon: |-
          {% if is_state('binary_sensor.rb_of_windows', 'off') %}
            mdi:window-closed-variant
          {% else %}
            mdi:window-open-variant
          {% endif %}
        icon_color: |-
          {% if is_state('binary_sensor.rb_of_windows', 'off') %}
            disabled
          {% else %}
            red
          {% endif %}
        tap_action:
          action: none
      - type: template
        entity: light.rb_of_lights
        icon: mdi:lightbulb-group
        icon_color: |-
          {% if is_state('light.rb_of_lights', 'off') %}
            disabled
          {% else %}
            amber
          {% endif %}
        tap_action:
          action: toggle

1 Like

If you still have an issues, you can take a look into my solution:

      - type: template
        icon: |
          {% if is_state('sensor.number_of_lights_on', '0') %}
            mdi:lightbulb-multiple-off
          {% else %}
            mdi:lightbulb-multiple
          {% endif %}
        icon_color: |
          {% if is_state('sensor.number_of_lights_on', '0') %}
            grey
          {% else %}
            amber
          {% endif %}
        entity: sensor.number_of_lights_on
        content: '{{ states(''sensor.number_of_lights_on'') }} ,'
        card_mod: null
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            data:
              title: Lights on
              content:
                type: custom:auto-entities
                card:
                  type: entities
                filter:
                  include:
                    - domain: light
                      state: 'on'
                  exclude:
                    - attributes:
                        icon: mdi:lightbulb-group
                    - attributes:
                        type: browser_mod
          target: {}

and sensor:

template
  - sensor:
        - name: "Number of lights on"
          unit_of_measurement: ""
          state: >
            {{ states.light|selectattr('state','equalto','on')| reject('search','group|screen')|list|length|int }}

You can try with card_mod:

  - type: custom:mushroom-template-card
    primary: Office
    secondary: ''
    icon: mdi:desk
    icon_color: blue
    tap_action:
      action: navigate
      navigation_path: office
    card_mod:
      style: |
        :host {
              height: 25px;
        }

I’m using Card_mod Styles to achieve that:

      - type: custom:stack-in-card
        cards:
          - type: custom:mushroom-template-card
            primary: Dawid
            secondary: >-
              {{ states('sensor.ble_temperature_dawid') }} °C |  {{
              states('sensor.ble_humidity_dawid') | int(0) }} %
            icon: mdi:human-child
            icon_color: '#e8af10'
            fill_container: true
            layout: horizontal
            multiline_secondary: false
            card_mod:
              style: |
                :host([dark-mode]) {
                  background: rgba(var(--rgb-primary-background-color), 0.2);
                } 
                :host {
                  background: rgba(var(--rgb-primary-text-color), 0.05);
                  --mush-icon-size: 50px;
                  height: 66px;
                  margin-left: -8px !important;
                }
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                entity: light.yeelight_edison_style
                icon: |
                  {% if is_state(entity, 'on') %}
                    mdi:ceiling-light
                  {% else %}
                    mdi:ceiling-light-outline
                  {% endif %}
                icon_color: |
                  {% if is_state(entity, 'on') %}
                    yellow
                  {% else %}
                    grey
                  {% endif %}
            alignment: end
            card_mod:
              style: |
                ha-card {
                  --chip-box-shadow: none;
                  --chip-background: none;
                  --chip-spacing: 0;
                } 
        card_mod:
          style: |
            ha-card {
              height: 102px;
            }

height 66px is for the template card
height 102 if for the whole card
looks like that:
image

5 Likes

While it’s great to see the developer for this card got hired at nabucasa I fear the development of this card will slow down to a halt now. There hasn’t been any progress in awhile. Prs are sitting waiting to even run tests. I hope I’m wrong. A lot of prs that were “supposed” to come after the recent refactor release are still sitting as well.

Comparing previous development activity to after last release you will see why I fear this. There’s hasn’t been movement, people trying to contribute are unable to when their workflows can’t even run.

1 Like

I’m trying to change the temp/humidity to 1 decimal
image
but don’t understand YAML enough. btw what’s the best YAML reference out there?

  - type: custom:mushroom-template-card
    primary: Lounge
    secondary: >-
      🌡️{{ states('sensor.atc_f3d3_temperature') }}°C 💧{{
      states('sensor.atc_f3d3_humidity') }}%
    icon: mdi:home
    entity: light.controller_rgbw_22854b
    tap_action:
      action: navigate
      navigation_path: lounge
    hold_action:
      action: toggle
    icon_color: |-
      {% if is_state('light.controller_rgbw_22854b', 'on') %}
        orange
      {% endif %}
{{ states(entity)| round(0) }}°C
1 Like

@Posreg @michalstanczyk Thanks for your hint. Now i will make some Progress.

Thanks a lot.

Thanks; that worked. So if I want to do the same for a entity card I thought I could use decimals but that doesn’t do anything

    cards:
      - type: custom:mushroom-entity-card
        entity: sensor.atc_b49c_temperature
        decimals: 1
        primary_info: state
        secondary_info: name
        name: Temp
        icon_color: green

Still looking for a YAML reference for beginners if you have any recommendation

Hi, is it possible to set a shadow around the template card icon?

You can use the round function to do this.
Ex:

{{states.sensor.your_sensor.state|round(0)}}°C
2 Likes

I ve finally completed (this time for sure) the Home Assistant card

I;m super happy!

The addons will blink if there is an update, I see it more clear without the actual state

10 Likes

works only on template card.

1 Like