-
Notifications
You must be signed in to change notification settings - Fork 1
/
scripts.yaml
244 lines (224 loc) · 6.26 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
#
# These scripts create "switches" that HomeKit (and Siri) can trigger via voice.
#
away_from_home_scene:
alias: "Away from Home"
sequence:
- service: scene.turn_on
entity_id: scene.away_from_home
data:
transition: 30
bedtime_scene:
alias: "Bedtime"
sequence:
- service: scene.turn_on
entity_id: scene.bedtime
blue_fire_scene:
alias: "Blue Fire"
sequence:
- service: scene.turn_on
entity_id: scene.blue_fire
cooking_time_scene:
alias: "Cooking Time"
sequence:
- service: scene.turn_on
entity_id: scene.cooking_time
data:
transition: 3
good_morning_scene:
alias: "Good Morning"
sequence:
- service: scene.turn_on
entity_id: scene.good_morning
data:
transition: 30
goodnight_scene:
alias: "Goodnight"
sequence:
- service: scene.turn_on
entity_id: scene.goodnight
data:
transition: 60
kitchen_cleanup_scene:
alias: "Kitchen Cleanup"
sequence:
- service: scene.turn_on
entity_id: scene.kitchen_cleanup
data:
transition: 2.5
lazy_afternoon_scene:
alias: "Lazy Afternoon"
sequence:
- service: scene.turn_on
entity_id: scene.lazy_afternoon
low_key_scene:
alias: "Low Key"
sequence:
- service: scene.turn_on
entity_id: scene.low_key
data:
transition: 20
making_time_scene:
alias: "Making Time"
sequence:
- service: scene.turn_on
entity_id: scene.making_time
movie_time_scene:
alias: "Movie Time"
sequence:
- service: scene.turn_on
entity_id: scene.movie_time
data:
transition: 7
normal_evening_scene:
alias: "Normal Evening"
sequence:
- service: scene.turn_on
entity_id: scene.normal_evening
data:
transition: 3
- service: script.wled_start_raving
data:
wled: light.laundry_room_cabinet
brightness: 200
- service: script.lzw45_pixel_effect
data:
lzw45: light.workshop_light_strip
effect: aurora
sleepy_time_scene:
alias: "Sleepy Time"
sequence:
- service: scene.turn_on
entity_id: scene.sleepy_time
up_late_scene:
alias: "Up Late"
sequence:
- service: scene.turn_on
entity_id: scene.up_late
work_at_home_scene:
alias: "Work at Home"
sequence:
- service: scene.turn_on
entity_id: scene.work_at_home
### End HomeKit Automation Scripts
wled_start_raving:
alias: WLED - Start Raving
description: Makes a WLED device rave
mode: restart
fields:
wled:
description: (required) The entity_id of the WLED device
example: light.laundry_room_cabinet
brightness:
description: (required) The brightness of the light 0 .. 254
example: "69"
sequence:
- condition: template
value_template: "{{ wled is defined }}"
- service: light.turn_on
data:
brightness: "{{ brightness }}"
target:
entity_id: "{{ wled }}"
- service: wled.effect
target:
entity_id: "{{ wled }}"
data:
effect: Colortwinkles
intensity: 223
palette: Rainbow
reverse: false
speed: 250
# Goofy one to trigger the wind mode in the guest room
#guest_room_the_wind:
# alias: "The Wind"
# sequence:
# - service: light.turn_on
# entity_id: light.guest_room_fan_as_light
# data_template:
# brightness_pct: "1"
# transition: 0
# Taken from https://community.home-assistant.io/t/inovelli-led-strip-lzw45-pixel-effects-script/275264
lzw45_pixel_effect:
alias: LZW45 Pixel Effect
description: Sets the pixel effects for the Inovelli LZW45 LED Strip
mode: restart
fields:
lzw45:
description: (required) The entity_id for the lzw45 LED Strip.
example: light.light_strip
effect:
description: (required) The desired effect - static, blink, breath, color-wipe, color-wipe-reverse-inverse, color-wipe-random, random-color, single-dynamic, multi-dynamic, rainbow, rainbow-cycle, scan, dual-scan, fade, running-lights, twinkle, twinkle-random, twinkle-fade, twinkle-fade-random, sparkle, flash-sparkle, hyper-sparkle, strobe, blink-rainbow, chase-white, chase-color, chase-random, chase-rainbow, chase-flash, chase-flash-random, chase-rainbow-white, chase-blackout, chase-blackout-rainbow, color-sweep-random, running-color, running-red-blue, running-random, larson-scanner, comet, fireworks, fireworks-random, merry-christmas, circus-combustus, halloween, aurora
example: breath
brightness_pct:
description: (optional) The brightness percent, 0 - 99. Defaults to 99 if omitted.
example: "99"
variables:
byte1: >
{%- set effect = effect | default('static') | lower | replace(' ', '-') %}
{%- set effects = [
'static',
'blink',
'breath',
'color-wipe',
'color-wipe-reverse-inverse',
'color-wipe-random',
'random-color',
'single-dynamic',
'multi-dynamic',
'rainbow',
'rainbow-cycle',
'scan',
'dual-scan',
'fade',
'running-lights',
'twinkle',
'twinkle-random',
'twinkle-fade',
'twinkle-fade-random',
'sparkle',
'flash-sparkle',
'hyper-sparkle',
'strobe',
'blink-rainbow',
'chase-white',
'chase-color',
'chase-random',
'chase-rainbow',
'chase-flash',
'chase-flash-random',
'chase-rainbow-white',
'chase-blackout',
'chase-blackout-rainbow',
'color-sweep-random',
'running-color',
'running-red-blue',
'running-random',
'larson-scanner',
'comet',
'fireworks',
'fireworks-random',
'merry-christmas',
'circus-combustus',
'halloween',
'aurora'
] %}
{{ effects.index(effect) + 1 if effect in effects else 1 }}
byte2: >
{%- set pct = (brightness_pct | default(99)) | int %}
{%- if 0 <= pct <= 99 %}
{{ pct }}
{%- else %}
99
{%- endif %}
bytes: >
{{ byte2 * 2**8 + byte1 }}
sequence:
- condition: template
value_template: "{{ lzw45 is defined }}"
- service: zwave_js.bulk_set_partial_config_parameters
target:
entity_id: "{{ lzw45 }}"
data:
parameter: 31
value: "{{ bytes }}"