trying to get this time to display the right info when the timer is active and finishes. when it runs it says “undefined” for info. I followed this guy tutorial and cant seem to figure out what is wrong with the code.
(389) How to Create a Countdown Card in Home Assistant - YouTube
type: custom:button-card
entity: timer.kids_game_timer
show_entity_picture: true
name: Break Time
show_label: true
label: |
[[[
if (entity.state == "active")
return (entity.attributes.current_course) + " / " + (entity.attributes.run_state) + "<br />" + 'Time left: ' + (entity.attributes.remaining);
if (entity.state == "idle")
return "Turned off"
]]]
styles:
icon:
- width: 30px
- color: black
img_cell:
- justify-content: flex-start
- margin-top: '-4px'
card:
- height: 130px
- padding: 12px 0 12px 18px
name:
- justify-self: start
- font-size: 12px
- color: black
- opacity: '0.5'
- padding-top: 10px
label:
- justify-self: start
- font-size: 14px
- font-weight: 500
- margin-bottom: 0px
- text-align: left
- padding-top: 5px