-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
253 lines (252 loc) · 7.17 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
turn_off_interior_lights:
alias: Interior Off
sequence:
- service: homeassistant.turn_off
data: {}
target:
entity_id: group.interior_lights
mode: single
icon: mdi:power-off
climate_away:
alias: Climate Away
sequence:
- device_id: 8ff6e575e11c54a1fac5f4e022eee597
domain: climate
entity_id: climate.nest_main_floor
type: set_preset_mode
preset_mode: eco
- device_id: 4f3598c36421216e7bb6cfbe1b746e3f
domain: climate
entity_id: climate.nest_2nd_floor
type: set_preset_mode
preset_mode: eco
- service: input_number.set_value
data:
value: '{{ state_attr(''climate.nest_main_floor'', ''temperature'') }}'
target:
entity_id: input_number.temperature_main_floor
- service: input_number.set_value
data:
value: '{{ state_attr(''climate.nest_2nd_floor'', ''temperature'') }}'
target:
entity_id: input_number.temperature_2nd_floor
- service: input_text.set_value
data:
value: '{{ states("climate.nest_main_floor") }}'
target:
entity_id: input_text.temperature_mode_main_floor
- service: input_text.set_value
data:
value: '{{ states("climate.nest_2nd_floor") }}'
target:
entity_id: input_text.temperature_mode_2nd_floor
mode: single
icon: mdi:hvac-off
garage_close:
alias: Garage Close
sequence:
- device_id: d21fee64f0e0c227432ffa0d1fef645c
domain: cover
entity_id: cover.garage_door_1
type: close
- device_id: 74a88108496f76670a72647bd2ae7638
domain: cover
entity_id: cover.garage_door_2
type: close
mode: single
icon: mdi:garage-variant
tvs_off:
alias: TVs Off
sequence:
- type: turn_off
device_id: 3f4fe812a5d77aa5b461a1658c956f48
entity_id: remote.sony_bravia_tv
domain: remote
mode: single
icon: mdi:television-off
go_sleep:
alias: Go Sleep
sequence:
- service: homeassistant.turn_off
data: {}
target:
entity_id:
- group.first_floor_lights
- device_id: 8ff6e575e11c54a1fac5f4e022eee597
domain: climate
entity_id: climate.nest_main_floor
type: set_preset_mode
preset_mode: eco
- device_id: d21fee64f0e0c227432ffa0d1fef645c
domain: cover
entity_id: cover.garage_door_1
type: close
mode: single
icon: mdi:sleep
notify_engine:
alias: Notify Engine
mode: single
icon: mdi:bell-badge
sequence:
- service: "{% if who == 'john' %}\n notify.mobile_app_jk\n{% elif who == 'cfalb'
%}\n notify.mobile_app_cfalb\n{% elif who == 'family' %}\n notify.ios_family\n{%
else %}\n notify.ios_family\n{% endif %}\n"
data:
title: '{{title}}'
message: '{{message}}'
data:
image: '{{image}}'
speech_processing:
alias: Speech Processing
mode: queued
icon: mdi:text-to-speech
sequence:
- condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.quiet_mode
state: 'off'
- condition: state
entity_id: input_boolean.alert_mode
state: 'on'
- condition: state
entity_id: input_boolean.speech_notifications
state: 'on'
- service: media_player.volume_set
data:
entity_id: '{{ media_player }}
'
volume_level: "{% if now().strftime('%H')|int < 10 and now().strftime('%H')|int
> 6 %}\n 0.3\n{% elif now().strftime('%H')|int > 10 and now().strftime('%H')|int
< 20 %}\n 0.5\n{% else %}\n 0.3\n{% endif %}"
- service: notify.alexa_media
data:
data:
type: tts
target: group.amazon_alexas
message: '{{speech_message}}'
- service: input_boolean.turn_off
data:
entity_id:
- input_boolean.alert_mode
max: 10
speech_engine:
alias: Speech Engine
mode: queued
icon: mdi:text-to-speech
sequence:
- condition: or
conditions:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
- service: script.speech_processing
data:
media_player: "{% if media_player | length == 0 %}\n {% set media_player =
[\n 'media_player.john_s_echo_show'\n ] %}\n{% endif %} {% if media_player
is not string and media_player is sequence %}\n {% set media_player = media_player|join(',
') %}\n{% endif %} {{ media_player }}"
speech_message: '{{speech_message}}'
climate_activate:
alias: Climate Activate
sequence:
- service: climate.set_temperature
data:
temperature: '{{ states("input_number.temperature_main_floor") }}'
hvac_mode: '{{ states("input_text.temperature_mode_main_floor") }}'
target:
entity_id: climate.nest_main_floor
- service: climate.set_temperature
data:
temperature: '{{ states("input_number.temperature_2nd_floor") }}'
hvac_mode: '{{ states("input_text.temperature_mode_2nd_floor") }}'
target:
entity_id: climate.nest_2nd_floor
mode: single
icon: mdi:hvac
display_doorbell_snapshot_on_tvs:
mode: single
alias: Display Doorbell Snapshot on TVs
icon: mdi:doorbell-video
sequence:
- condition: state
entity_id: remote.sony_bravia_tv
state: 'on'
- service: camera.snapshot
target:
device_id: 92b464fee4dab94c831b8ff8686f330a
data:
filename: /config/www/images/doorbell_camera_alert.jpg
- service: notify.family_room_tv
data:
message: Somebody is at the door!
data:
image:
path: /config/www/images/doorbell_camera_alert.jpg
title: Bouncer
play_doorbell:
alias: Play Doorbell
icon: mdi:doorbell
mode: single
sequence:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: input_boolean.quiet_mode
state: 'off'
- service: media_player.play_media
data:
entity_id:
- media_player.sonos_office
- media_player.sonos_family_and_kitchen
media_content_id: https://raw.githubusercontent.com/johnkoht/hass-config/master/config/sounds/ding-dong.mp3
media_content_type: music
set_doorbell_message:
alias: Set Doorbell Message
mode: single
icon: mdi:android-messages
sequence:
- service: select.select_option
data:
entity_id: select.front_door_camera_doorbell_text
option: "{% if message == \"quiet_mode\" %}\n SHHH…KIDS SLEEPING\n{% elif message
== \"dnd\" %}\n DO NOT DISTURB\n{% elif message == \"leave_package\" %}\n
\ LEAVE PACKAGE AT DOOR\n{% elif message == \"welcome\" %}\n WELCOME!\n{%
else %}\n WELCOME!\n{% endif %}"
test_speech_engine:
alias: Test speech engine
mode: queued
icon: mdi:text-to-speech
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.sonos_office
volume_level: 0.1
- service: tts.google_say
entity_id: group.announcements_devices
data:
message: '{{ speech_message }}'
max: 10
text_to_speech_on_sonos_test:
alias: Text-to-Speech on Sonos Test
use_blueprint:
path: Talvish/sonos_say.yaml
input:
tts_service_name: google_say
mode: single