Good Morning,
I was wondering if any coding experts could help me out here. I wrote code for a card using the Waze sensor to display current route times to common destinations. If the destination exceeds 15 minutes, I’d like the text for the specific location to turn red. For some reason, it’s not working. I’ve tried ChatGPT and everything that I can think of. Any assistance on this would be greatly appreciated. Thank you!
type: entities
entities:
- type: custom:template-entity-row
entity: sensor.waze_travel_time
name: CrossFit North Port
state: |
{{ states(‘sensor.waze_travel_time’) }} minutes
styles:
state:
- color: |
[[[
return (states[‘sensor.waze_travel_time’] | float) > 15 ? ‘red’ : ‘inherit’;
]]]
- font-size: 1.5em - type: custom:template-entity-row
entity: sensor.taylor_ranch
name: Taylor Ranch
state: |
{{ states(‘sensor.taylor_ranch’) }} minutes
styles:
state:
- color: |
[[[
return (states[‘sensor.taylor_ranch’] | float) > 15 ? ‘red’ : ‘inherit’;
]]]
- font-size: 1.5em