2018-01-02 00:00:45 +00:00
|
|
|
|
########## ############################################################
|
2020-06-08 20:46:42 +00:00
|
|
|
|
# @CCOSTAN
|
|
|
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
2018-01-02 00:00:45 +00:00
|
|
|
|
## Announce when people come or go.
|
|
|
|
|
## Announce over all Chromecast Audios
|
2020-06-08 20:50:37 +00:00
|
|
|
|
# Read more at https://vCloudInfo.com
|
2018-01-02 00:00:45 +00:00
|
|
|
|
######################################################################
|
|
|
|
|
- alias: 'People Greeting'
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
|
- platform: state
|
|
|
|
|
entity_id:
|
|
|
|
|
- device_tracker.carlo
|
|
|
|
|
- device_tracker.stacey
|
|
|
|
|
from: 'not_home'
|
|
|
|
|
to: 'home'
|
|
|
|
|
|
|
|
|
|
action:
|
2020-06-08 20:46:42 +00:00
|
|
|
|
# This Group is defined in the groups directory.
|
|
|
|
|
- service: group.set
|
|
|
|
|
data_template:
|
2020-06-08 20:58:33 +00:00
|
|
|
|
object_id: "arriving"
|
2020-06-08 20:46:42 +00:00
|
|
|
|
add_entities: >-
|
|
|
|
|
{{ trigger.to_state.entity_id }}
|
|
|
|
|
|
2020-03-11 21:27:34 +00:00
|
|
|
|
- wait_template: >-
|
|
|
|
|
{{ states.binary_sensor.kitchen_door.state == 'on' }}
|
2020-06-08 21:08:56 +00:00
|
|
|
|
- delay: '00:01:00'
|
2018-01-02 00:00:45 +00:00
|
|
|
|
- service: script.speech_engine
|
|
|
|
|
data_template:
|
2020-04-27 14:13:32 +00:00
|
|
|
|
# {% set person = state_attr(trigger.entity_id, "friendly_name")%} This is another way to do it.
|
2020-06-08 20:46:42 +00:00
|
|
|
|
# {% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
|
2018-01-02 00:00:45 +00:00
|
|
|
|
personarriving: >
|
2020-06-08 20:46:42 +00:00
|
|
|
|
{% set person = expand('group.arriving')|map(attribute='name')|join(' and ') %}
|
|
|
|
|
{% set peoplecount = expand('group.arriving') | count %}
|
|
|
|
|
{% if peoplecount == 1 %}
|
|
|
|
|
{% set is_are = ' is ' %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% set is_are = ' are ' %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{%- macro greeting_sentence(person, is_are) -%}
|
2018-01-02 00:00:45 +00:00
|
|
|
|
{{ [
|
|
|
|
|
"Welcome back home " ~ person,
|
2020-07-17 15:07:39 +00:00
|
|
|
|
"You had me at hello " ~ person,
|
2020-06-08 20:46:42 +00:00
|
|
|
|
"Guess who is home?" ~ person ~ is_are ,
|
2020-06-15 22:41:56 +00:00
|
|
|
|
"The wifi just got a little more crowded. Welcome Home" ~ person,
|
2020-06-08 20:46:42 +00:00
|
|
|
|
person ~ is_are + " now in the house.",
|
2018-01-02 00:00:45 +00:00
|
|
|
|
"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!",
|
2020-06-08 20:46:42 +00:00
|
|
|
|
"Knock Knock. Who is There? " ~ person ~ is_are ,
|
|
|
|
|
"The garage door opener just told me that " ~ person ~ is_are +" home.",
|
2018-09-27 14:16:52 +00:00
|
|
|
|
person + " can not hide from the system. Welcome home.",
|
2018-01-02 00:00:45 +00:00
|
|
|
|
person ~ "! You are home!",
|
2020-06-08 20:46:42 +00:00
|
|
|
|
"I know a secret! " ~ person ~ is_are +" home!",
|
2018-09-27 14:16:52 +00:00
|
|
|
|
"Hey " ~ person +". Your arrival has been recorded by the Smartest house on the block.",
|
2020-06-08 20:46:42 +00:00
|
|
|
|
"Take note Molly! " ~ person ~ is_are +" home.",
|
2018-06-25 21:38:34 +00:00
|
|
|
|
"I am sensing a disturbance in the force. " ~ person +" must be home!",
|
2018-06-25 22:04:25 +00:00
|
|
|
|
"And the house becomes a home. Welcome back " ~ person,
|
2020-06-08 20:46:42 +00:00
|
|
|
|
person ~ is_are + " now here. Hash tag Welcome Home.",
|
|
|
|
|
person ~ is_are + " now here. Hash tag Home.",
|
|
|
|
|
person ~ is_are + " now here. Hash tag Smart Home.",
|
2018-09-27 14:16:52 +00:00
|
|
|
|
"Just a quick announcement. " ~ person +" has arrived!",
|
2020-06-08 20:46:42 +00:00
|
|
|
|
"Hey" ~ person + "! High Five! Glad you are finally home.",
|
|
|
|
|
"Pardon the interruption but " ~ person ~ is_are +" home!",
|
|
|
|
|
"My systems are picking up the presence of additional humans. " ~ person ~ is_are +" being identified as home.",
|
|
|
|
|
"Welcome home "~person + "! It is nice to see you again! Let me turn on the lights. ",
|
2020-06-08 21:15:58 +00:00
|
|
|
|
"It looks like "~person ~ is_are + " finally home! I will get the house ready for you. "
|
2018-01-02 00:00:45 +00:00
|
|
|
|
] | random }}
|
|
|
|
|
{%- endmacro -%}
|
2020-06-08 20:46:42 +00:00
|
|
|
|
{{greeting_sentence(person, is_are)}}
|
2018-01-02 00:00:45 +00:00
|
|
|
|
call_responsibilities: 1
|
|
|
|
|
call_no_announcement: 1
|
|
|
|
|
call_garage_check: 1
|
|
|
|
|
call_window_check: 1
|
2020-06-08 20:46:42 +00:00
|
|
|
|
|
|
|
|
|
- service: group.set
|
|
|
|
|
data_template:
|
2020-06-08 20:58:33 +00:00
|
|
|
|
object_id: "arriving"
|
2020-06-08 20:46:42 +00:00
|
|
|
|
entities: []
|