Timer remaining questions?

In yaml code, how can I get the remaining time left on an active timer without having to subtract the “finishes at” from the current time?

Why does the attribute “remaining” always just display the original duration regardless of the state of the timer?

That’s a mystery!

  • The UI shows the time remaining
  • Entity-cards (for example) do NOT show the time remaining

My solution was to use the (fantastic) custom:button-card

type: custom:button-card
name: DB<br>TIMER
entity: timer.timer_doorbell_off
show_state: true
show_icon: false

The button-card for some reason shows the “live” time remaining.

Well, that solution is great for the UI, but if we wanted to instead use the info in a notification alert, it would be handy to show the actual remaining time. How does one do that? Can I create a helper or similar to do the calculation so I can simply reference it? #NoobHere

1 Like

You can use Templating.

action: notify.YOUR_NOTIFIER
data:
  message: |
    The timer will finish in {{ time_until(state_attr('timer.YOUR_TIMER','finishes_at'), 2) }}

The time_until() function will return a string like “1 hour, 45 minutes”

1 Like