From e47d7164c8b1781308ca85bddb6d2343dcd9b597 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Wed, 15 Feb 2017 18:36:45 +0000 Subject: [PATCH] Fix Speech quote issue. --- automation/Speech/announcements.yaml | 19 +++++++------- automation/sunrise_turnon_and_off.yaml | 35 +++++++++++--------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/automation/Speech/announcements.yaml b/automation/Speech/announcements.yaml index 08557118..1a415617 100755 --- a/automation/Speech/announcements.yaml +++ b/automation/Speech/announcements.yaml @@ -1,9 +1,9 @@ ########## ############################################################ ## Announce when people come or go. -## Announce over all Chromecast Audios +## Announce over all Chromecast Audios ###################################################################### - alias: 'People Greeting' - + trigger: - platform: state entity_id: @@ -15,24 +15,23 @@ from: 'not_home' to: 'home' for: '00:02:00' - + action: - service: script.Voice_notify data_template: value1: > - {% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%} - {% macro greeting_sentence(person) %} + {%- macro greeting_sentence(person) -%} {{ [ "Welcome home " ~ person, "Guess who is home? " ~ person +" is!", "Attention: " ~ person + " is now in the house.", - person ~ " in da hiz house!", + person ~ " in da hiz Ouse!", "Welcome Home " ~ person + ". We've missed you. or at least Molly did.", "Our home is now complete, Rest your head and relax your feet! Welcome Back " ~ person, - "Life is like a song, you’re back where you belong. Welcome home" ~ person, + "Life is like a song, you’re back where you belong. Welcome home " ~ person, "Hey there " ~ person, person ~ "! You're home!" - ] | random }} - {% endmacro %} - {{greeting_sentence(person)}} \ No newline at end of file + ] | random }} + {%- endmacro -%} + "{{greeting_sentence(person)}}" diff --git a/automation/sunrise_turnon_and_off.yaml b/automation/sunrise_turnon_and_off.yaml index c6067786..257d37a6 100755 --- a/automation/sunrise_turnon_and_off.yaml +++ b/automation/sunrise_turnon_and_off.yaml @@ -2,13 +2,13 @@ ## Sunrise and Sunset stuff ################################### -- alias: 'Sunset Stuff on' +- alias: 'Sunset Stuff on' trigger: - platform: state entity_id: sun.sun state: 'below_horizon' from: 'above_horizon' - + action: - service: switch.turn_on entity_id: @@ -17,7 +17,7 @@ - switch.den_outlet - switch.foyer_outlet - service: light.turn_on - entity_id: + entity_id: - light.outdoor_bathroom - group.living_room_accents #- delay: '00:{{ (range(1, 20)|random|int) }}:00' @@ -25,18 +25,18 @@ - service: script.Voice_notify data_template: value1: > - {% macro dark_outside() %} - {{ [ - "It is pretty dark outside. I will turn on the outside lights now.", - "It's a little past Sunset. Time to turn on the outside lights. I'm on it.", - "I'll switch on the outside lights. It's getting dark outside.", - "Time to turn on the front lights. I'll take care of it." - ] | random }} - {% endmacro %} - {{ dark_outside() }} + {%- macro dark_outside() -%} + {{ [ + "It is pretty dark outside. I will turn on the outside lights now.", + "It's a little past Sunset. Time to turn on the outside lights. I'm on it.", + "I'll switch on the outside lights. It's getting dark outside.", + "Time to turn on the front lights. I'll take care of it." + ] | random }} + {%- endmacro -%} + "{{ dark_outside() }}" ###################################################################### -- alias: 'Sunset Stuff off' +- alias: 'Sunset Stuff off' trigger: - platform: sun event: sunrise @@ -44,14 +44,9 @@ action: - service: light.turn_off - entity_id: - - group.exterior_lights + entity_id: + - group.exterior_lights - group.outdoor_front_lights - group.outdoor_pool_lights - group.all_lights - service: script.interior_off - - - - - \ No newline at end of file