hello. this is code of my uptime card:
type: tile
entity: sensor.uptime
grid_options:
columns: 12
rows: 1
vertical: false
hide_state: false
show_entity_picture: false

what is the easiest way to show me a standard uptime like 1 day 12 hours 30 min ?
does anyone have a solution?
Asked that question before, didnât get a response either 
But I used this to create a template sensor that can be displayed instead - Iâm sure I nicked it from somebody else, donât know who:
{% set lrm_uptime = as_timestamp(now()) - as_timestamp(states('sensor.uptime')) | int %}
{% set minutes = ((lrm_uptime % 3600) / 60) | int %}
{% set hours = ((lrm_uptime % 86400) / 3600) | int %}
{% set days = (lrm_uptime / 86400) | int %}
{%- if lrm_uptime < 60 -%}
Less than a minute
{%- else -%}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{%- endif -%}
{%- if hours > 0 -%}
{%- if days > 0 -%}
{{ ', ' }}
{%- endif -%}
{%- if hours == 1 -%}
1 hour
{%- else -%}
{{ hours }} hours
{%- endif -%}
{%- endif -%}
{%- if minutes > 0 -%}
{%- if days > 0 or hours > 0 -%}
{{ ', ' }}
{%- endif -%}
{%- if minutes == 1 -%}
1 minute
{%- else -%}
{{ minutes }} minutes
{%- endif -%}
{%- endif -%}
{%- endif -%}
1 Like
doesnât seem like an âeasyâ solution
You didnât ask for âeasyâ - you asked for âeasiestâ 
Either way, it works for me.