Preserved colour names

I have a “customize.yaml” defined as:

sensor.PIR_Eetkamer:
  templates:
    icon_color: >
      if (state == 'Normal') return 'primary-color';
      if (state == 'Breach') return 'orange';
      if (state == 'Alarm') return 'red';
      return 'grey';

The “primary-color” works perfect, without knowing what’s the real color name.

I’m looking for the preserved colour name of the sensor when it is on and changes to the colour yellow/orange, like below:

My sensor is not a binary_sensor but a normal sensor so I need to define the colour per status myself.

entity_ids are lowercase.

No, it does not, you keep using a default color in fact.

Should be like

if (state == 'Normal') return 'var(--primary-color)';

Also, this is a code for Custom UI which is a custom plugin which must be installed.

Great and stupid from my side… it seems to work :grinning:

This is exactly what I want: using a default color… As I don’t know the real name of it (none of the preserved color names is representing exactly the same color, like e.g. steelblue).

Based on my reply, do I still need to replace by 'var(--primary-color)'?

What is the preserved name being used at the interface for the yellow/orange?

Thanks anyway, I can go on with my customize_glob.yaml…

Try “var(–paper-item-icon-color)”.

Return that color I mentioned.

var(–state-active-color)