From f0deff928a4ad79f06bce9f19d26cd0ee2affa82 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Thu, 13 Apr 2017 15:32:24 +0000 Subject: [PATCH] #56 - Testing out moving speech logic into ONE script. --- .HA_VERSION | 2 +- automation/Speech/responsibilities.yaml | 16 ---------------- automation/Timed_Triggers/0650.yaml | 2 -- automation/Timed_Triggers/0830.yaml | 3 ++- script/voice_notify.yaml | 20 ++++++++++++++++++++ 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.HA_VERSION b/.HA_VERSION index d7c66d28..a2611310 100755 --- a/.HA_VERSION +++ b/.HA_VERSION @@ -1 +1 @@ -0.42.2 \ No newline at end of file +0.42.3 \ No newline at end of file diff --git a/automation/Speech/responsibilities.yaml b/automation/Speech/responsibilities.yaml index a281c772..b878cc9e 100755 --- a/automation/Speech/responsibilities.yaml +++ b/automation/Speech/responsibilities.yaml @@ -11,20 +11,4 @@ from: 'off' action: - - service: input_boolean.turn_off - entity_id: input_boolean.responsibilities - - service: script.Voice_notify - data_template: - value1: > - {%- macro responsibilities() -%} - {%if now().strftime("%a") == 'Wed' or now().strftime("%a") == 'Sun'%} - Today is {{now().strftime("%A")}} and {{now().strftime("%A")}} is garbage day. - {%endif%} - {% if now().strftime("%j")|int % 2 != 0 %} - Today is Justin's day to do the chores. - {% else %} - Today is Paige's day to do the chores. - {%endif%} - {%- endmacro -%} - "{{responsibilities()}}" diff --git a/automation/Timed_Triggers/0650.yaml b/automation/Timed_Triggers/0650.yaml index edaddcdb..879e0925 100755 --- a/automation/Timed_Triggers/0650.yaml +++ b/automation/Timed_Triggers/0650.yaml @@ -31,7 +31,5 @@ - service: light.turn_off entity_id: - group.dining_room_lights - data: - transition: 600 - service: switch.turn_off entity_id: switch.kitchen_accents diff --git a/automation/Timed_Triggers/0830.yaml b/automation/Timed_Triggers/0830.yaml index f958434a..4db52b8f 100755 --- a/automation/Timed_Triggers/0830.yaml +++ b/automation/Timed_Triggers/0830.yaml @@ -21,8 +21,9 @@ - wed - thu - fri - action: - service: light.turn_off entity_id: - group.interior_lights + - service: switch.turn_off + entity_id: switch.kitchen_accents diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index 4e129b20..862fc987 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -81,6 +81,25 @@ voice_notify: {% else %} "Good evening. {% endif %} + + {%- macro responsibilities() -%} + {%if now().strftime("%a") == 'Wed' or now().strftime("%a") == 'Sun'%} + Today is {{now().strftime("%A")}} and {{now().strftime("%A")}} is garbage day. + {%endif%} + {%if now().strftime("%a") == 'Wed'%} + Both Recycling and regular Garbage goes out. Please take out all of the garbage cans tonight. + {%endif%} + {% if now().strftime("%j")|int % 2 != 0 %} + Today is Justin's day to do the chores. + {% else %} + Today is Paige's day to do the chores. + {%endif%} + {%- endmacro -%} + + {% if is_state('input_boolean.responsibilities', 'on') %} + {{responsibilities()}} + {%endif%} + {{ value1 }}" cache: true @@ -88,3 +107,4 @@ voice_notify: entity_id: - input_boolean.last_message - input_boolean.alert_mode + - input_boolean.responsibilities