Must be going blind here, but I cant see why this variable cant be used, and I need to rewrite the exact same condition in the other configuration options:
type: custom:button-card
template: subview_navigate
variables:
motion: >
[[[ return states['binary_sensor.motion_inside'].state === 'on' ||
states['binary_sensor.motion_outside'].state === 'on'; ]]]
icon: >
[[[ return states['binary_sensor.motion_inside'].state === 'on' ||
states['binary_sensor.motion_outside'].state === 'on' ?
'mdi:run-fast' : 'mdi:motion-sensor-off'; ]]]
styles:
icon:
- color: >
[[[ return states['binary_sensor.motion_inside'].state === 'on' ||
states['binary_sensor.motion_outside'].state === 'on' ?
'var(--alert-color)' : 'var(--success-color)'; ]]]
while I would have wanted to use the
icon: >
[[[ return variables.motion ?
'mdi:run-fast' : 'mdi:motion-sensor-off'; ]]]
styles:
icon:
- color: >
[[[ return variables.motion ?
'var(--alert-color)' : 'var(--success-color)'; ]]]
syntax.
I have another example using:
variables:
united: >
[[[ return states['zone.home'].state === '6'; ]]]
and
card:
- animation: >
[[[ return variables.united ? 'card_bounce 4s infinite' : 'none'; ]]]
working perfectly.
please have a look?