Displaying Counter as Time

Hi there,

I recently made a temperature sensor for my wife’s kiln with a push button that starts a counter that counts every second since the button was pushed.

The counter is just a number (example: 140, which represents 140 seconds ) is there any way to display it on the front end in this format “00:02:20”?

Thanks

This should do it:

{{ states('counter.your_counter') | timestamp_custom("%H:%M:%S", 0) }}

Need an int in the middle of that and it’ll work

{{ states('counter.your_counter') | int | timestamp_custom("%H:%M:%S", 0) }}
3 Likes

Thank you!