I see, yes, sorry to hear you have a bad UX on that. Not seeing real trouble in my dashboard, though I admit, the mod is not applied directly upon reload, it needs a very short time to kick in.
not on revisiting though, I believe it then is immediate No it is notā¦ especially not after changing dashboards in the left side menu and returning to the view with the slider/buttons, I can see a very clear transition from the theme colors to the modded color.
So with off and cool color as well. Even later applied and with transition.
Or my other question: Do you have an idea to have these other colors working without transition as well, because the switching off of the transition is too late as well because of loading time and order ā¦
I have few cards with many chips on them. Iād like to change the icon within the chip based on a state of the respective entity. I found out I can change the icon like this:
I do now know how to insert a general condition thatāll apply for all chips by referencing the respective entity. I am talking about something like this:
{{ if is_state(āconfig.entityā, āonā),āmdi:lightbulbā,āmdi:lightbulb-outlineā);
If someone could give me a short hint in the proper direction that would be awesome. thx
But in general customizing an icon for an entity should be done on a āserver sideā, not in UI.
Assume this is a binary sensor - then itās icon depends on itās device_class.
Another example - a template sensor/binary_sensor: icon may be defined in the template.
For a āstatic customizationā - ācustomizeā can be used.
Ofc in many cases an icon cannot be customized dynamically on the āserver sideā; then yes, use card-mod or similar frontend-based waysā¦
Hi there. Maybe someone can tell me how card_mod can completely hide the action button that I named with āonā. There should be nothing there and no action should be performed when I click there.
I know that in general customisation of icons should be done as you describe and this is also how I do it.
I want to change the icon based on state though, which I know how to do for a particular chip. I was wandering if there is an easier way than defining an if-then for each entity. Is there?
Assume you have 100500 cards with chip buttons.
Do you mean that some if these card have a chip button for sensor.xyz - and you need to specify a style for this chip button in ONE place - and then see it applied everywhere?
Yes, that was the idea. There are around 40 chips, each for one switch and Iād like to define in one place that if a particular switch is on the icon of the corresponding chip is changed. Is this possit?
A switch entityās icon has some default colors for on & off.
Do you wish to change them?
Only for chip buttons, not for other places?
For all cards? Or for some particular card? Read this also.
Iāve seen this but it just about the colour. I want to change the icons, eg when state is ON mdi:lightbulb and when state is OFF mdi:lightbulb-outline.
This style must be added for EVERY chip (which you need to customize) and for every chip you must use a particular entity_id.
This can be a little shortened by using a macro like
I tried also to change the size of the icon. With the code inspector I found out that it is a ha-svg-icon within ha-assist-chip/state-badge/ha-state-icon/ha-icon but I have no clue how to apply this knowledge here What must i put into ha-assist-chip section to change the icon size to 24px (or 24x24)?
edit, 21.05.2024: tried this as well, but it didnāt work: