Mushroom Horizontal Card

I have a button on my dashboard which implements a mode in the system.

My problem is that when I press it I do not know if it is on or off as it doesn’t indicate which state it is in. Is their anyway of showing this from the button? Code below

`

type: custom:mushroom-template-card
primary: Holiday Mode
secondary: ‘’
icon: mdi:plane-train
icon_color: green
layout: vertical
tap_action:
action: toggle
entity: input_boolean.holiday_mode
multiline_secondary: false
`

thanks

Use the mushroom-template-card and then you can set icon and icon_colour based on
{{ states('input_boolean.holiday_mode') }}

Am still an absolute amateur on this one but how do I do this? Also, am I not using the mushroom template card?

Copy the following code and paste it into your card (missing fields like secondary are automatically added). As long as an entity is defined, you can use the variable entity:


type: custom:mushroom-template-card
entity: input_boolean.holiday_mode
primary: Holiday Mode
icon: |-
 {{ 'mdi:plane-train' if states(entity) == 'on' else 'mdi:account-hard-hat-outline' }}
icon_color: |-
 {{ 'green' if states(entity) == 'on' else 'disabled' }}
layout: vertical
tap_action:
  action: toggle

2 Likes

Thank you very much sir, much appreciated.