From 312f7143fde621b11b1634824b4173a270e10772 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Mon, 18 Apr 2022 20:10:57 -0400 Subject: [PATCH] Add "school tomorrow" sensor --- sensors/time.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sensors/time.yaml b/sensors/time.yaml index 36a4793..a474563 100644 --- a/sensors/time.yaml +++ b/sensors/time.yaml @@ -8,4 +8,13 @@ value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}" month_is: friendly_name: 'Month is' - value_template: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}" \ No newline at end of file + value_template: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}" + school_tomorrow: + friendly_name: 'School Tomorrow' + value_template: >- + {%- set test=(as_timestamp(now())+ (86400)) | timestamp_custom("%Y-%m-%d",true) %} + {% if states.calendar.kallen_school_days.attributes.start_time == test + " 09:00:00" %} + on + {% else %} + off + {% endif %} \ No newline at end of file