Benötige etwas Hilfe beim Code

Hallo zusammen, ich habe mit einer Mushroom Template Card dieses Video bei mir umgesetzt: Icons anhand des Wertes verändern
Nur wird in diesem Video der Status "on und off abgefragt. Ich möchte aber meine CPU Last anhand wechselnder Icons darstellen.

In dem Feld Symbol habe ich folgenden Code eingefügt:

{% if is_state('sensor.system_monitor_processor_use', '<15') %}
  mdi:emoticon-happy-outline
{% elif is_state('sensor.system_monitor_processor_use', '<20') %}
  mdi:emoticon-outline
{% elif is_state('sensor.system_monitor_processor_use', '<40') %}
  mdi:emoticon-neutral-outline
{% elif is_state('sensor.system_monitor_processor_use', '<60') %}
  mdi:emoticon-angry-outline
{% elif is_state('sensor.system_monitor_processor_use', '>60') %}
  mdi:emoticon-sad-outline
{% else %}
  mdi:emoticon-cry-outline
{% endif %}

Bei dem Feld Icon- Farbe habe ich das so gemacht:

{% if is_state('sensor.system_monitor_processor_use', '<15') %}
  green
{% elif is_state('sensor.system_monitor_processor_use', '<20') %}
  blue
{% elif is_state('sensor.system_monitor_processor_use', '<40') %}
  yellow
{% elif is_state('sensor.system_monitor_processor_use', '<60') %}
  orange
{% elif is_state('sensor.system_monitor_processor_use', '>60') %}
  pink
{% else %}
  red
{% endif %}

Und zu guter letzt in dem Feld “sekundäre Informationen” so:

{% if is_state('sensor.system_monitor_processor_use', '<15') %}
  minimale Beanspruchung
{% elif is_state('sensor.system_monitor_processor_use', '<20') %}
  leichte Beanspruchung
{% elif is_state('sensor.system_monitor_processor_use', '<40') %}
  mittlere Beanspruchung
{% elif is_state('sensor.system_monitor_processor_use', '<60') %}
  hohe Beanspruchung
{% elif is_state('sensor.system_monitor_processor_use', '>60') %}
  sehr hohe Beanspruchung
{% else %}
  extrem hohe Beanspruchung
{% endif %}

Bei mir wird aber im Dashboard nur das angezeigt:

Ich vermute das es daran liegt, das ich ja keinen String abfrage, sondern einen Number Wert und deswegen mein Code falsch ist.

Wie muss es richtig aussehen?

Besten Dank im voraus.
Andy

So wäre es richtig

{% if states('sensor.system_monitor_processor_use') | int < 15 %}
  green
{% elif states('sensor.system_monitor_processor_use') | int < 20 %}
  blue
{% elif states('sensor.system_monitor_processor_use') | int < 40 %}
  yellow
{% elif states('sensor.system_monitor_processor_use') | int < 60  %}
  orange
{% elif states('sensor.system_monitor_processor_use') | int > 60 %}
  pink
{% else %}
  red
{% endif %}

Dann solltest Du dem Sensorwert auch einen Default wert mit geben, falls diese nicht verfügbar ist.
Sonst wirft das Template einen Fehler auf.
z.B, die 0 mit
| int(0)
oder 100
| int(100)

Je nach dem was Du ausgeben willst, wenn der Sensor nicht verfügbar ist.

Gruß
Osorkon

Ich danke Dir. Alleine hatte ich das wohl nicht hinbekommen.