-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change icon color based on state #3897
Comments
I don't think that is a bug (may be the feature is not implemented yet). Currently, I am using |
Thanks @arsaboo. I am using your suggestion of customize but I think that may be a workaround since the themes should determine the on/off color?? It would be nice to have the colors in the themes and Lovelace use those unless it’s specifically called out in the style section. |
It should change from gray -> white when turned on. Is this not happening? |
I noticed the same thing. I added a group which consists of two lights to the glance card. I changed the icon to mdi:lightbulb. When off it looks just like the other lights in de glance card. However, when the group is on, the icon stays the same color. Would be nice if this would change like the rest, or to have an option to configure the icon color based on state.
|
@nessinot try a light group instead |
Wow, never knew that existed. It solved my problem. Thanks @iantrich |
Continuing conversation from #1716 |
I tried this with the input_boolean but it doesn't work. It's seeing the customization but my picture_entity in lovelace doesn't change colour Or am I supposed to be using custom_ui or am I missing something?
|
Templates in |
That explains why it doesn’t work I guess lol.... @iantrich shunted me off to here though as it’s not an ‘issue’ |
I think this would be a nice new feature... I use a lot of input boolean as a switch, but I can't use the entity-button card for this. |
+1 for this ... Seems like a very common need ... to show Button icons that reflect the state (ideally entity-button?). Anyone have a work around until this is implemented? Edit: Found this that seems like it will get us most of the way there https://github.com/custom-cards/button-card |
+1 |
Each time this comes up, I say the same thing: don't suggest that we need to color this or that, instead, come up with a strategy that we can use for each place (entity row, entity button etc) on how we should color each type of entity/device class and each of their states. |
@balloob How about something like |
Hmm... |
Adding a config option so you have a tool solve your problem won't solve it for others, but instead requires each user to solve the same problems. |
Not sure I understand your comment Paulus. Are you opposed to having a config option to change colors? |
I would prefer that we have a icon coloring strategy for each entity component |
We can have a default coloring strategy (like yellow if |
+1 for adding support for color changes for all entities that can have a status on/off. This is already working for lights, switches and binary_sensors (like door/motion sensors) but not for input_booleans which also have a status on or off. |
So to get the ball rolling on this I plan to implement From there, I would like to develop some sort of e.g. type: state-config-merge
states:
- value: on
config:
icon: mdi:bulb
icon_color: yellow
card:
type: light
entity: light.bed
icon: mdi:lamp |
@iantrich I was going to open a similar issue, but I found this one.
I'm not sure if this is related, but it would be very useful to be able to specify that at entity level. |
@iantrich do you already have that prototyped as a card type somewhere? |
Not yet |
@iantrich I've forked HA repo and started adding changes to support icon_color_template. What format should be supported? |
@Misiu yes, a string. That sounds fine by me but it will be a separate PR for the frontend to support that attribute. I don't really do much backend stuff, I'll leave reviewing of that to more knowledgeable folks |
@iantrich thanks, I'll edit the rest of the files, add test and create PR. Hopefully, I won't mess something up. |
Not sure if this is a bug or if I’m just doing something wrong but for the life of me I cant get the icon to change colors based on whether my switch or input_boolean is on or off. Without the change of color, it’s just an icon? I’m assuming this must be a bug
The text was updated successfully, but these errors were encountered: