Text color based on sensor values


I monitor my pool water status (temperature, salt, ph, etc). Like this:

For pH, I would like to show its value in RED if it drops below 7.2 or if it goes above 7.6 (in other words, there is a range at which it’s optimal and if it’s not, I want the value in red). Same with the sanitation or salinity levels. How is that achieved?

Thanks in advance.

do a search , scan the docs, you want to use the style: directive and use html/css


search the plugins and lovelace card mods, such as this,

there’s loads of ways of doing it.

I did try to search but didn’t find much. Thanks for the tips.

If you’ve not already looked at the card-mod docs there’s an example to do pretty much exactly what you’re looking for here:

Should be very easy to adjust for your setup.

1 Like

Where can I use style? I can only find that for dividers in entities cards.

Go here and check for examples.
Then go here to discuss any card-mod stuff. Also examples may be found in the end of the 1st post (a link to examples is provided there).