38 lines
1.4 KiB
YAML
Raw Normal View History

2017-02-15 01:34:50 +00:00
########## ############################################################
## Announce when people come or go.
2017-02-15 18:36:45 +00:00
## Announce over all Chromecast Audios
######################################################################
- alias: 'People Greeting'
2017-02-15 18:36:45 +00:00
trigger:
- platform: state
entity_id:
- device_tracker.carlo
- device_tracker.stacey
- device_tracker.franco
- device_tracker.yolanda
- device_tracker.joyce_ipad
from: 'not_home'
to: 'home'
2017-02-04 22:52:11 +00:00
for: '00:02:00'
2017-02-15 18:36:45 +00:00
action:
- service: script.Voice_notify
2017-02-04 22:52:11 +00:00
data_template:
value1: >
2017-02-15 01:34:50 +00:00
{% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
2017-02-15 18:36:45 +00:00
{%- macro greeting_sentence(person) -%}
{{ [
"Welcome back home " ~ person,
"Guess who is home? " ~ person +" is!",
"Attention! " ~ person + " is now in the house.",
"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,
2017-02-15 18:36:45 +00:00
"Life is like a song, youre back where you belong. Welcome home " ~ person,
2017-02-24 19:51:54 +00:00
"Hey there " ~ person + " Welcome Home!",
"Knock Knock. Who is There? " ~ person +" is!",
person ~ "! You're home!"
2017-02-15 18:36:45 +00:00
] | random }}
{%- endmacro -%}
"{{greeting_sentence(person)}}"