Several sensors in a glance card return numeric values > 0 when active. I’ve been all over this, but can’t seem to get the icon color to change to an active state when the sensor is not zero.
I’m not trying to change the actual icon like I’ve seen in other posts, but trying to just set the icon state as active. I’d prefer to let the color to be dictated by the theme, but I’m willing to try anything at this point.
Can anyone give me a nudge in the right direction?
Thanks for the reply, Russell. I’ll play with this some more, but so far have not been able to get this to work.
The sensor icon I’m trying to get to change to an active state is normally zero but reflects a variable rpm value when running. I also have the option to use another sensor for the pump that reflects it on/off state.
The pseudo expression of ‘if rpm > 0 set icon status to on’ seemed simple enough but the actual solution doesn’t seem to be that simple.
I couldn’t get this to work directly in a glance card. I ended up wrapping a template card around it to look at the pump’s on/off status and change the icon color of the targeted sensor accordingly.
The downside of all of this is that I will have to match the icon color manually to any theme I choose, rather than to allow the default icon behavior address it:
This problem has crept back up since my original post a couple of years ago. My icons would change color based on the status of the pool pump, then recently, I noticed that they weren’t. An update must have broken something. The previously working code:
seems you don’t need the config-template-card at all for this?
why not simply set the card_mod on the entities directly
c-t-c is a resource hog and should only be used if you need to change the actual config of the card, not for some of these simple modifications on entities
if you set the same modification on several entities, just use an anchor to c&p those. or an include like this
sure.
most of all with cards inside auto_entities.
(I am only using it because I ‘needed’ the new features of 3.5.0 and managed to fix all other required changes in the last 2 weeks… by no means should 3.5.0 be used in the broader community, that’s why it was retracted. Hopefully a version 4 will see the light of day soon)
Thanks…I am a bit behind on all the changes, but dealt with several issues with folks this evening that were fixed by reverting to 3.4.4. Props to you for putting in the Dev effort!