42 lines
1.5 KiB
YAML
Executable File
42 lines
1.5 KiB
YAML
Executable File
########## ############################################################
|
||
## Announce when people come or go.
|
||
## Announce over all Chromecast Audios
|
||
######################################################################
|
||
- alias: 'People Greeting'
|
||
|
||
trigger:
|
||
- platform: state
|
||
entity_id:
|
||
- device_tracker.carlo
|
||
- device_tracker.stacey
|
||
- device_tracker.franco
|
||
- device_tracker.yolanda
|
||
from: 'not_home'
|
||
to: 'home'
|
||
for: '00:02:00'
|
||
|
||
action:
|
||
- service: script.speech_engine
|
||
data_template:
|
||
personarriving: >
|
||
{% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
|
||
{%- macro greeting_sentence(person) -%}
|
||
{{ [
|
||
"Welcome back home " ~ person,
|
||
"Guess who is home?" ~ person +" is!",
|
||
person + " is now in the house.",
|
||
"Welcome Home " ~ person + ". We have 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,
|
||
"Hey there " ~ person + " Welcome Home!",
|
||
"Knock Knock. Who is There? " ~ person +" is!",
|
||
person ~ "! You are home!",
|
||
"I know a secret! " ~ person +" is home!"
|
||
] | random }}
|
||
{%- endmacro -%}
|
||
{{greeting_sentence(person)}}
|
||
call_responsibilities: 1
|
||
call_no_announcement: 1
|
||
call_garage_check: 1
|
||
call_window_check: 1
|