Below is an example of how I've used a mushroom template card to change the colour of a button depending on the state of an input_boolean
. The code is below in the card.yaml
file
Created
April 16, 2024 04:45
-
-
Save lennon101/73b7c5ccba525aaecbf103fa0d4b8c22 to your computer and use it in GitHub Desktop.
Mushroom Template Card Example π
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: custom:mushroom-template-card | |
layout: vertical | |
primary: Home | |
icon_color: |- | |
{% if is_state('input_boolean.away_mode', 'off') %} | |
green | |
{% else %} | |
red | |
{% endif %} | |
fill_container: true | |
multiline_secondary: false | |
tap_action: | |
action: call-service | |
service: script.home_mode | |
target: {} | |
entity: input_boolean.away_mode | |
icon: mdi:home-import-outline | |
double_tap_action: | |
action: more-info | |
secondary: '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment