Thanks a lot for your answer. I know Minimalist, but unfortunately it doesn’t help me much. From what I understand Minimalist uses its own Theme. I wanted to use the default HA Themes which seems to already contain the proper colors (as used by the tile card). But I don’t know how to use them.
I had a similar problem with template within custom:button-card.
I resolved this issue by using Decluttering Card by Romrider.
This allow to use use your template for any card type. There is an example using template for a mushroom card.
You can have both type of template coexisting. Your configuration will have
decluttering_templates:
button_card_templates:
In the Raw Configuration. Follow by their own templates.
I had a similar problem with template within custom:button-card.
I resolved this issue by using Decluttering Card by Romrider.
This allow to use use your template for any card type. There is an example using template for a mushroom card.
You can have both type of template coexisting. Your configuration will have
decluttering_templates:
button_card_templates:
In the Raw Configuration. Follow by their own template.
Hi Team,
I’m trying to build a card using button card, but as few of the items on the card are connected to combination of few sensors - is there a way to define once a “variable” where I’m evaluating a current status of those sensors and then to use in for setting items on the grid. By the sample - for TVR card - I want to have 4 options - off / on but TVR is closed (As current temp is higher than target) / On - heating / On - on max temp - and based on this to change background and few other things. I know how do it for each item separately - but this increase code in times.
Would need a little more detailed info, but based on what you’ve said, could you define a text helper variable and set it through an automation? Then change the card based on the value.
Thanks for the idea. I’m not sure that helpers have such a functionality (I’ll double check it), but most probably I’ll define a template sensor - based on the values for the TVR sensors / statuses.
But just to provide mode details - I’m using Tado TVRs. Data is in 1 device and 2 sensors:
device - status - Off / Heat / Auto and current_temperature. sensor.bedroom_heating - shows how open is the Valve (0% - closed / 100% - opened) and sensor.bedroom_temperature - target temperature…
So my idea is to have different colors of the background and few of the icons on button card based on the combined status of TVR. I want 4 different options:
Off
Idle (target temp lower than current)
heating (target temp higher than current ot valve is open more than 10%)
max when target temp is set on max (this means valve is 100% open all the time).
@Silvrav the width and height are automatic. All the containers in a row will divide the available width equally. The height is determined by how many buttons are in the container because they will all try to fit equally and preserve their aspect ratio. For example, more buttons makes them shorter. I balanced the number of containers and buttons in a row to get them all roughly the same size.
Thanks Keith but mine doesn’t seem to work that way. The buttons will adjust in size to fit the container, the container remain the same size. This in the above example if I try and fit in 7 buttons (indicators I’m image) they will all resize and the container will remain the same size as say the front porch above but with smaller buttons.
See mine below, I would like lounge in one row but has to settle for a vertical stack to fit it into the same container
did anyone of you manage to display a refreshing value of “Last_changed” or “Last_updated” to the custom-button-card. I have a card which shows the reading of a water meter and want to know how up-to-date that is.
So i tried the following:
[[[
const lastChanged = new Date(entity.last_changed);
const now = new Date();
const diffMs = now - lastChanged;
const diffMins = Math.floor((diffMs / 1000) / 60);
return `<ha-icon
style="width: 25px; height: 12px; color: white;">
</ha-icon><span>${diffMins} minutes ago</span>`
]]]
I think Keith’s description is right. The things to remember though, are
the container will size vertically to the tallest item
the container will fill horizontally to fill the space allowed and size buttons horizontally to fit equally according to the number of buttons in each container.
So, if you wanted the four buttons to be essentially the same size as the five buttons below them in your example, you should add a blank button to the set of four (making it five.) It’s a little odd, but I’ve basically set my containers to four items each with at least one that has 3 buttons and a blank so they all appear the same height and width.
Thanks Russel but how is the horizontal space allowed determined?
I can add as many cards as I want the horizonal size does not change? I am sure I am missing something simple here