Problems by setting a value

The variable zeitoffen is being computed in seconds (the result of subtracting two timestamps) but the value is being reported as minutes.

ist seit {{ zeit_offen }} Minuten auf!

Therefore the value should be divided by 60 to convert seconds to minutes.

{% set zeitoffen = ((now() - states[ausloeser].last_changed).total_seconds()/60)|int(0) %}

You mean, not to use as_timestamp?
Maybe this solves my problem above.

Will try …

It’s not the fault of as_timestamp. It’s just a matter of ensuring the computed value represents minutes.

The example I posted computes the time difference using datetime objects instead of timestamps but it’s just another way of doing the same thing. The added bit is dividing by 60 to convert seconds to minutes.

This works fine for me. Thanks!!!