-
Notifications
You must be signed in to change notification settings - Fork 201
/
scripts.yaml
executable file
·241 lines (210 loc) · 6.94 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
navigate_to_lights:
alias: 'Navigate - Lights'
sequence:
- service: browser_mod.navigate
data:
navigation_path: /lovelace/0
deviceID:
- tablet
navigate_to_cleanup:
alias: 'Navigate - Cleanup'
sequence:
- service: browser_mod.navigate
data:
navigation_path: /lovelace/1
deviceID:
- tablet
navigate_to_media:
alias: 'Navigate - Media'
sequence:
- service: browser_mod.navigate
data:
navigation_path: /lovelace/2
deviceID:
- tablet
navigate_to_weather:
alias: 'Navigate - Weather'
sequence:
- service: browser_mod.navigate
data:
navigation_path: /lovelace/3
deviceID:
- tablet
navigate_to_health:
alias: 'Navigate - Health'
sequence:
- service: browser_mod.navigate
data:
navigation_path: /lovelace/4
deviceID:
- tablet
## Switch Audio when projector is turned on
audio_input_projector:
alias: 'Set Audio: Projector'
sequence:
- service: broadlink.send
data:
host: 192.168.178.185
packet: 'JgBYAAABJ5UUERMTFRAVERIUFBETExI4FRATExURFBESOBU1FTUSFBMSFTUSFBM3EhQSExQ2EzcSOBQREzgSExM3EjgTEhMUEAAFpwABKEoTAAxVAAEnSxUADQU==='
audio_input_bluetooth:
alias: 'Set Audio: Bluetooth'
sequence:
- service: broadlink.send
data:
host: 192.168.178.185
packet: 'JgBYAAABKpEVERIUFBETExUQFRIRFBQ2FBIRFBQRExMVNRU1EjgVEBUREjgVNRU1EhQUERU2ETgVNRUREhMVERI4EzcUERMTFAAFpAABKkgSAAxWAAEnSxMADQU==='
#### Only one media player play at a time ####
plex_moviestarted:
alias: 'Pause Music'
sequence:
- service: scene.turn_on
data:
entity_id: scene.plex
- service: media_player.media_pause
data:
entity_id: media_player.spotify
- service: browser_mod.close_popup
plex_continuemovie:
alias: 'Continue Movie'
sequence:
- service: media_player.media_play
data:
entity_id: media_player.plex_projector
- service: browser_mod.close_popup
#### Slowly lighten the room when a movie ends ####
slowly_turn_on_livingroom:
alias: 'Slowly On Living Room'
sequence:
- service: light.turn_on
data:
entity_id: light.plant_table
brightness: 150
color_temp: 360
- service: light.turn_on
data:
entity_id: light.table
brightness: 150
color_temp: 360
speak_sugar_level:
alias: 'Ask Google for Sugar Level'
sequence:
- delay:
seconds: 1
- service: tts.google_say
entity_id:
- media_player.home_hub
data_template:
message: >-
Luke's sugar level is {{states('sensor.luke_cgm_sgv_mmol')}}
#### Scripts for Xiaomi Robot room by room cleaning ####
## (To do this, robot must ONLY use zoned cleaning, otherwise the map will reorient itself! :S )
clean_kitchen:
alias: 'Clean Kitchen'
sequence:
- condition: template
value_template: "{{ is_state('input_text.room_cleaning','charging') or is_state('input_text.room_cleaning','none') or is_state('input_text.room_cleaning','goinghome') }}"
# - service: vaccum.stop
# data:
# entity:_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params:
- [25200, 21500, 28400, 24100, 1]
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "kitchen"
clean_livingroom:
alias: 'Clean Living Room'
sequence:
- condition: template
value_template: "{{ is_state('input_text.room_cleaning','charging') or is_state('input_text.room_cleaning','none') or is_state('input_text.room_cleaning','goinghome') or is_state('input_text.room_cleaning','paused') }}"
# - service: vaccum.stop
# data:
# entity:_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params:
- [25200,18600, 25200,18600, 1]
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "livingroom"
clean_study:
alias: 'Clean Study'
sequence:
- condition: template
value_template: "{{ is_state('input_text.room_cleaning','charging') or is_state('input_text.room_cleaning','none') or is_state('input_text.room_cleaning','goinghome') or is_state('input_text.room_cleaning','paused') }}"
# - service: vaccum.stop
# data:
# entity:_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params:
- [31000, 20900, 34000, 22800, 1]
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "study"
clean_bedroom:
alias: 'Clean Bedroom'
sequence:
- condition: template
value_template: "{{ is_state('input_text.room_cleaning','charging') or is_state('input_text.room_cleaning','none') or is_state('input_text.room_cleaning','goinghome') or is_state('input_text.room_cleaning','paused') }}"
# - service: vaccum.stop
# data:
# entity:_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params:
- [31000, 22900 ,34000, 28000, 1]
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "bedroom"
clean_house:
alias: 'Clean House'
sequence:
- condition: template
value_template: "{{ is_state('input_text.room_cleaning','charging') or is_state('input_text.room_cleaning','none') or is_state('input_text.room_cleaning','goinghome') or is_state('input_text.room_cleaning','paused') }}"
# - service: vaccum.stop
# data:
# entity:_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
command: app_zoned_clean
params:
- [25600, 25200 ,34000, 18600, 1]
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "house"
stop_cleaning:
alias: 'Stop Cleaning'
sequence:
- service: vaccum.stop
data:
entity:_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.return_to_base
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "none"
clean_nothing:
alias: 'Clean Stopping'
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.room_cleaning
value: "none"