From ffb05854660889c18d331c7ce24aa1e8efa7a6ee Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 22 Oct 2022 20:01:37 -0400 Subject: [PATCH] Add awareness of windows/doors open before bedtime #52 --- templates/speech/nightly_briefing.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index a578242..09d5567 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -103,6 +103,23 @@ {% endif %}

+

+ {% set windows = states('sensor.windows_open') %} + {% set doors = states('sensor.doors_open') %} + {% if states('sensor.total_faults') > '0' %} + {% if windows > '0' and doors > '0' %} + "There are currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}and {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. " + {% else %} + {% if windows > '0' %} + "There {% if windows == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}open. " + {% endif %} + {% if doors > '0' %} + "There {% if doors == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. " + {% endif %} + {% endif %} + {% endif %} +

+

{% if is_state('input_boolean.briefing_extras','on') %} "And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} "