-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpresence_non_binary.yaml
145 lines (144 loc) · 4.17 KB
/
presence_non_binary.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
blueprint:
name: "Person: Status Update"
description: Making Home Assistant’s Presence Detection not so Binary
domain: automation
input:
person_device_tracker:
name: Person
description: This is the person entity
selector:
entity:
domain: person
person_input_select:
name: Input select
description: This is the input select that tracks the person's status
selector:
entity:
domain: input_select
time_till_marked_away:
name: Time till marked away
description: How long to wait in just left before getting set as away
default: 10
selector:
number:
min: 0
max: 60
unit_of_measurement: minutes
time_till_marked_home:
name: Time till marked home
description: How long to wait in just arrived before getting set as home
default: 10
selector:
number:
min: 0
max: 60
unit_of_measurement: minutes
time_till_marked_extended_away:
name: Time till marked extended away
description: How long to wait in away before being set to extended away
default: 24
selector:
number:
min: 0
max: 168
unit_of_measurement: hours
alias: 'Person: Status update'
description: ''
trigger:
- platform: state
entity_id: !input person_device_tracker
to: home
id: device_tracker_home
- platform: state
entity_id: !input person_input_select
for:
minutes: !input time_till_marked_home
id: input_select_wait_arrived
to: Just Arrived
- platform: state
entity_id: !input person_input_select
from: Just Left
to: Just Arrived
id: input_select_debounce
- platform: state
entity_id: !input person_device_tracker
from: home
id: device_tracker_not_home
- platform: state
entity_id: !input person_input_select
to: Just Left
for:
minutes: !input time_till_marked_away
id: input_select_wait_left
- platform: state
entity_id: !input person_input_select
to: Away
for:
hours: !input time_till_marked_extended_away
id: input_select_wait_away
condition:
- condition: template
value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'
action:
- choose:
- conditions:
- condition: trigger
id: device_tracker_home
- condition: state
entity_id: !input person_input_select
state: Just Left
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Home
- conditions:
- condition: trigger
id: device_tracker_home
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Just Arrived
- conditions:
- condition: or
conditions:
- condition: trigger
id: input_select_wait_arrived
- condition: trigger
id: input_select_debounce
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Home
- conditions:
- condition: trigger
id: device_tracker_not_home
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Just Left
- conditions:
- condition: trigger
id: input_select_wait_left
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Away
default:
- condition: trigger
id: input_select_wait_away
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Extended Away
mode: queued