Thanks petro and liamstears!
One question on your code petro.
Is there a way to translate week, day, hour, min and sec to swedish?
{%- set up_time = as_timestamp(now())-as_timestamp(states('sensor.hassio_drifttid_dagar')) %}
{%- macro phrase(name, divisor, mod=None) %}
{%- set value = ((up_time // divisor) % (mod if mod else divisor)) | int %}
{%- set end = 's' if value > 1 else '' %}
{{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
{%- endmacro %}
{%- set values = [
phrase('week', 60*60*24*7), <--- change week to vecka (swedish)
phrase('day', 60*60*24, 7), <-- and so on and on
phrase('hour', 60*60, 24),
phrase('min', 60),
phrase('sec', 1, 60)
] | select('!=','') | list %}
{{ values[:-1] | join(', ') ~ ' and ' ~ values[-1] if values | length > 1 else values | first }}
but!! When “day” turns to “day(s)” the “s” it adds dont translate to good swedish.
EX: Day - days, week - weeks and in swedish dag - dagar, vecka - veckor.
How to get this: “2 veckor, 2 dagar, 10 timmar, 24 min och 54 sek”
instead of: “2 weeks, 2 days, 10 hours, 24 mins och 54 secs”