From 83951a74d2a881bb66d22be886027e662201450a Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 10 Jan 2024 17:22:32 -0500 Subject: [PATCH] Fix afternoon meds condition --- custom_templates/status.jinja | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_templates/status.jinja b/custom_templates/status.jinja index f6b1d97..caea1e5 100644 --- a/custom_templates/status.jinja +++ b/custom_templates/status.jinja @@ -194,8 +194,7 @@ {% set afternoonNotifyTimestamp = state_attr('input_datetime.tony_afternoon_meds_notify','timestamp') | int %} {% if is_state('input_boolean.tony_afternoon_meds_taken','on') and is_state('input_boolean.tony_awake','on') %} {{ identTony }} took his afternoon meds at {{ input_datetime_read('input_datetime.tony_afternoon_meds_taken') | trim }}. - {% elif is_state('input_boolean.tony_afternoon_meds_taken','off') and - (afternoonNotifyTimestamp - ct) < 7200 and ct < 86400 %} + {% elif is_state('input_boolean.tony_afternoon_meds_taken','off') and (0 < (afternoonNotifyTimestamp - ct) < 3600 or ct > afternoonNotifyTimestamp) %} {{ identTony }} has not taken his afternoon meds. {% if ct < afternoonNotifyTimestamp %} {% if method == 'tts' %}