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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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