From 3f8c4ac38dd1479b9e68528a23c58026a990021d Mon Sep 17 00:00:00 2001
From: Tony Stork
Date: Wed, 31 Aug 2022 16:13:36 -0400
Subject: [PATCH 1/5] Removed tags
---
templates/speech/welcome_home.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml
index c6ed9c7..8ca8d78 100644
--- a/templates/speech/welcome_home.yaml
+++ b/templates/speech/welcome_home.yaml
@@ -87,7 +87,7 @@
{% if is_state('person.christina_stork','Bob Evans') and is_state('input_boolean.work_today','on') %}
- Tina is 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)) }}
+ Tina is 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('input_boolean.work_today','on') %}
Tina has work today.
{% endif %}
From 1a22052ea25343714fcfd6c8b3341dfa28af1ac9 Mon Sep 17 00:00:00 2001
From: Tony Stork
Date: Wed, 31 Aug 2022 17:00:37 -0400
Subject: [PATCH 2/5] New input boolean for "was there school today" purposes
---
packages/events.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/packages/events.yaml b/packages/events.yaml
index 0b76614..f62e3b8 100644
--- a/packages/events.yaml
+++ b/packages/events.yaml
@@ -11,6 +11,9 @@ input_boolean:
work_today:
name: Work Today
icon: mdi:briefcase
+ school_today_extended:
+ name: School Today Extended
+ icon: mdi:bus-school
input_datetime:
school_first_day:
From 475b899b147a828f1201ce0ff63ffcd8337c5115 Mon Sep 17 00:00:00 2001
From: Tony Stork
Date: Wed, 31 Aug 2022 17:01:03 -0400
Subject: [PATCH 3/5] Will now greet K on arrival at home from school
---
templates/speech/welcome_home.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml
index 8ca8d78..8ee3cb8 100644
--- a/templates/speech/welcome_home.yaml
+++ b/templates/speech/welcome_home.yaml
@@ -21,6 +21,14 @@
{% endif %}
+
+ {% set endbefore = state_attr('input_datetime.school_day_end','timestamp') - 3600 %}
+ {% set endafter = state_attr('input_datetime.school_day_end','timestamp') + 3600 %}
+ {% set current = ((now().hour * 60 + now().minute) * 60 ) %}
+ {% if is_state('input_boolean.school_today_extended','on') and current > endbefore and current < endafter %}
+ Welcome home Kallen as well, I hope you had a great day at school!
+ {% endif %}
+
As you are no doubt aware, the weather outside is {{ state_attr('weather.iron_nerd_weather_station','temperature') | round }} degrees
{% if is_state('weather.iron_nerd_weather_station','rainy') %}
From 1c3a0fcd1650d4c9791b3e8121f99043f78a7926 Mon Sep 17 00:00:00 2001
From: Tony Stork
Date: Wed, 31 Aug 2022 17:08:01 -0400
Subject: [PATCH 4/5] Scheduling for extended school day boolean
---
packages/events.yaml | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/packages/events.yaml b/packages/events.yaml
index f62e3b8..da57c65 100644
--- a/packages/events.yaml
+++ b/packages/events.yaml
@@ -185,7 +185,9 @@ automation:
data:
time: "15:19:00"
- service: input_boolean.turn_on
- entity_id: input_boolean.school_today
+ entity_id: input_boolean.school_today
+ - service: input_boolean.turn_on
+ entity_id: input_boolean.school_today_extended
- service: script.turn_on
entity_id: script.school_in_session
@@ -224,9 +226,23 @@ automation:
trigger:
- platform: time
at: input_datetime.school_day_end
+ id: day_end
+ - platform: time
+ at: 00:00
+ id: midnight
action:
- - service: input_boolean.turn_off
- entity_id: input_boolean.school_today
+ - if:
+ - condition: trigger
+ id: day_end
+ then:
+ - service: input_boolean.turn_off
+ entity_id: input_boolean.school_today
+ - if:
+ - condition: trigger
+ id: midnight
+ then:
+ - service: input_boolean.turn_off
+ entity_id: input_boolean.school_today_extended
- id: a6eeb075-d21b-436c-983f-39188ee9b016
alias: Work Reset
From bf91c82746e3da24715767038cfa282d351ddf30 Mon Sep 17 00:00:00 2001
From: Tony Stork
Date: Wed, 31 Aug 2022 17:08:19 -0400
Subject: [PATCH 5/5] I'm stupid and forgot a
tag
---
templates/speech/welcome_home.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml
index 8ee3cb8..a589267 100644
--- a/templates/speech/welcome_home.yaml
+++ b/templates/speech/welcome_home.yaml
@@ -28,6 +28,7 @@
{% if is_state('input_boolean.school_today_extended','on') and current > endbefore and current < endafter %}
Welcome home Kallen as well, I hope you had a great day at school!
{% endif %}
+
As you are no doubt aware, the weather outside is {{ state_attr('weather.iron_nerd_weather_station','temperature') | round }} degrees