I’m setting up a dashboard, where the menu for switching to different views looks like this. Every button has an tap_action. That part is working great. Now i want to have the button(icon) of the “active” view getting a different color.
So it should maybe something as
state == ? than use: background-color: var(--yellow)
yes im using raw yaml editor. how can write my dashboard? I have a file with a template, I add this my new dashboard? and the card? I don’t manage to understand how set raw yaml editor.
thanks for your answer… im trying to create card for my Netatmo valve:
i don’t understand how set my raw yaml editor, because i have the sensors and card.yaml with template.yaml, but I need only the cards in my climate dashboard, I don’t want create a dedicate dashboard .
You already have a dashboard (at least one created automatically on HA setup - it has one “view”).
You may add more “views” in UI to this dashboard.
On each “view” you may add/edit/delete cards - by using UI.
To add button-card-templates into some dashboard you need to open this dashboard, then select “Edit dashboard”:
Then select “raw editor”:
then add your one or several templates before the 1st line here:
this particularly:
Then on any view of this dashboard you may add a button-card with a any of these added templates.
What is a button-card-template, what is it’s purpose - read Docs.
I tried to create a single card, anyway I don’t be able to reply the card, because I know very well mushroom card but not button card, so if I have template and card I don’t manage to use together in a single card
I am restructuring my complete Home Assistant setup - specifically splitting files into subfiles, as I am loosing an overview with these huge code-files and their content. I am using buttons-card templates in order to minimize the coding effort and to maximise the standardisation when it comes to design and look.
However, I am having massive problems right form the start and I need help, please.
My directory structure is as follows:
/config
ui-lovelace.yaml
configuration.yaml
button-card-template.yaml
/integrations
lovelace.yaml
/lovelace
/views
living-room.yaml
/button-card-templates
button-card-templates.yaml
In ui-lovelace.yaml I have following code:
title: My Home
button-card-templates: !include /config/lovelace/button-card-templates/button-card-templates.yaml
views:
- !include lovelace/views/living-room.yaml
In button-card-templates.yaml I have following code:
I’m a bit new to YAML and still figuring it out.
I’m trying to set a background-color with rgb attributes of current light
AFAIK, background-color can recieve rgb in this format only:
background-color: rgb(255,0,0)
i try something like this:
background-color: rgb( {{
states.light.somelight.attributes.rgb_color[0] | int }} , {{
states.light.somelight.attributes.rgb_color[1] | int }} , {{
states.light.somelight.attributes.rgb_color[2] | int }} )
but with no success…
can anyone point me to a solution? ive been searching non-stop with no success
AFAIK i need to be in a JS template [[[ return ...]]] style but with attributes inside.
also important to mention that the background-color that I’m trying to change is for a notification inside the button and the background of the button itself.