From 6cddca76f705bb4b2462074e961e2a9ae02c895e Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 28 Dec 2025 01:12:42 -0500 Subject: [PATCH] time_diff macro --- custom_templates/time.jinja | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_templates/time.jinja b/custom_templates/time.jinja index ab3ba40..da890cf 100644 --- a/custom_templates/time.jinja +++ b/custom_templates/time.jinja @@ -109,4 +109,9 @@ {% macro next_twitch_stream() %} {{ custom_time('calendar.tony_s_twitch_schedule','week,day,hour') }} +{% endmacro %} + +{% macro time_diff(sensor) %} +{% set diff = (as_timestamp(now()) - as_timestamp(states(sensor))) | int %} +{{ diff }} {% endmacro %} \ No newline at end of file