After spending a number of hours and trying hundreds of different combinations, I am about to give up. This community is the last resort and I would appreciate if someone can help me to get a working solution.
What I am trying to do - replace those meaningless control dots (likely SVG-generated) with MDI icons:
Those buttons are “Toggle fan”, “Increase speed”, “Decrease speed”. If I figure out how to replace at least one - I should be able to figure out the rest.
One of those hundreds of variants I tried (addiing div, removing div, adding dollar signs, removing dollar signs etc.):
card_mod:
style:
hui-card-features $:
hui-card-feature $:
hui-fan-preset-modes-card-feature $:
ha-control-select $:
div div div ha-attribute-icon $: |
ha-icon {
--ha-card-background: teal;
--card-mod-icon: mdi:fan-speed-1
}
card_mod is installed and working - I can replace a background or icons on the whole tile using generic CSS, but those specific DOM elements. What am I doing wrong?
In general, card_mod seems to be working fine in my setup, extra_module_url is defined in configuration.yaml correctly, just DOM doesn’t seem to be working.
After a few days of struggling, I finally got it working with the following code. Note a single backslash prior to each space in #option-…card-mod-helper doesn’t seem to translate them correctly.
Another issue was that the URL under the extra_module_url in configuration.yaml should exactly match to what HACS lists under the Resources for the card_mod. Somehow I thought it should be /local/community/…
One more important thing - I have a few tiles wrapped up by the vertical stack. This code only worked when defined on the tile level (i.e. indented to be on the same level as a tile), not the vertical stack level.