-
-
Notifications
You must be signed in to change notification settings - Fork 495
Expand file tree
/
Copy pathannouncements.yaml
More file actions
executable file
·82 lines (73 loc) · 2.77 KB
/
announcements.yaml
File metadata and controls
executable file
·82 lines (73 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# People Greeting Announcement - family and Life360 arrival greetings
# Announces covered home arrivals after entry sensor confirmation.
# -------------------------------------------------------------------
# Notes: `group.arriving` batches simultaneous arrivals; Life360 triggers
# only include tracked people not already covered by `group.family`.
######################################################################
- alias: 'People Greeting'
id: 29c5c9dd-550a-4761-a224-78cdc3dd9f43
mode: restart
trigger:
- platform: state
entity_id:
- person.carlo
- person.stacey
- person.paige
- person.justin
from: 'not_home'
to: 'home'
- platform: state
entity_id:
- device_tracker.life360_adriano_costanzo
- device_tracker.life360_amanda_desantis
- device_tracker.life360_gabriella_desantis
- device_tracker.life360_jessica_desantis
- device_tracker.life360_joseph_desantis
- device_tracker.life360_joyce_ruskin
- device_tracker.life360_yolanda_costanzo
to: 'home'
condition:
- condition: template
value_template: >-
{{
trigger.from_state is not none
and trigger.from_state.state not in ['home', 'unknown', 'unavailable']
}}
action:
# This Group is defined in the groups directory.
- service: group.set
data:
object_id: "arriving"
add_entities: >-
{{ trigger.to_state.entity_id }}
- wait_template: "{{ states.binary_sensor.mcu1_gpio12.state == 'on' }}"
timeout: '00:05:00'
# - wait_template: "{{ states.binary_sensor.kitchen_door.state == 'on' }}"
# timeout: '00:1:00'
- delay: '00:01:00'
- service: script.speech_engine
data:
personarriving: >
{% set ns = namespace(names=[]) %}
{% for arrival in expand('group.arriving') %}
{% set clean_name = arrival.name | replace('Life360 ', '') | trim %}
{% set ns.names = ns.names + [clean_name.split(' ')[0]] %}
{% endfor %}
{% set person = ns.names | join(' and ') if ns.names else 'someone' %}
{%- macro greeting_sentence(person) -%}
{{"[Welcome " + person + " home]" }}
{%- endmacro -%}
{{greeting_sentence(person)}}
call_garbage_day: 1
call_no_announcement: 1
call_garage_check: 1
call_window_check: 1
- service: group.set
data:
object_id: "arriving"
entities: []