the icon_color template should then work, if it is found in your include directory. I can’t see if that is named correctly, given the structure of your files. but first try the other template and see in dev-state what the result might be
The code you posted is giving me the same result i had before. The states and icons changes are working prefectly, but still not color change with the icons.
Hi @Mariusthvdb
Thanks for the warning. After reading your post and some more experimenting, I found that if I changed the device class from ‘device_class: opening’ to ‘device_class: switch’, then I no longer needed the state: template - which was designed to change the default value of “Open/Close” to “On/Off”.
As a bonus, my icon_colors now work again. I don’t understand the underlying reason for the fix…
you should have the folder customize, in which you put the other yaml files with the customizations. In that file you should use the customization you already posted…
maybe use the directive:
customize: !include customize.yaml if you have no other files in that folder? Of course put the customize.yaml file in your config directory then.
your template seems fine, what happens in developer/template?
if that works, you should be able to use it as an icon_template, provided the component supports an icon template. don’t think Cover does though: Cover - Home Assistant
If not you could use custom-ui, and use the JS template
haha, note that the quote was your own code, but because of the editor here in the community that sometimes gets changed to us reversed quotes, always be careful copying from the community
but since you need the template, this can’t be done straightaway. Now I dont know about the cover integration, but the docs seems not to show an option for customizing the icon? You could try of course it would probably say ‘invalid config’ is not supported.
After that, your final solution would be to use custom-ui indeed. Which makes it all possible… use the js template I suggested, and you’re done.
the card you show above is a lovelace card, the cant use templates at all. so you should take that out.
You can use other cards, like custom button card, and have icons change depending on state.
If no working solution is only use custom card to do it ?
I dont know why option change icon for cover is no implement in Home Assistant. This is no look good…