Home assistant icon color change mushroom template

My mushroom template card is not changing color when my hye light group goes on or off.
Can someone tell me what is the error in my code?
l

type: custom:mushroom-template-card
primary: Woonkamer
secondary: '{{ states(''sensor.klimaat_woonkamer_temperature'') }} °C'
icon: mdi:sofa
entity: light.woonkamer
icon_color: |-
  {% if is_state(' light.woonkamer', 'on') %}
      orange
  {% endif %}
layout: horizontal
tap_action:
  action: toggle

Did you find the solution ?

Do you have Mushroom code giving you issues?

You can post in the main thread here.

According to the documentation, there is no entity key. Did you try entity_id?

You don’t need an entity with a template card. The code above wasn’t working because of an extra space in front of the entity.

image

An example without a main entity

type: custom:mushroom-template-card
primary: Woonkamer
secondary: '{{ states(''sensor.basement_sensor'') }} °C'
icon: mdi:sofa
icon_color: |-
  {% if is_state('light.pc_lights', 'on') %}
      orange
  {% endif %}
layout: horizontal
tap_action:
  action: toggle