How do I get an entity's value to change icon colour with an IF statement?

Thing is, copying this doesn’t really help you, as you still don’t understand what you’re doing.

Finding out about this stuff yourself and learning from it will be very useful in the end.

Now you got a working example for this particular card, but what about all other situations .

Believe me , enter the 2 words in the community search box and all of those threads will open up.

Key is the concept ‘state’ here .

You’re opening config with type: entity still doesn’t work …

This should get you going 🔹 Card-mod - Add css styles to any lovelace card

And see these for more;