-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations.yaml
308 lines (280 loc) · 8.23 KB
/
automations.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
- id: sunset
alias: Sunset Report
trigger:
platform: sun
event: sunset
offset: -01:30
action:
- service: notify.telegram_notify
data_template:
title: Temperature Summary
message: "Summary for Sunset: \nBedroom, {{ states.sensor.temperature_bedroom.state }} C / {{ states.sensor.humidity_bedroom.state }} %\nLivingroom, {{ states.sensor.temperature_livingroom.state }} C / {{ states.sensor.humidity_livingroom.state }} %\nFunroom, {{ states.sensor.temperature_funroom.state }} C / {{ states.sensor.humidity_funroom.state }} %\nTerrarium, {{ states.sensor.temperature_terrarium.state }} C / {{ states.sensor.humidity_terrarium.state }} %"
- id: temp
alias: Temperature Alert
trigger:
platform: numeric_state
entity_id: sensor.temperature_bedroom
above: 23
action:
- service: notify.telegram_notify
data_template:
message: "Temperature above 23 in Bedroom: \nBedroom, {{ states.sensor.temperature_bedroom.state }} C / {{ states.sensor.humidity_bedroom.state }} %\nLivingroom, {{ states.sensor.temperature_livingroom.state }} C / {{ states.sensor.humidity_livingroom.state }} %\nGuestroom, {{ states.sensor.temperature_guestroom.state }} C / {{ states.sensor.humidity_guestroom.state }} %"
- id: tempLowFun
alias: Temp too low in Funroom
trigger:
platform: numeric_state
entity_id: sensor.temperature_funroom
below: 20
action:
- service: notify.telegram_notify
data_template:
message: "Temperature too low in FunRoom! \nCurrently: {{ states.sensor.temperature_funroom.state }} C / {{ states.sensor.humidity_funroom.state }} %"
- id: tempHighFun
alias: Temp too high in Funroom
trigger:
platform: numeric_state
entity_id: sensor.temperature_funroom
above: 32
action:
- service: notify.telegram_notify
data_template:
message: "Temperature too high in FunRoom! \nCurrently: {{ states.sensor.temperature_funroom.state }} C / {{ states.sensor.humidity_funroom.state }} %"
- id: humLowTerr
alias: Low Humidity in Terrarium
trigger:
platform: numeric_state
entity_id: sensor.humidity_terrarium
below: !secret terr_humidity_limit
action:
- service: notify.telegram_notify
data_template:
message: "Humidity too low in Terrarium!\nCurrently: {{ states.sensor.humidity_terrarium.state }} %"
- id: tempHighTerr
alias: High Temp in Terrarium
trigger:
platform: numeric_state
entity_id: sensor.temperature_terrarium
above: !secret terr_temp_upper_limit
action:
- service: notify.telegram_notify
data_template:
message: "Temperature too high in Terrarium!\nCurrently: {{ states.sensor.temperature_terrarium.state }} %"
- id: humidity_bedroom
alias: Humidity Bedroom Alert
trigger:
platform: numeric_state
entity_id: sensor.humidity_bedroom
above: 65
action:
- service: notify.telegram_notify
data_template:
message: "Too much humidity in bedroom: \n{{ states.sensor.humidity_bedroom.state }} %"
- id: webcamimagesmorning
alias: Daily Morning Webcam Images
trigger:
platform: time
at: '07:00:00'
action:
- service: telegram_bot.send_photo
data:
file: /tmp/lastsnap.jpg
- id: webcamimagesevening
alias: Daily Evening Webcam Images
trigger:
platform: time
at: '19:00:00'
action:
- service: telegram_bot.send_photo
data:
file: /tmp/lastsnap.jpg
- id: telegram
alias: 'Telegram bot that reply pong to ping'
hide_entity: true
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/ping'
action:
- service: notify.telegram_notify
data:
message: 'pong'
- id: telegramLightOff
alias: 'Switch off all Lights via Telegram'
hide_entity: true
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/lightsoff'
action:
- service: light.turn_off
entity_id: group.all_lights
- service: shell_command.kitchen_off
- id: telegramAlarmOn
alias: 'Alarms on via Telegram'
hide_entity: true
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/alarmon'
action:
- service: automation.turn_on
entity_id: automation.main_door_alarm
- service: automation.turn_on
entity_id: automation.fun_door_alarm
- service: notify.telegram_notify
data:
message: 'Alarms enabled'
- id: telegramAlarmOff
alias: 'Alarms off via Telegram'
hide_entity: true
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/alarmoff'
action:
- service: automation.turn_off
entity_id: automation.main_door_alarm
- service: automation.turn_off
entity_id: automation.fun_door_alarm
- service: notify.telegram_notify
data:
message: 'Alarms disabled'
- id: telegramWebcamRequest
alias: 'Request Webcam image via Telegram'
hide_entity: true
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/webcam'
action:
- service: telegram_bot.send_photo
data:
file: /tmp/lastsnap.jpg
- id: telegramTemperatureRequest
alias: 'Request Temperature Summary via Telegram'
hide_entity: true
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/temperature'
action:
- service: notify.telegram_notify
data_template:
title: Temperature On Demand
message: "Summary on Demand: \nBedroom, {{ states.sensor.temperature_bedroom.state }} C / {{ states.sensor.humidity_bedroom.state }} %\nLivingroom, {{ states.sensor.temperature_livingroom.state }} C / {{ states.sensor.humidity_livingroom.state }} %\nFunroom, {{ states.sensor.temperature_funroom.state }} C / {{ states.sensor.humidity_funroom.state }} %\nTerrarium, {{ states.sensor.temperature_terrarium.state }} C / {{ states.sensor.humidity_terrarium.state }} %"
- id: bedroomMotion
alias: 'Motion in bedroom'
trigger:
platform: state
entity_id: sensor.motion_bedroom
to: 'on'
condition:
condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
- service: light.turn_on
data:
entity_id: group.bedroom
brightness: 50
- id: bedroomMotionOff
alias: 'Turn off bedroom light delayed'
trigger:
platform: state
entity_id: sensor.motion_bedroom
to: 'off'
for:
minutes: 2
action:
service: light.turn_off
entity_id: group.bedroom
- id: mainDoorAlarm
alias: 'Main Door Alarm'
trigger:
platform: state
entity_id: sensor.door_alarm
to: 'on'
action:
- service: notify.telegram_notify
data:
message: 'Main-Door was opened'
- id: funDoorAlarm
alias: 'Fun Door Alarm'
trigger:
platform: state
entity_id: sensor.fun_door_alarm
to: 'on'
action:
- service: notify.telegram_notify
data:
message: 'Funroom-Door was opened'
- id: kitchenOn
alias: 'Kitchen Light On'
hide_entity: true
trigger:
platform: state
entity_id: input_boolean.kitchen_light
to: 'on'
action:
service: shell_command.kitchen_on
- id: kitchenOff
alias: 'Kitchen Light Off'
hide_entity: true
trigger:
platform: state
entity_id: input_boolean.kitchen_light
to: 'off'
action:
service: shell_command.kitchen_off
- id: xmasOn
alias: 'XMas Light On'
hide_entity: true
trigger:
platform: state
entity_id: input_boolean.xmas_light
to: 'on'
action:
service: shell_command.xmas_on
- id: xmasAutoOn
alias: 'XMas Light AutoOn'
trigger:
platform: sun
event: sunset
offset: 02:00
action:
service: shell_command.xmas_on
- id: xmasOff
alias: 'XMas Light Off'
hide_entity: true
trigger:
platform: state
entity_id: input_boolean.xmas_light
to: 'off'
action:
service: shell_command.xmas_off
- id: xmasAutoOff
alias: 'XMas Light AutoOff'
trigger:
platform: time
at: '21:00:00'
action:
service: shell_command.xmas_off
#automation movie:
# alias: Movie
# triggerMainMainMainMainMainMain :
# platform: state
# entity_id: media_player.amazon_fire_tv
# to: 'playing'
# condition:
# condition: state
# entity_id: sun.sun
# state: 'below_horizon'
# action:
# service: scene.turn_on
# entity_id: scene.movies