I just found it doesnāt work for a group but it does for a light group. As your group.winter_garden_lights seems to be a ānormalā group, try adding them to a light group.
I accomplish what I think you are looking for with andrey-gitās CustomUI elements. I still have Lovelace frontend obviously but use Tileboard primarily now so havenāt changed much on this in a while.
Once you install and activate CustomUI (it isnāt as complicated as it looks), you can set the icon state by domain in configuration.yaml or by individual entity in customize.yaml. Below is mine for the lights domain from my configuration.yaml.
gah - I got my hopes up - the templates part is only honored by the custom ui state cardā¦so not sure I follow how this would get understood by lovelace? what am I missing?
Do you have CustomUI installed and activated per the instructions on the github site? Once you do that and update either your configuration.yaml (domain) or customize.yaml (individual entities) then the icons will change however you set them to change. Lovelace is just the UI. The icons would still change by state in the old UI with CustomUI enabled.
what iām missing is how those dynamic templates gets evaluated since its javascript so how is that executed/applied when lovelace doesnāt know about the ui-state-card?
Magic of HomeAssistant I guess. Iām no expert; I just know it works. Perhaps the confusion is with āui-state-cardā. That exists independent of Lovelace and is not a card in the sense of a Lovelace card. I used the CustomUI set up (with the ui-state-card set up) prior to Lovelace even existing. The CustomUI set-up Iāve referenced changes the entity and/or domain icons within HomeAssistant based on their individual state. Lovelace is just pulling the state icon into the frontend. Lovelace is not actually changing the state icon; CustomUI is.
Sorry to restart an old thread, but I was looking to achieve the same outcome of a different icon based on state and came across this. Tdw, as it happens, I am pretty much trying to create the same kind layout that you have in the screenshot above. I have the CustomUI elements from andrey-git installed, but I canāt figure out for the life of me how to get the light groupings to come out like you have in the Custom UI. Are they seperate buttons?
Would you mind providing a quick rundown of what you utilised to achieve this?