You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a template for any "button-card". This template allows you to replace the icon with a custom one, but with a lot more personalization.
Here is an example to show you how to use the template:
- type: custom:button-cardtemplate:
- chip_icon_label
- svg_icon_templateentity: light.office_lamplabel: Lamptap_action:
action: togglevariables:
svg_icon:
fill_color:
colored_on: "rgba(var(--color-yellow),1)"colored_off: "rgba(var(--color-theme),0.1)"not_colored_on: "rgba(var(--color-theme),0.6)"path:
not_colored_on: m 11,15 h 2 v 5 h 5 v 2 H 6 v -2 h 5 znot_colored_off: m 11,15 h 2 v 5 h 5 v 2 H 6 v -2 h 5 zcolored_on: m 8,2 h 8 l 4,12 H 4 L 8,2colored_off: m 8,2 h 8 l 4,12 H 4 L 8,2
Here is another example to show you how I use the template in my own setup :
not_colored_on: m 11,15 h 2 v 5 h 5 v 2 H 6 v -2 h 5 znot_colored_off: m 11,15 h 2 v 5 h 5 v 2 H 6 v -2 h 5 zcolored_on: m 8,2 h 8 l 4,12 H 4 L 8,2colored_off: m 8,2 h 8 l 4,12 H 4 L 8,2
It is important to understand that the template only edit the icon if the user defines the "svg_icon.path" variable.
I would like this template to be available directly in the project so that anyone can use it. Would you agree that I implement this template on all cards ?
PS. I will take the time to implement the template on each card if there is interest.
Otherwise and in the meantime, do not hesitate to copy the template above to add the functionality to your installation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I created a template for any "button-card". This template allows you to replace the icon with a custom one, but with a lot more personalization.
Here is an example to show you how to use the template:
Here is another example to show you how I use the template in my own setup :
dashboard/ui-lovelace.yaml
dashboard/views/home.yaml
dashboard/views/svg_icon_path/mdi/lamp.yaml
Here is the template:
I was heavily inspired by dmatik's icons in his homeassistant-config.
It is important to understand that the template only edit the icon if the user defines the "svg_icon.path" variable.
I would like this template to be available directly in the project so that anyone can use it. Would you agree that I implement this template on all cards ?
PS. I will take the time to implement the template on each card if there is interest.
Otherwise and in the meantime, do not hesitate to copy the template above to add the functionality to your installation.
Beta Was this translation helpful? Give feedback.
All reactions