Really seems like it should be built-in functionality - guess it’s time for a feature request for icon_color to work in sensors, switches and such - or even just icon_template / icon_color in lovelace would be fine with me - easier there than rebooting to reload updates sensors anyhow.
Ok, sorry to open up this topic again. I cant get something working, probably beginnners level…
I want a simple motion sensor icon to not use the default yellow/blue colors but some others.
I have have been reading and googling the last hour but there is so much information, I went from card_mod to css to customisation… but never another colour of my icons done a lot but this I think must be close to the solution. I have:
That is what I am trying to understand. But there is so much information (also outdated) on this forum and I cannot find a simple way how to do what I want. Thus I end up trying out without knowing what I am doing.
Even with your advice that I greatly appreciate (!) I am not able to understand what I should do where and why…
You said:
But how would I do that? Where would I start to do that per entity? Or is that what 'not you meant? That I can’t do icon colors per entity so that it is use in every entity card in lovelace?
But instead I should so i in a card in lovelace per entity and how?
See where I am struggling (as a non-yet coder)
EDIT: What I do want to avoid is to create a template sensor/thing per entity that I want a different icon colour based on state…
Edit: I am totally lost now where to start properly
EDIT2: I now have a lot more options (Perhaps due to the plugin):
But when I ad thing to this or via yaml, nothing happens with the color in lovelace…
This is what I use in customize.yaml: </s> <s>binary_sensor.pir_motion_sensor_toilet_01:</s> <s> icon: mdi:account</s> <s> templates:</s> <s> icon: mdi:water</s> <s> icon_color: if (state === 'on') return 'rgb(128, 255, 0'; else return 'rgb(255, 0, 127)';</s> <s>
EDIT4: Steep learning curve… not sure what did the trick but got it working… pfew
As for the Ha customize Ui you show, don’t use that for custom-ui, you can only use that for core customization. So not for icon_color or templates. As I stated in the repo, many of the custom-ui options are no longer supported, and, though displayed in that Ui, are no longer valid.
you cant possibly have read all of that, and still have no idea please give yourself some time, and simply try both ways, there is no single ‘right’ way.
Depending on your needs (only a single card, or more thoroughly customizing your full config) you could go either way. Or both, as I do…
the single binary sensor coloring would be quite simple, and, given the fact you have installed both, would allow you to do either.
Then maybe one last time ask the question the other way around.
I have had numerous times in my short life time homeassistant that I started something and suddenly it was not supported anymore. And I had a lot of work, time and frustration after to set things right.
What is the “best” way to do this coloring and formatting then?
you’re best bet would be either core HA (which unfortunately doesnt do what you want (yet)) or with a piece of software that is being actively developed, like card-mod.
It would have been nice to see the power of custom-ui being absorbed by a current dev, but as it stands the is not yet the case.
Custom-ui still works, at least for these important options of icon_color and templates in customizations, but I can make no promises, as I am no dev, and fully dependent on the kindness of those that are and willing to help if and when he time arises (again) she of its functionality stops, because of the development of core HA.
Maybe I can persuade certain dev’s to rewrite custom-ui, but that would take some serious effort I am afraid