More readable timers

I have an entity as below
image

And would like to convert the seconds to something more readable i.e. hh:mm:ss or hh:mm etc.
Is there a nice an easy way to do that (templates?) without creating more entities?

This for example doesn’t work, just gives back total seconds: {{ states('sensor.octoprint_time_remaining') | timestamp_custom("%H:%M:%S", 0) }}

Close, but you have to convert the state, which is a string, to a number first. Try:

{{ states('sensor.octoprint_time_remaining') | int | timestamp_custom("%H:%M:%S", false) }}

That should work, unless the state actually has the s suffix in it, in which case that would have to be removed.

1 Like

Yeah that’s what I was missing alright, thanks.
And is there a way I can call that in an entities card without creating a new uhm entity?

image

I don’t think you can do it in a entities card.
But you could use a template card like this one for example:
Lovelace card-templater card (Jinja2 card templating in Lovelace!) - Share your Projects! - Home Assistant Community (home-assistant.io)