-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
380 lines (333 loc) · 11.1 KB
/
scripts.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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
set_arrive_sensor:
alias: "Set status of Arrive sensor"
sequence:
- service: input_boolean.turn_on
data_template:
entity_id: "{{ tracker }}"
- delay:
minutes: 1
- service: homeassistant.turn_off
data_template:
entity_id: "{{ tracker }}"
arrive_greetings:
alias: "Greetings on Arrival Home"
sequence:
- service: script.sonos_say
data_template:
sonos_entity: media_player.living_room
volume: 0.4
message: "{{ speech_message }}"
delay: '00:00:08'
arrive_dmitry_greetings:
alias: "Greetings on Arrival Home"
sequence:
- wait_template: "{{ is_state('sensor.dmitry_arriving', 'arriving') }}"
timeout: '00:01:00'
continue_on_timeout: 'false'
- service: script.sonos_say
data_template:
sonos_entity: media_player.living_room
volume: 0.4
message: "{{ speech_message }}"
delay: '00:00:08'
arrive_eileen_greetings:
alias: "Eileen Greetings on Arrival Home"
sequence:
- wait_template: "{{ is_state('sensor.eileen_arriving', 'arriving') }}"
timeout: '00:01:00'
continue_on_timeout: 'false'
- service: script.sonos_say
data_template:
sonos_entity: media_player.living_room
volume: 0.4
message: "{{ speech_message }}"
delay: '00:00:08'
arrive_dogwalker_greetings:
alias: "DogWalker Greetings on Arrival Home"
sequence:
- wait_template: "{{ is_state('sensor.dogwalker_arriving', 'arriving') }}"
timeout: '00:01:00'
continue_on_timeout: 'false'
- service: script.sonos_say
data_template:
sonos_entity: media_player.living_room
volume: 0.4
message: "{{ speech_message }}"
delay: '00:00:08'
dexter_pee_call:
alias: "Dexter Pee Action Script"
sequence:
- service: script.sonos_say
data:
sonos_entity: media_player.living_room
volume: 0.4
message: 'Daddy, I want to go pee'
delay: '00:00:08'
yandex_say:
alias: "Sonos TTS script"
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.sonos_unjoin
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity }}"
volume_level: "{{ volume }}"
- service: tts.yandextts_say
data_template:
entity_id: "{{ sonos_entity }}"
message: "{{ message }}"
- delay: "{{ delay }}"
- service: media_player.sonos_restore
data_template:
entity_id: "{{ sonos_entity }}"
google_say:
alias: "Sonos TTS script"
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.sonos_unjoin
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity }}"
volume_level: "{{ volume }}"
- service: tts.google_say
data_template:
entity_id: "{{ sonos_entity }}"
message: "{{ message }}"
- delay: "{{ delay }}"
- service: media_player.sonos_restore
data_template:
entity_id: "{{ sonos_entity }}"
sonos_say:
alias: "Sonos TTS script"
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.sonos_unjoin
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity }}"
volume_level: "{{ volume }}"
#- service: tts.yandextts_say
- service: tts.google_say
data_template:
entity_id: "{{ sonos_entity }}"
message: "{{ message }}"
- delay: "{{ delay }}"
- service: media_player.sonos_restore
data_template:
entity_id: "{{ sonos_entity }}"
send_wind_alert:
sequence:
- service: notify.ios_dmitry
data_template:
message: "{{ wind_message }}"
data:
push:
badge: 5
category: TEST_ALARM
- service: homeassistant.turn_off
data:
entity_id: input_boolean.kitesurf_wind_request
follow_me_lights_on:
sequence:
- service: homeassistant.turn_on
data_template:
entity_id: >
{{ light_id }}
- service: switch.turn_off
data_template:
entity_id: >
{%- set light_remove = [ light_id ] %}
{%- set all_lights = ['switch.bedroom_ceiling_light_switch' , 'switch.family_room_ceiling_light_switch', 'switch.office_lights_switch_2', 'switch.kitchen_light_switch' ] %}
{%- if is_state('input_boolean.follow_me_lights', 'on') -%}
{%- for light in all_lights if (light not in light_remove) -%}
{{light}}{% if not loop.last %}{{", "}}{% endif %}
{%- endfor -%}
{%- else -%}
switch.null.switch
{%- endif -%}
- service: light.turn_off
data_template:
entity_id: >
{%- set light_remove = [ light_id ] %}
{%- set all_lights = ['light.living_room_ceiling_light_1_level', 'light.living_room_ceiling_light_2_level' ] %}
{%- if is_state('input_boolean.follow_me_lights', 'on') -%}
{%- for light in all_lights if (light not in light_remove) -%}
{{light}}{% if not loop.last %}{{", "}}{% endif %}
{%- endfor -%}
{%- else -%}
light.null.light
{%- endif -%}
living_room_lights_on:
sequence:
- service: script.follow_me_lights_on
data_template:
light_id: >
{%- if is_state("light.living_room_ceiling_light_1_level","on") -%}
light.living_room_ceiling_light_1_level
{%- elif is_state("light.living_room_ceiling_light_2_level", "on") -%}
light.living_room_ceiling_light_2_level
{%- else -%}
{{ [ "light.living_room_ceiling_light_1_level","light.living_room_ceiling_light_2_level" ] | random }}
{%- endif -%}
living_room_lights_off:
sequence:
- service: homeassistant.turn_off
data:
entity_id: light.living_room_ceiling_light_1_level
- service: homeassistant.turn_off
data:
entity_id: light.living_room_ceiling_light_2_level
turn_office_dehumidifier_on:
sequence:
- service: climate.set_operation_mode
entity_id: climate.office_climate_control_cooling_1
data:
operation_mode: "Dry Air"
turn_office_dehumidifier_off:
sequence:
- service: climate.set_operation_mode
entity_id: climate.office_climate_control_cooling_1
data:
operation_mode: "Off"
turn_guestroom_aircon_on:
sequence:
- service: climate.set_operation_mode
entity_id: climate.guestroom_climate_control_cooling_1
data:
operation_mode: Cool
- delay:
seconds: 1
- service: climate.set_temperature
entity_id: climate.guestroom_climate_control_cooling_1
data:
temperature: 22
- delay:
seconds: 1
- service: climate.set_fan_mode
entity_id: climate.guestroom_climate_control_cooling_1
data:
fan_mode: "Auto Low"
turn_office_aircon_on:
sequence:
- service: climate.set_operation_mode
entity_id: climate.office_climate_control_cooling_1
data:
operation_mode: Cool
- delay:
seconds: 1
- service: climate.set_temperature
entity_id: climate.office_climate_control_cooling_1
data:
temperature: 23
- delay:
seconds: 1
- service: climate.set_fan_mode
entity_id: climate.office_climate_control_cooling_1
data:
fan_mode: "Auto Low"
turn_apple_tv_screensaver_on:
sequence:
- service: remote.send_command
data_template:
entity_id: remote.livingroom
command: PowerOn
device: !secret au_device_id_tv
- delay:
seconds: 3.0
- service: remote.send_command
data_template:
entity_id: remote.livingroom
command:
- Home
- Home
- Menu
device: !secret au_device_id_apple_tv
delay_secs: 0.7
send_facebook_wind_alert:
sequence:
- delay:
seconds: 5
- service: notify.facebook_wind_alerts
data_template:
message: >
{{ [
"Time to go foiling." ,
"Bang, Go!",
"Stinky Bay calling!",
"Changi or Stinky Bay? That is a question!",
"Who is going to foil today?",
"Get your ass to the beach now!",
"I swear this is the last time honey, I need to go kite now!",
"Bang, Go! Time to ride.",
"Get it while it's windy.",
"Windy Times!",
"Everybody was riding.. Hoo Haa..",
"Time to quit your job. Lets go ride.",
"Pump your kite, lets ride.",
"Bad day at the beach is better than good day at the office.",
"Time to head to the beach.",
"Wow, you could be riding now.",
"What is your reason for not being at the beach now?.",
"It's windy. Just like that. Boom!",
"Family, friends and work can wait. Wind will not!",
"Time to try that trick you were thinking about.",
"Is that just me or is it windy now?",
"I was getting bored, but it just picked up! Lets go.",
"Pack your gear! Wind is up.",
"Will it still be windy, by the time you get to the beach? Only one way to find out.",
"Everybody is out ridding. Are you ready to join them?",
"Its windy! Who will be the first one out?",
"Seems windy.",
"Ready to ride? ",
"Its kitesurfing Weather.",
"Lets go foiling..",
"Life is short. Go foil! ",
"Good wind for kitesurfing! "
] | random }}
Changi/TM: {{ states.sensor.pws_wind_dir.state }} {{ states.sensor.costawindtotal.state | float | round(1) }} kmh
WindChart: http://bit.ly/wind-chart
----------------
5 min: From {{ states.sensor.pws_wind_kph_3.state | float | round(1) }} kmh To {{ states.sensor.pws_wind_gust_kph_3.state | float | round(1) }} kmh
15 min EMA: {{ states.sensor.amawindtotal.state | float | round(1) }} kmh
Temp: {{ states.sensor.pws_temp_c_3.state }} c Pressure: {{ states.sensor.pws_pressure_mb_3.state }} mb
Pressure Trend : {{ states.sensor.pws_pressure_trend_3.state }}
Next Hour: {{ states.sensor.pws_weather_1h_3.state }}
target:
- BROADCAST
- service: homeassistant.turn_off
data:
entity_id: input_boolean.fb_kitesurf_wind_request
turn_bedroom_aircon_on:
alias: "Turn Bedroom Aircon ON"
sequence:
- service: remote.send_command
data_template:
entity_id: remote.bedroom
command: 'ON'
device: !secret bd_device_id_aircon
- service: homeassistant.turn_on
data:
entity_id: input_boolean.bedroom_aircon
turn_bedroom_aircon_off:
alias: "Turn Bedroom Aircon OFF"
sequence:
- service: remote.send_command
data_template:
entity_id: remote.bedroom
command: 'OFF'
device: !secret bd_device_id_aircon
- service: homeassistant.turn_off
data:
entity_id: input_boolean.bedroom_aircon