-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
executable file
·331 lines (305 loc) · 8.23 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
group_toggle:
alias: Toggle grpup on/off
fields:
group:
description: Group to toggle on/off
example: "group.kitchen"
sequence:
- action: >
{% if is_state(group, 'on') %}
homeassistant.turn_off
{% else %}
homeassistant.turn_on
{% endif %}
target:
entity_id: "{{ group }}"
toggle_tv_power:
alias: TV on/off
sequence:
- action: >
{% if is_state('media_player.tv', 'off') %}
script.turn_tv_on
{% else %}
script.turn_tv_off
{% endif %}
turn_tv_on:
alias: Turn TV on
sequence:
- action: media_player.turn_on
data:
entity_id: media_player.google_tv
- delay:
seconds: 2
- action: media_player.turn_off
data:
entity_id: media_player.google_tv
turn_tv_off:
alias: Turn TV off
sequence:
- action: media_player.turn_off
data:
entity_id: media_player.tv
turn_tv_volume_up:
alias: Turn TV volume up
sequence:
- action: media_player.volume_up
data:
entity_id: media_player.tv
turn_tv_volume_down:
alias: Turn TV volume down
sequence:
- action: media_player.volume_down
data:
entity_id: media_player.tv
toggle_tv_mute:
alias: Toggle TV mute
sequence:
- action: media_player.volume_mute
data:
entity_id: media_player.tv
is_volume_muted: "{{ not state_attr('media_player.tv', 'is_volume_muted') }}"
play_pause_tv:
alias: Play/pause TV
sequence:
- action: media_player.media_play_pause
data:
entity_id: media_player.tv
stop_tv_media:
alias: Stop TV media
sequence:
- action: media_player.media_stop
data:
entity_id: media_player.tv
turn_everything_off:
alias: Turn everything off
sequence:
action: homeassistant.turn_off
entity_id:
- group.all_lamps
- media_player.tv
- switch.magic_mirror
- group.christmas_lights
good_morning_home:
alias: Turn lights on in the morning
sequence:
- action: light.turn_on
entity_id:
- light.living_room_christmas_star
- light.kitchen_ceiling
- action: switch.turn_on
entity_id:
- switch.advent_candlestick
- switch.christmas_tree
- switch.balcony_string_lights
cast_youtube:
alias: Cast YouTube
sequence:
- action: media_extractor.play_media
entity_id: media_player.google_tv
data:
media_content_id: "https://www.youtube.com/watch?v=ROkXM3csNWY"
media_content_type: video/youtube
cast_magic_mirror_camera:
alias: Cast Phone
sequence:
- action: media_extractor.play_media
data_template:
entity_id: "{{ media_player }}"
data:
media_content_id: !secret magic_mirror_video
media_content_type: image/jpg
turn_computer_on:
alias: Turn on computer
sequence:
- action: wake_on_lan.send_magic_packet
data:
mac: !secret computer_mac
turn_computer_off:
alias: Turn off computer
sequence:
- condition: state
entity_id: switch.computer_power
state: "on"
- action: shell_command.turn_off_computer
data:
ssh_user: !secret shutdown_ssh_user
user: !secret shutdown_computer_user
ip: !secret computer_ip
timeout: 10
flic_button_lights_click:
alias: Flic button Lights click
sequence:
- action: scene.turn_on
data:
entity_id: scene.evening
flic_button_lights_double_click:
alias: Flic button Lights double click
sequence:
- action: light.turn_on
data:
entity_id: all
brightness: 255
flic_button_lights_hold:
alias: Flic button Lights hold
sequence:
- action: script.turn_everything_off
play_sound:
alias: Play sound
sequence:
- action: media_player.play_media
data:
entity_id: media_player.living_room_speaker
media_content_id: !secret bitcoin_sound
media_content_type: audio/mp3
send_robocop_to_waste_bin:
alias: Send Robocop to waste bin
sequence:
- action: vacuum.stop
entity_id: vacuum.robocop
- delay:
seconds: 1
- action: vacuum.send_command
entity_id: vacuum.robocop
data:
command: app_goto_target
params: !secret waste_bin_location
dim_without_turn_off:
alias: Change brightness in steps without turning lights off
sequence:
- data_template:
brightness: 10
entity_id: "{{ entities | join(', ') }}"
action: light.turn_on
smart_living_room_toggle:
alias: Turn on/off lights in a smart way
sequence:
- action: >
{% if is_state('light.living_room', 'on') %}
homeassistant.turn_off
{% else %}
homeassistant.turn_on
{% endif %}
target:
entity_id: >
{% if is_state('light.living_room', 'on') %}
light.living_room
{% else %}
['light.living_room_window_sill', 'light.cabinet', 'light.living_room_christmas_star']
{% endif %}
test_script:
alias: For testing purposes
sequence:
- action: system_log.write
data:
message: >
{{ expand(entity_id)
| map(attribute='entity_id')
| list }}
logger: mycomponent.myplatform
initiate_christmas_feeling:
alias: Initiate Christmas feeling
sequence:
# Turn on christmas tree hallway
- action: homeassistant.turn_on
entity_id: switch.hallway_christmas_tree_mini
- delay: 5
# Turn on speakers
- action: homeassistant.turn_on
entity_id: switch.speaker_right
- delay: 2
# Turn on speakers
- action: homeassistant.turn_on
entity_id: switch.speaker_left
- delay: 2
# Turn on advent candle kitchen
- action: homeassistant.turn_on
entity_id: switch.kitchen_advent_candlestick
- delay: 4
# Start playing christmas music
- action: spotcast.start
data:
device_name: Chromecast Audio
uri: !secret spotify_christmas_playlist
repeat: off
shuffle: false
offset: 0
- delay: 4
# Turn on christmas tree
- action: homeassistant.turn_on
entity_id: switch.living_room_christmas_tree
- delay: 3
# Cast youtube fireplace
- action: media_extractor.play_media
entity_id: media_player.google_tv
data:
media_content_id: "https://www.youtube.com/watch?v=LDL888gcPv8"
media_content_type: video/youtube
- delay: 4
# Christmas star
- action: homeassistant.turn_on
entity_id: light.living_room_christmas_star
- delay: 3
# Balcony lights
- action: homeassistant.turn_on
entity_id: switch.balcony_lights
- delay: 5
# Star
- action: homeassistant.turn_on
entity_id: switch.kids_room_star
- delay: 5
# Advent bedroom
- action: homeassistant.turn_on
entity_id: switch.bedroom_advent_candlestick
cast_goodnight_playlist:
alias: Play goodnight playlist on kids room speaker
sequence:
- action: spotcast.start
data:
device_name: Kids room speaker
uri: !secret spotify_goodnight_playlist
repeat: context
shuffle: false
offset: >
{{ state_attr('sensor.goodnight_playlist_story_indexes', 'indexes') | random }}
- action: media_player.volume_set
data:
volume_level: 0.4
target:
entity_id: media_player.kids_room_speaker
analyze_camera_image:
alias: Analyze camera image
sequence:
- action: llmvision.image_analyzer
data:
remember: false
include_filename: false
target_width: 1280
detail: low
max_tokens: 100
temperature: 0.2
expose_images: false
provider: 01JFSR6DB480BQ1J8WXBVWF8EG
message: Describe this image
image_entity:
- camera.magic_mirror_camera
response_variable: Response
analyze_camera_stream:
sequence:
- action: llmvision.stream_analyzer
data:
remember: false
duration: 5
max_frames: 3
include_filename: true
target_width: 1280
detail: low
max_tokens: 100
temperature: 0.2
expose_images: false
provider: 01JFSR6DB480BQ1J8WXBVWF8EG
message: >-
Tell me how many people are leaving and entering the video frame to
left respective right
image_entity:
- camera.magic_mirror_camera
response_variable: response