-
Notifications
You must be signed in to change notification settings - Fork 0
/
Automatiosunscreen-blueprint.yaml
359 lines (359 loc) · 12.1 KB
/
Automatiosunscreen-blueprint.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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
blueprint:
name: Sunscreen Control
description: Check to see if sunscreen needs to be opened or closed
domain: automation
input:
sunscreen_valid_wind:
name: Sunscreen Valid Wind
selector:
entity:
domain: binary_sensor
sunscreen_valid_rain:
name: Sunscreen Valid Rain
selector:
entity:
domain: binary_sensor
sunscreen_valid_azimuth:
name: Sunscreen Valid Azimuth
selector:
entity:
domain: binary_sensor
sunscreen_valid_elevation:
name: Sunscreen Valid Elevation
selector:
entity:
domain: binary_sensor
sunscreen_valid_irradiance:
name: Sunscreen Valid Irradiance
selector:
entity:
domain: binary_sensor
sunscreen_valid_months_for_execution:
name: Sunscreen Valid Months for Execution
selector:
entity:
domain: binary_sensor
sunscreen_valid_min_outdoor_temp:
name: Sunscreen Valid min outdoor temp
selector:
entity:
domain: binary_sensor
sunscreen_valid_min_inside_temp:
name: Sunscreen Valid inside temp
selector:
entity:
domain: binary_sensor
sunscreen_delay:
name: Sunscreen Delay
selector:
entity:
domain: timer
sunscreen_set_manual:
name: Sunscreen Set Manual
selector:
entity:
domain: input_boolean
buienradar_precipitation_forecast_total:
name: Buienradar Precipitation Forecast Total
selector:
entity:
domain: sensor
sunscreen_set_regen:
name: Sunscreen Set Regen
selector:
entity:
domain: input_number
buienradar_wind_speed:
name: Buienradar Wind Speed
selector:
entity:
domain: sensor
sunscreen_set_windsnelheid:
name: Sunscreen Set Windsnelheid
selector:
entity:
domain: input_number
woonkamer_temperature:
name: Woonkamer Temperature
selector:
entity:
domain: sensor
sunscreen_set_min_inside_temp:
name: Sunscreen Set Min Inside Temp
selector:
entity:
domain: input_number
buienradar_temperature:
name: Buienradar Temperature
selector:
entity:
domain: sensor
sunscreen_set_min_outside_temp:
name: Sunscreen Set Min Outside Temp
selector:
entity:
domain: input_number
buienradar_irradiance:
name: Buienradar Irradiance
selector:
entity:
domain: sensor
sunscreen_set_irradiance:
name: Sunscreen Set Irradiance
selector:
entity:
domain: input_number
sun_solar_azimuth:
name: Sun Solar Azimuth
selector:
entity:
domain: sensor
sunscreen_valid_azimuth:
name: Sunscreen Valid Azimuth
selector:
entity:
domain: binary_sensor
sun_solar_elevation:
name: Sun Solar Elevation
selector:
entity:
domain: sensor
sunscreen_valid_elevation:
name: Sunscreen Valid Elevation
selector:
entity:
domain: binary_sensor
sunscreen_conditions:
name: Sunscreen Conditions
selector:
entity:
domain: input_boolean
sunscreen_conditions_request:
name: Sunscreen Conditions Request
selector:
entity:
domain: input_boolean
sunscreen_notifications:
name: Sunscreen Notifications
selector:
entity:
domain: input_boolean
notify_device:
name: Notify Device
selector:
device:
integration: mobile_app
sunscreen_fake:
name: Sunscreen Fake
selector:
entity:
domain: input_boolean
cover_sunscreen:
name: Cover Sunscreen
selector:
entity:
domain: cover
google_sheets_config_entry:
name: Google Sheets Config Entry
description: Config entry for Google Sheets integration
selector:
text:
triggers:
- platform: state
entity_id: !input sunscreen_valid_wind
from: "on"
to: "off"
- platform: state
entity_id: !input sunscreen_valid_rain
from: "on"
to: "off"
- platform: state
entity_id:
- !input sunscreen_valid_azimuth
- !input sunscreen_valid_elevation
- !input sunscreen_valid_irradiance
- !input sunscreen_valid_months_for_execution
- !input sunscreen_valid_wind
- !input sunscreen_valid_rain
- platform: state
entity_id: !input sunscreen_delay
from: active
to: idle
condition: []
action:
- service: google_sheets.append_sheet
data:
config_entry: !input google_sheets_config_entry
data:
Date: "{{ now().strftime('%-d-%b-%y') }}"
Smanual: "{{ states(!input sunscreen_set_manual) }}"
rain_next_hour: "{{ states(!input buienradar_precipitation_forecast_total) }}"
Srain_next_hour: "{{ states(!input sunscreen_set_regen) }}"
sunscreen_valid_rain: "{{ states(!input sunscreen_valid_rain) }}"
wind_gust: "{{ states(!input buienradar_wind_speed) }}"
Swind_gust: "{{ states(!input sunscreen_set_windsnelheid) }}"
sunscreen_valid_wind: "{{ states(!input sunscreen_valid_wind) }}"
Temp_Min_inside: "{{ states(!input woonkamer_temperature) }}"
STemp_Min_inside: "{{ states(!input sunscreen_set_min_inside_temp) }}"
sunscreen_valid_min_inside_temp: "{{ states(!input sunscreen_valid_min_inside_temp) }}"
Temp_min_outside: "{{ states(!input buienradar_temperature) }}"
STemp_min_outside: "{{ states(!input sunscreen_set_min_outside_temp) }}"
sunscreen_valid_outdoor_temp: "{{ states(!input sunscreen_valid_min_outdoor_temp) }}"
irradiance: "{{ states(!input buienradar_irradiance) }}"
Sirradiance: "{{ states(!input sunscreen_set_irradiance) }}"
sunscreen_valid_irradiance: "{{ states(!input sunscreen_valid_irradiance) }}"
azimuth: "{{ states(!input sun_solar_azimuth) }}"
Sazimuth: "{{ states(!input sunscreen_valid_azimuth) }}"
sunscreen_valid_azimuth: "{{ states(!input sunscreen_valid_azimuth) }}"
elevation: "{{ states(!input sun_solar_elevation) }}"
Selevation: "{{ states(!input sunscreen_valid_elevation) }}"
sunscreen_valid_elevation: "{{ states(!input sunscreen_valid_elevation) }}"
sunscreen_state: "{{ states(!input cover_sunscreen) }}"
sunscreen_delayed: "{{ states(!input sunscreen_delay) }}"
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: !input sunscreen_valid_months_for_execution
state: "on"
- condition: state
entity_id: !input sunscreen_valid_elevation
state: "on"
- condition: state
entity_id: !input sunscreen_valid_azimuth
state: "on"
- condition: state
entity_id: !input sunscreen_valid_irradiance
state: "on"
- condition: state
entity_id: !input sunscreen_valid_wind
state: "on"
- condition: state
entity_id: !input sunscreen_valid_rain
state: "on"
- condition: state
entity_id: !input sunscreen_valid_min_outdoor_temp
state: "on"
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input sunscreen_conditions_request
default:
- service: input_boolean.turn_off
target:
entity_id: !input sunscreen_conditions_request
- if:
- condition: template
value_template: >
{{ states(!input sunscreen_conditions) == states(!input sunscreen_conditions_request) }}
then:
- stop: condities are the same, nothing to do. Abort further running
- choose:
- conditions:
- condition: trigger
id: sunscreen_action_critical
sequence: []
- conditions:
- condition: and
conditions:
- condition: trigger
id: sunscreen_action_normal
- condition: state
entity_id: !input sunscreen_delay
state: idle
- condition: state
entity_id: !input sunscreen_set_manual
state: "off"
sequence: []
- conditions:
- condition: and
conditions:
- condition: trigger
id: sunscreen_action_delayed
- condition: state
entity_id: !input sunscreen_set_manual
state: "off"
sequence: []
default:
- stop: Not defined
error: false
- if:
- condition: state
entity_id: !input sunscreen_conditions_request
state: "on"
- condition: state
entity_id: !input sunscreen_delay
state: idle
then:
- service: input_boolean.turn_on
target:
entity_id:
- !input sunscreen_fake
- !input sunscreen_conditions
- service: cover.open_cover
target:
entity_id: !input cover_sunscreen
- service: timer.start
target:
entity_id: !input sunscreen_delay
- if:
- condition: state
entity_id: !input sunscreen_notifications
state: "on"
then:
- service: notify.mobile_app_mi13
data:
title: Sunscreen opened
message: Sunscreen has been opened
else:
- service: timer.start
target:
entity_id: !input sunscreen_delay
- service: input_boolean.turn_off
target:
entity_id:
- !input sunscreen_conditions
- !input sunscreen_fake
- service: cover.close_cover
target:
entity_id: !input cover_sunscreen
- if:
- condition: state
entity_id: !input sunscreen_notifications
state: "on"
then:
- service: notify.mobile_app_mi13
data:
title: Sunscreen closed
message: Sunscreen has been closed
- service: google_sheets.append_sheet
data:
config_entry: !input google_sheets_config_entry
data:
Date: "{{ now().strftime('%-d-%b-%y') }}"
Smanual: "{{ states(!input sunscreen_set_manual) }}"
rain_next_hour: "{{ states(!input buienradar_precipitation_forecast_total) }}"
Srain_next_hour: "{{ states(!input sunscreen_set_regen) }}"
sunscreen_valid_rain: "{{ states(!input sunscreen_valid_rain) }}"
wind_gust: "{{ states(!input buienradar_wind_speed) }}"
Swind_gust: "{{ states(!input sunscreen_set_windsnelheid) }}"
sunscreen_valid_wind: "{{ states(!input sunscreen_valid_wind) }}"
Temp_Min_inside: "{{ states(!input woonkamer_temperature) }}"
STemp_Min_inside: "{{ states(!input sunscreen_set_min_inside_temp) }}"
sunscreen_valid_min_inside_temp: "{{ states(!input sunscreen_valid_min_inside_temp) }}"
Temp_min_outside: "{{ states(!input buienradar_temperature) }}"
STemp_min_outside: "{{ states(!input sunscreen_set_min_outside_temp) }}"
sunscreen_valid_outdoor_temp: "{{ states(!input sunscreen_valid_min_outdoor_temp) }}"
irradiance: "{{ states(!input buienradar_irradiance) }}"
Sirradiance: "{{ states(!input sunscreen_set_irradiance) }}"
sunscreen_valid_irradiance: "{{ states(!input sunscreen_valid_irradiance) }}"
azimuth: "{{ states(!input sun_solar_azimuth) }}"
Sazimuth: "{{ states(!input sunscreen_valid_azimuth) }}"
sunscreen_valid_azimuth: "{{ states(!input sunscreen_valid_azimuth) }}"
elevation: "{{ states(!input sun_solar_elevation) }}"
Selevation: "{{ states(!input sunscreen_valid_elevation) }}"
sunscreen_valid_elevation: "{{ states(!input sunscreen_valid_elevation) }}"
sunscreen_state: "{{ states(!input cover_sunscreen) }}"
sunscreen_delayed: "{{ states(!input sunscreen_delay) }}"
mode: single