Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96123

Color of the text displayed by state-label

$
0
0

@RedWheiler wrote:

I’ve some ‘state-labels’ I want to change the color from, based on state.

For example:

voorbeeld

The temperatures (state-labels) are displayed, and I can change the colour also in raw-editor.
But I want them to change them (not the names, the values) automatically, based on the state values HA gets.

For state-icons, this works like a charm (I have Custom UI):

sensor.temperature:
  friendly_name: Temp
  templates:
    icon_color: >
      if (state < 2) return 'darkblue';
      if (state < 7) return 'dodgerblue';
      if (state < 15) return 'lightblue';
      if (state < 19) return 'lightgreen';
      if (state < 22) return 'green';
      if (state < 23) return 'darkgreen';
      if (state < 30) return 'orange';
      if (state < 40) return 'red';
      return 'firebrick';

To get my icons changing colour based on the different states.

I did try a lot of things by changing ‘icon-color’:

text-color, label-color, label-text-color,… But nothing seems to work.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 96123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>