I have a button-card that works as an indicator, lighting up if a group light.users_room_lights is on. Independent of this, I have an input_boolean that is on when the lights have been manually switched on, rather than by an automation or trigger, etc.
Sometimes I want to know if the lights are on because they were turned on manually or because they reacted to motion. Reason being, the latter might mean they’re on a timer to switch off or some other condition.
When using a button-card and checking if light.users_room_lights is on, I also want to check if input_boolean.users_rl_manual is on. If both are, I will color the icon an appropriate color to indicate this that’s different than if light is off, or if input_boolean is off.
This is my attempt and isn’t working as the values, outside of ‘off’ are never matched:
type: custom:button-card
entity: light.users_room_lights
color_type: icon
value_template: >-
{% if is_state('light.users_room_lights', 'on') &&
is_state('input_boolean.users_rl_manual', 'off') %}
'auto'
{% endif %}
icon: mdi:room
state:
- value: 'off'
styles:
card:
- filter: opacity(20%)
icon:
- filter: grayscale(100%)
- value: 'auto'
color_type: card
styles:
icon:
- filter: opacity(100%)
- color: rgb(150,255,0)
- value: 'manual'
color_type: card
styles:
icon:
- filter: opacity(100%)
- color: rgb(255,170,0)