meden199
(Meden199)
1
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
meepmeep
(Nicolas)
2
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](https://community-assets.home-assistant.io/original/4X/8/9/c/89c734745b044cb1a9c36057fa7697986a0b8b5b.png)
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