-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgarbagebroughout.yaml
183 lines (182 loc) · 6.06 KB
/
garbagebroughout.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# heavily borrowed from Aohzan's medication reminder blueprint. Thank you!
blueprint:
name: Garbage Out?
description: Was a specific garbage brought out to the street already?
domain: automation
input:
reminder_time:
name: Pickup countdown
description: Countdown entity until pickup for relevant garbage
selector:
entity:
reminder_ahead:
name: Remind Ahead
description: Days pre-pickup that notification should be sent; 2 = tomorrow
default: 2.0
selector:
number:
min: 0.0
max: 14.0
unit_of_measurement: days
step: 1.0
mode: slider
notify_device:
name: Notification
description: Device needs to run the official Home Assistant app to receive
notifications
selector:
device:
integration: mobile_app
input_boolean:
name: Dedicated input_boolean
description: Create and set here a input_boolean to handle history and state
of the automation
selector:
entity:
domain: input_boolean
notification_title:
name: 'Notification title (Optional)'
description: 'Default: Bring out the garbage!'
default: Bring out the garbage!
notification_message:
name: 'Notification message (Optional)'
description: 'Default: It is time to bring out the garbage.'
default: It is time to bring out the garbage.
notification_action_brought_out:
name: 'Notification action: Done (Optional)'
description: 'Default: Done'
default: Done
notification_action_later:
name: 'Notification action: Ask later (Optional)'
description: 'Default: Ask later'
default: Ask later
notification_action_skip:
name: 'Notification action: Skip (Optional)'
description: 'Default: Skip'
default: Skip
ask_later_wait_time:
name: Wait time before next reminder
description: Hours before notify again after a Ask later action.
default: 1.0
selector:
number:
min: 1.0
max: 48.0
unit_of_measurement: hours
step: 1.0
mode: slider
logbook_message_remind:
name: Logbook message for remind (Optional)
description: 'Default: Reminder sent'
default: Reminder sent
logbook_message_brought_out:
name: Logbook message for action Brought Out (Optional)
description: 'Default: Garbage was brought out'
default: Garbage was brought out
logbook_message_later:
name: Logbook message for action Ask later (Optional)
description: 'Default: Postpone reminder'
default: Postpone reminder
logbook_message_skip:
name: Logbook message for action Skip (Optional)
description: 'Default: Reminder skipped'
default: Reminder skipped
logbook_message_no_answer:
name: Logbook message for no action after timeout (Optional)
description: 'Default: No answer time out'
default: No answer time out
optional_action:
name: Optional action
description: Run an action like notify a speaker at the same time that the mobile
notification
selector:
action: {}
default: []
source_url: https://raw.githubusercontent.com/tinkerberlin/GarbageBroughtOutAutmationBlueprint/main/garbagebroughout.yaml
trigger:
- platform: numeric_state
entity_id: !input reminder_time
below: !input reminder_ahead
mode: restart
action:
- service: input_boolean.turn_off
target:
entity_id: !input 'input_boolean'
- alias: Remind until garbage is brought out.
repeat:
while:
- condition: state
entity_id: !input 'input_boolean'
state: 'off'
sequence:
- service: logbook.log
data:
name: !input 'notification_title'
message: !input 'logbook_message_remind'
entity_id: !input 'input_boolean'
- choose:
- conditions: '{{ true }}'
sequence: !input 'optional_action'
- device_id: !input 'notify_device'
domain: mobile_app
type: notify
title: !input 'notification_title'
message: !input 'notification_message'
data:
actions:
- title: !input 'notification_action_brought_out'
action: brought_out
- title: !input 'notification_action_later'
action: later
- title: !input 'notification_action_skip'
action: skip
tag: !input 'input_boolean'
- wait_for_trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
tag: !input 'input_boolean'
timeout:
hours: !input 'ask_later_wait_time'
- choose:
- conditions: '{{ wait.trigger.event.data.action == ''brought_out'' }}'
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input 'input_boolean'
- service: logbook.log
data:
name: !input 'notification_title'
message: !input 'logbook_message_brought_out'
entity_id: !input 'input_boolean'
- conditions: '{{ wait.trigger.event.data.action == ''later'' }}'
sequence:
- service: logbook.log
data:
name: !input 'notification_title'
message: !input 'logbook_message_later'
entity_id: !input 'input_boolean'
- delay:
hours: !input 'ask_later_wait_time'
- conditions: '{{ wait.trigger.event.data.action == ''skip'' }}'
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input 'input_boolean'
- service: logbook.log
data:
name: !input 'notification_title'
message: !input 'logbook_message_skip'
entity_id: !input 'input_boolean'
default:
- device_id: !input 'notify_device'
domain: mobile_app
type: notify
message: clear_notification
data:
tag: !input 'input_boolean'
- service: logbook.log
data:
name: !input 'notification_title'
message: !input 'logbook_message_no_answer'
entity_id: !input 'input_boolean'