I’m trying to calculate the time since something happened. When I use the following template:
{% set t = now() - (strptime( state_attr('sensor.blah_blah', 'start'), '%Y-%m-%dT%H:%M:%S%z')) %}
{{ t }}
The result is something like: 3:09:00.491679
I have tried piping to timestamp_custom(’%H:%M’) and I get an invalid input error. I’m kind of at a loss for how to remove the decimal and everything after it. It would look a whole lot cleaner in the UI if I could.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.