Basic Dashboard Templating with Mushroom Template card

First off I’m very new to Home assistant. I’m currently just trying to put together some basic elements of a simple dashboard.

I’m running Home Assistant on a HA Green:

  • Core 2025.4.1
  • Supervisor 2025.03.4
  • Operating System 15.1
  • Frontend 20250404.0

Up to date as of now for what I can tell:

I’ve used Hubitat for a couple years and recently added HA to give me access to more integrate-able resources. Most of my entities have been brought into HA via the Hubitat integration.

For this issue, I’m adding a horizontal stack-in-card to a very simple existing HA dashboard. Added my first Mushroom Template card to this stack, while closely following a video tutorial. I placed some really simple template logic in the icon and icon color fields based on the state of a open/close sensor on my garage door.
‘’’

  • type: custom:mushroom-template-card
    primary: " "
    secondary: " "
    icon: |-
    {% if is_state(‘binary_sensor.garage_door_status_contact’, ‘on’ %}
    mdi:garage-open
    {% else %}
    mdi:garage
    {% endif %}
    entity: light.office_dimmer
    icon_color: |-
    {% if is_state(‘binary_sensor.garage_door_status_contact’, ‘on’ %}
    red
    {% else %}
    blue
    {% endif %}
    ‘’’

In further testing, I added four basic static mushroom template cards.

‘’’

  • type: custom:mushroom-template-card
    primary: Hello, {{user}}
    secondary: How are you?
    icon: mdi:garage
    ‘’’
    The card with template logic doesn’t display any icon.
    The other four work.

Full stack config:
‘’’
type: custom:stack-in-card
mode: horizontal
cards:

  • type: custom:mushroom-template-card
    primary: " "
    secondary: " "
    icon: |-
    {% if is_state(‘binary_sensor.garage_door_status_contact’, ‘on’ %}
    mdi:garage-open
    {% else %}
    mdi:garage
    {% endif %}
    entity: light.office_dimmer
    icon_color: |-
    {% if is_state(‘binary_sensor.garage_door_status_contact’, ‘on’ %}
    red
    {% else %}
    blue
    {% endif %}
  • type: custom:mushroom-template-card
    primary: Hello, {{user}}
    secondary: How are you?
    icon: mdi:garage
  • type: custom:mushroom-template-card
    primary: Hello, {{user}}
    secondary: How are you?
    icon: mdi:home
  • type: custom:mushroom-template-card
    primary: Hello, {{user}}
    secondary: How are you?
    icon: mdi:home
  • type: custom:mushroom-template-card
    primary: Hello, {{user}}
    secondary: How are you?
    icon: mdi:home
    ‘’’
    I imagine that I’m missing something obvious, and I’m sure that I left out some relevant info. Been searching through posts and messing with this pretty much all day. I appreciate your patience with what is probably a newb question.

Thanks again.

You are missing a parenthesis after on

Try this…

{% if is_state('binary_sensor.garage_door_status_contact', 'on') %}

1 Like

Thanks much! Just like leaving a period off the end of a COBOL line. Believe it or not, I was a programmer in a previous life.Makes me feel pretty unobservant. Not surprisingly that fixed it.

Thanks for taking the time to help. It never fails to surprise me how effective community support can be.

1 Like

Fantastic!

Now, before you go… please take the time to mark that as the answer, you do that by selecting the three dots under the post:

image

Then select the check box:

image

Don’t forget too while you’re down there to click the heart to like the post, as a way of saying thank you.

Thanks for the etiquette reminder! I’m not usually an active poster anywhere, but I really do appreciate an active community.

It’s great to see another HA user joining the community. There are a lot of folks volunteering their time to help others have a great HA experience! Don’t hesitate to ask questions…

A few Mushroom threads that are very resourceful here and here.
I’d recommend reviewing these for examples and a great card guide from @dimitri.landerloos

If you expand to incorporate card mod to Frontend changes, check out this thread