-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
456 lines (455 loc) · 12.3 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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
spotify_start:
alias: 'Spotify: Start Playback'
sequence:
- action: spotcast.start
data:
device_name: '{{ states(''input_select.speakers_spotify'') }}'
force_playback: true
mode: single
icon: mdi:spotify
add_shopping_list:
alias: Add Shopping Item
sequence:
- action: shopping_list.add_item
data:
name: '{{ states(''input_text.shopping_list'') }}'
mode: single
check_shopping_list:
alias: Check all Shopping Item
sequence:
- action: shopping_list.complete_all
data: {}
mode: single
clear_shopping_list:
alias: Clear all Shopping Item
sequence:
- action: shopping_list.clear_completed_items
data: {}
mode: single
update_all_phone_sensors:
alias: Update all phone sensors
sequence:
- action: notify.all_phones_android
data:
message: command_update_sensors
- action: notify.all_phones_ios
data:
message: request_location_update
mode: single
icon: mdi:cellphone-arrow-down
git_push:
alias: Git Push
sequence:
- action: shell_command.git_commit_push
data: {}
mode: single
icon: mdi:git
git_push_ha_version:
alias: Git Push - Core Update
sequence:
- action: shell_command.git_core_update_push
data: {}
mode: single
icon: mdi:git
git_commit_copy:
alias: Git Commit Message Copy
sequence:
- action: input_text.set_value
data:
value: "\U0001F4C1 files on {{ now().timestamp() | timestamp_custom('%b %d,
%Y - %-I:%M %p') }}"
target:
entity_id: input_text.git_commit_message
mode: single
icon: fas:paste
load_share_url_googletv:
alias: Load Content from Shared URL - Google TV
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ states(''input_text.ccgtv_share_url'') is match(''http.*primevideo'',
ignorecase=False) }}'
sequence:
- action: androidtv.adb_command
data:
entity_id: media_player.google_tv
command: am start -a android.intent.action.VIEW -n com.amazon.amazonvideo.livingroom/com.amazon.ignition.IgnitionActivity
-d {{ states('input_text.ccgtv_share_url') }}
- conditions:
- condition: template
value_template: '{{ states(''input_text.ccgtv_share_url'') is match(''http.*netflix.com'',
ignorecase=False) }}'
sequence:
- action: androidtv.adb_command
data:
entity_id: media_player.google_tv
command: am start -n com.netflix.ninja/.MainActivity -a android.intent.action.VIEW
-d netflix://title/{{ states('input_text.ccgtv_share_url')|regex_findall_index(find='netflix.com(?:.*?)([0-9]+)',
index=0, ignorecase=False) }} -f 0x10000020 -e "amzn_deeplink_data" "{{
states('input_text.ccgtv_share_url')|regex_findall_index(find='netflix.com(?:.*?)([0-9]+)',
index=0, ignorecase=False) }}"
- conditions:
- condition: template
value_template: '{{ states(''input_text.ccgtv_share_url'') is match(''http.*youtu*'',
ignorecase=False) }}'
sequence:
- action: androidtv.adb_command
data:
entity_id: media_player.google_tv
command: am start -a android.intent.action.VIEW -d "{{states('input_text.ccgtv_share_url')
}}" com.google.android.youtube.tv
default: []
mode: single
icon: mdi:monitor-share
bed_routine_script:
alias: Bed Routine Script
sequence:
- variables:
action_yes: '{{ ''YES_'' ~ context.id }}'
action_no: '{{ ''NO_'' ~ context.id }}'
- action: notify.mobile_app_pixel8pro
data:
message: Going to Bed?
data:
notification_icon: mdi:bed-clock
tag: bed
icon_url: https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/325/bed_1f6cf-fe0f.png?raw=true
color: blue
actions:
- action: '{{ action_yes }}'
title: 'Yes'
- action: '{{ action_no }}'
title: 'No'
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: '{{ action_yes }}'
- platform: event
event_type: mobile_app_notification_action
event_data:
action: '{{ action_no }}'
continue_on_timeout: true
timeout:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == action_yes }}'
sequence:
- action: homeassistant.turn_off
data: {}
target:
entity_id:
- light.light
- light.shapes
- light.chandelier
- light.led_strip
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == action_no }}'
sequence:
- stop: ''
- action: homeassistant.turn_off
data: {}
target:
entity_id:
- light.light
- light.shapes
- light.chandelier
- light.led_strip
- action: notify.mobile_app_pixel8pro
data:
message: clear_notification
data:
tag: bed
mode: single
icon: mdi:bed-clock
play_ocean_sounds:
alias: Play Ocean Sounds
sequence:
- action: google_assistant_sdk.send_text_command
data:
media_player: media_player.pavan_s_nest_hub
command: Play ocean sounds on Pavan's Nest Hub
- action: media_player.volume_set
data:
volume_level: 0.35
target:
entity_id:
- media_player.pavan_s_nest_hub
- delay:
hours: 8
minutes: 0
seconds: 0
milliseconds: 0
- action: media_player.media_stop
data: {}
target:
entity_id: media_player.pavan_s_nest_hub
mode: single
icon: mdi:beach
play_forest_sounds:
alias: Play Forest Sounds
sequence:
- action: google_assistant_sdk.send_text_command
data:
media_player: media_player.pavan_s_nest_hub
command: Play forest sounds on Pavan's Nest Hub
- action: media_player.volume_set
data:
volume_level: 0.35
target:
entity_id:
- media_player.pavan_s_nest_hub
- delay:
hours: 8
minutes: 0
seconds: 0
milliseconds: 0
- action: media_player.media_stop
data: {}
target:
entity_id:
- media_player.pavan_s_nest_hub
mode: single
icon: mdi:forest-outline
play_river_sounds:
alias: Play River Sounds
sequence:
- action: google_assistant_sdk.send_text_command
data:
media_player: media_player.pavan_s_nest_hub
command: Play river sounds on Pavan's Nest Hub
- action: media_player.volume_set
data:
volume_level: 0.35
target:
entity_id: media_player.pavan_s_nest_hub
- delay:
hours: 8
minutes: 0
seconds: 0
milliseconds: 0
- action: media_player.media_stop
data: {}
target:
entity_id: media_player.pavan_s_nest_hub
mode: single
icon: mdi:waves
play_white_noise:
alias: Play White Noise
sequence:
- action: google_assistant_sdk.send_text_command
data:
media_player: media_player.pavan_s_nest_hub
command: Play white noise on Pavan's Nest Hub
- action: media_player.volume_set
data:
volume_level: 0.35
target:
entity_id: media_player.pavan_s_nest_hub
- delay:
hours: 8
minutes: 0
seconds: 0
milliseconds: 0
- action: media_player.media_stop
data: {}
target:
entity_id: media_player.pavan_s_nest_hub
mode: single
icon: mdi:waveform
play_night_sounds:
alias: Play Night Sounds
sequence:
- action: google_assistant_sdk.send_text_command
data:
media_player: media_player.pavan_s_nest_hub
command: Play Country night sounds on Pavan's Nest Hub
- action: media_player.volume_set
data:
volume_level: 0.35
target:
entity_id:
- media_player.pavan_s_nest_hub
- delay:
hours: 8
minutes: 0
seconds: 0
milliseconds: 0
- action: media_player.media_stop
data: {}
target:
entity_id:
- media_player.pavan_s_nest_hub
mode: single
icon: mdi:weather-night
play_spotify_on_phone:
alias: Play Spotify on phone
sequence:
- condition: template
value_template: '{{ state_attr(''sensor.pixel8pro_bluetooth_connection'', ''connected_paired_devices'')
| regex_search(''Galaxy Buds|Pixel Buds'', ignorecase=True) }}
'
- action: notify.mobile_app_pixel8pro
data:
message: command_launch_app
data:
package_name: com.spotify.music
alias: Open App
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- alias: Play Music
action: notify.mobile_app_pixel8pro
data:
message: command_media
data:
media_package_name: com.spotify.music
media_command: play
mode: single
icon: mdi:headphones-bluetooth
play_thunderstorm_sounds:
alias: Play Thunderstorm Sounds
sequence:
- action: google_assistant_sdk.send_text_command
data:
media_player: media_player.pavan_s_nest_hub
command: Play thunderstorm sounds on Pavan's Nest Hub
- action: media_player.volume_set
data:
volume_level: 0.35
target:
entity_id:
- media_player.pavan_s_nest_hub
- delay:
hours: 8
minutes: 0
seconds: 0
milliseconds: 0
- action: media_player.media_stop
data: {}
target:
entity_id:
- media_player.pavan_s_nest_hub
mode: single
icon: mdi:lightning-bolt-outline
google_tell_me_a_joke:
alias: Google, Tell me a Joke
sequence:
- action: google_assistant_sdk.send_text_command
data:
command: tell me a joke
response_variable: response
- action: notify.mobile_app_pixel8pro
metadata: {}
data:
message: '{{ response.responses[0].text }}'
data:
car_ui: true
tag: joke
timeout: 3600
notification_icon: mdi:emoticon-happy-outline
mode: single
icon: mdi:emoticon-happy-outline
reload_google_sheets:
alias: "\U0001F504️Reload Google Sheets"
sequence:
- action: rest_command.reload_google_sheets_music
data: {}
- action: rest_command.reload_google_sheets_weight
data: {}
- action: rest_command.reload_google_sheets_weight2
data: {}
description: ''
icon: mdi:google-spreadsheet
tv_seek:
alias: TV Seek
fields:
seek_amount:
name: Seek Amount
description: In seconds. Can be negative.
selector:
text:
sequence:
- data: {}
target:
entity_id:
- media_player.google_tv_streamer_cast
- media_player.google_tv_streamer_remote
action: media_player.media_play_pause
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- data:
seek_position: "{% if is_state('media_player.jellyfin_tv', 'playing') %}\n {{
state_attr(\"media_player.jellyfin_tv\", \"media_position\")|int +\n (seek_amount|default(-30)|int(-30))
}}\n{% else %}\n {{ state_attr(\"media_player.google_tv_streamer_cast\",
\"media_position\")|int +\n (seek_amount|default(-30)|int(-30)) }}\n{% endif
%}"
target:
entity_id: "{% if is_state('media_player.jellyfin_tv', 'playing') %}\n media_player.jellyfin_tv\n{%
else %}\n media_player.google_tv_streamer_cast\n{% endif %}\n"
action: media_player.media_seek
mode: single
icon: mdi:fast-forward
description: ''
reload_config_entries:
alias: Reload config entries
mode: parallel
fields:
id:
description: Config Entry to Reload
selector:
entity: {}
name: Config Entity ID
required: true
variables:
config: '{{config_entry_id(id)}}'
sequence:
- condition: template
value_template: '{{ config | count > 0 }}'
- action: homeassistant.reload_config_entry
target: {}
data:
entry_id: '{{ config }}'
description: Reloads configuration by the input of a config ID
icon: mdi:reload-alert
play_christmas_music:
alias: "\U0001F384Play Christmas Music"
sequence:
- action: select.select_option
metadata: {}
data:
option: Shuffle Random
target:
entity_id: select.youtube_music_play_mode
- action: select.select_option
metadata: {}
data:
option: Christmas
target:
entity_id:
- select.youtube_music_playlist
- action: select.select_option
metadata: {}
data:
option: Kitchen speaker
target:
entity_id: select.youtube_music_speaker
- action: media_player.toggle
metadata: {}
data: {}
target:
entity_id: media_player.youtube_music
description: ''
icon: mdi:snowflake