From e9adf483318529faaf08ccf690a55019bb7e3785 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 17 Dec 2022 17:44:29 -0500 Subject: [PATCH] Latest attempt to fix wife's "work tomorrow" in TTS briefings --- node-red/projects/NerdFlows | 2 +- templates/speech/nightly_briefing.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/node-red/projects/NerdFlows b/node-red/projects/NerdFlows index e034074..8ac2122 160000 --- a/node-red/projects/NerdFlows +++ b/node-red/projects/NerdFlows @@ -1 +1 @@ -Subproject commit e0340744f165bbb699d033520a6d25411041197e +Subproject commit 8ac212299a974e940313e771f28f6eca17358f0b diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index ad5e6f0..cf6445a 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -18,10 +18,13 @@ {% else %} "Collin does not have school tomorrow. " {% endif %} + {% set start = (state_attr('binary_sensor.tina_work_tomorrow','start_timestamp') | int) // 1000 %} + {% set tmrw = (as_timestamp(states('sensor.date')) + 86400) | int %} + {% set diff = (start - tmrw) %} {% if is_state('input_boolean.work_today','on') %} "Tina is still at work right now, she will be done at approximately {{ (state_attr('input_datetime.tina_workday_end','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. " {% elif is_state('binary_sensor.tina_work_tomorrow','on') %} - "Tina has work tomorrow. Check your calendar for the start time. " + "Tina has work tomorrow at {{ diff | timestamp_custom('%H:%M %p',false) }}. " {% else %} "Tina appears to have tomorrow off. " {% endif %}