This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
Replies: 2 comments 3 replies
-
Try else if as second condition or just use conditions like in the wiki |
Beta Was this translation helpful? Give feedback.
2 replies
-
Did some more testing. This syntax is working: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
trying several conditions to change icon color of entities.
Single condition works:
type: custom:room-card
title: Test
entity: light.lightsstairsegug_2
show_icon: true
info_entities:
show_icon: true
icon:
template:
styles: |
if (entity.state == 'on') return 'color: mediumseagreen';
Any hint on how to make something like this work:
type: custom:room-card
title: Test
entity: light.lightsstairsegug_2
show_icon: true
info_entities:
show_icon: true
icon:
template:
styles: >
if ((entity.state == 'on') and (states('binary_sensor.anybody_home') == 'on')) return 'color: mediumseagreen';
if ((entity.state == 'on') and (states('binary_sensor.anybody_home') == 'off')) return 'color: cyan';
Thanks
Beta Was this translation helpful? Give feedback.
All reactions