This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
319 lines (298 loc) · 7.53 KB
/
automations.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# Frontend
- alias: Set theme at startup
trigger:
platform: homeassistant
event: start
action:
service: frontend.set_theme
data:
name: dark_teal
# Sunrise
- alias: Sunrise
trigger:
platform: sun
event: sunrise
offset: '+00:00:00'
action:
service: light.turn_off
entity_id: light.sonoff_1000950368_2
# Sunset
- alias: Sunset
trigger:
platform: sun
event: sunset
offset: "-00:45:00"
action:
service: light.turn_on
entity_id: group.sunset_lights
# Water boiler
- alias: Turn on water boiler
trigger:
- platform: time
at:
- '06:00:00'
- '19:00:00'
- platform: state
entity_id: input_boolean.wb_ignore_trigger
to: 'on'
- platform: state
entity_id: binary_sensor.jewish_calendar_issur_melacha_in_effect
to: 'off'
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.jewish_calendar_issur_melacha_in_effect
state: 'off'
- condition: state
entity_id: input_boolean.wb_ignore_melaja
state: 'off'
action:
service: switch.turn_on
entity_id: switch.sonoff_10008508fb
- alias: Turn off water boiler
trigger:
- platform: numeric_state
entity_id: sensor.termotanque_temperatura
above: 28
- platform: state
entity_id: switch.sonoff_10008508fb
to: 'on'
- platform: state
entity_id: input_boolean.wb_ignore_trigger
to: 'off'
condition:
- condition: numeric_state
entity_id: sensor.termotanque_temperatura
above: 28
- condition: state
entity_id: input_boolean.wb_ignore_trigger
state: 'off'
action:
service: switch.turn_off
entity_id: switch.sonoff_10008508fb
# PiHole
- alias: Enable Pihole again
trigger:
- platform: state
entity_id: sensor.pihole_status
to: 'Enabled'
condition:
- condition: state
entity_id: switch.pihole
state: 'off'
action:
service: switch.turn_on
entity_id: switch.pihole
# AC's Condensate Pump
- alias: Turn on condensate pump
trigger:
- platform: state
entity_id: climate.living_ac
to:
- 'cool'
- 'heat'
- 'dry'
- platform: state
entity_id: climate.dormitorio_ac
to:
- 'cool'
- 'heat'
- 'heat_cool'
- 'dry'
action:
service: switch.turn_on
entity_id: switch.sonoff_1000854c6a
- alias: Turn off condensate pump living
trigger:
- platform: state
entity_id: climate.living_ac
to: 'off'
- platform: state
entity_id: climate.dormitorio_ac
to: 'off'
condition:
- condition: state
entity_id: climate.dormitorio_ac
state: 'off'
- condition: state
entity_id: climate.living_ac
state: 'off'
action:
service: switch.turn_off
entity_id: switch.sonoff_1000854c6a
# Calendar
- alias: Turn on lights at Shabbat veIom Tov
trigger:
platform: state
entity_id: binary_sensor.jewish_calendar_issur_melacha_in_effect
to: 'on'
action:
service: light.turn_on
entity_id:
- light.sonoff_1000950368_1
- light.sonoff_100094ff53_2
- light.sonoff_1000951aac
- alias: Turn on pending Kiddush Levanah
trigger:
platform: state
entity_id: sensor.moon
to:
- 'waxing_gibbous'
- 'full_moon'
action:
service: input_boolean.turn_on
entity_id: input_boolean.pending_kiddush_levana
- alias: Turn off pending Kiddush Levanah
trigger:
platform: state
entity_id: sensor.moon
to: 'waning_gibbous'
condition:
- condition: state
entity_id: input_boolean.pending_kiddush_levana
state: 'on'
action:
service: input_boolean.turn_off
entity_id: input_boolean.pending_kiddush_levana
# iOS actions
- alias: turn_off_but_outside
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: turn_off_but_outside
action:
service: script.turn_on
entity_id: script.turn_off_but_outside
- alias: toggle_basic_lights
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: toggle_basic_lights
action:
service: light.toggle
entity_id: group.basic_lights
- alias: toggle_living_ac
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: toggle_living_ac
action:
service_template: >
{% if is_state('climate.living_ac', 'off') %}
climate.turn_on
{% else %}
climate.turn_off
{% endif %}
entity_id: climate.living_ac
- alias: toggle_bedroom_ac
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: toggle_bedroom_ac
action:
service_template: >
{% if is_state('climate.dormitorio_ac', 'off') %}
climate.turn_on
{% else %}
climate.turn_off
{% endif %}
entity_id: climate.dormitorio_ac
- alias: toggle_stockroom_ac
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: toggle_stockroom_ac
action:
service: switch.toggle
entity_id: switch.sonoff_100085069c
- alias: toggle_living_tv
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: toggle_living_tv
action:
- service: input_select.set_options
data:
entity_id: input_select.tv_location
options: 'Living'
- service: script.broadlink_send_command
data:
device: 'television'
command: 'power'
- alias: toggle_bedroom_tv
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: toggle_bedroom_tv
action:
- service: input_select.set_options
data:
entity_id: input_select.tv_location
options: 'Bedroom'
- service: script.broadlink_send_command
data:
device: 'television'
command: 'power'
- alias: wb_ignore_trigger
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: wb_ignore_trigger
action:
- service: input_boolean.toggle
data:
entity_id: input_boolean.wb_ignore_trigger
- alias: pihole_disable_30s
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: pihole_disable_30s
action:
- service: pi_hole.disable
data:
entity_id: switch.pihole
duration: '00:00:30'
# Speakers
- alias: volume_speaker
trigger:
platform: state
entity_id: input_number.volume_speaker
action:
service: media_player.volume_set
data_template:
entity_id: >
{% if is_state('input_select.speakers', 'Living') %} media_player.living
{% elif is_state('input_select.speakers', 'Chromecast') %} media_player.chromecast
{% elif is_state('input_select.speakers', 'Kitchen') %} media_player.cocina
{% elif is_state('input_select.speakers', 'Bedroom') %} media_player.dormitorio
{% elif is_state('input_select.speakers', 'Everywhere') %} group.everywhere_speakers
{% endif %}
volume_level: "{{ states('input_number.volume_speaker') }}"
- alias: night_notification
trigger:
- platform: time
at:
- '22:00:00'
- '23:00:00'
action:
- service: media_player.volume_set
data:
entity_id: all
volume_level: 0.5
- delay: 5
- service: tts.google_say
data_template:
entity_id: all
language: es
message: >
"Son las {{ as_timestamp(now()) | timestamp_custom("%I") }} en punto"