-
Notifications
You must be signed in to change notification settings - Fork 1
/
automations.yaml
3022 lines (3022 loc) · 85.1 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
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
- id: '1672023260202'
alias: YERP [Boilerplate] Wellness Check Prompt
description: ''
trigger:
- platform: state
entity_id:
- input_select.yerp_boilerplate_session_status
to: elevated
id: Elevated
- platform: state
entity_id:
- input_select.yerp_boilerplate_session_status
to: seekinghelp
id: Seeking Help
- platform: state
entity_id:
- input_select.yerp_boilerplate_session_status
id: Seeking Help Ends
from: seekinghelp
condition: []
action:
- if:
- condition: trigger
id: Seeking Help
then:
- service: media_player.play_media
target:
entity_id: media_player.vlc_telnet
data:
media_content_id: media-source://media_source/local/toxic-bardcore.mp3
media_content_type: audio/mpeg
metadata:
title: toxic-bardcore.mp3
thumbnail:
media_class: music
children_media_class:
navigateIds:
- media_content_type: app
media_content_id: media-source://media_source
- service: notify.twilio_sms
data:
message: '{{ (states(''input_number.yerp_boilerplate_failsafe_threshold'')
| int(0) | round ) }} seconds have passed, unresponded, since a wellness
check was prompted for the {{ states(''input_text.yerp_boilerplate_friendly_room_name'')
}}'
target: -!secret seeking_help_number
- if:
- condition: trigger
id: Elevated
then:
- service: tts.speak
data:
cache: true
media_player_entity_id: media_player.yerp_demo
message: Please check on the physical bathroom.
target:
entity_id: tts.piper
- service: input_boolean.turn_on
data: {}
target:
entity_id:
- input_boolean.yerp_boilerplate_elevated_countdown
- service: timer.start
data:
duration: '{{ states(''input_number.yerp_boilerplate_failsafe_threshold'')
}}'
target:
entity_id: timer.yerp_boilerplate_failsafe_timer
- if:
- condition: trigger
id: Seeking Help Ends
then:
- service: media_player.media_stop
data: {}
target:
entity_id: media_player.vlc_telnet
mode: single
- id: '1672023909002'
alias: YERP [Boilerplate] Timer Actions
description: ''
trigger:
- platform: event
event_type: timer.started
event_data:
entity_id: timer.yerp_boilerplate_warmup
id: Warmup Begins
alias: Warmup Begins
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_warmup
id: Warmup Ends
alias: Warmup Ends
- platform: event
event_type: timer.cancelled
event_data:
entity_id: timer.yerp_boilerplate_warmup
id: Warmup is Canceled
alias: Warmup Canceled
- platform: event
event_type: timer.started
event_data:
entity_id: timer.yerp_boilerplate_threshold_countdown
id: Spotting Begins
alias: Spotting Begins
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_threshold_countdown
id: Spotting Ends
alias: Spotting Ends
- platform: event
event_type: timer.cancelled
event_data:
entity_id: timer.yerp_boilerplate_threshold_countdown
id: Spotting is Canceled
alias: Spotting Canceled
- platform: event
event_type: timer.started
event_data:
entity_id: timer.yerp_boilerplate_session_duration_limit
id: Duration Limit Begins
alias: Duration Limit Begins
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_session_duration_limit
id: Duration Limit Ends
alias: Duration Limit Ends
- platform: event
event_type: timer.cancelled
event_data:
entity_id: timer.yerp_boilerplate_session_duration_limit
id: Duration Limit is Canceled
alias: Duration Limit Canceled
- platform: event
event_type: timer.started
event_data:
entity_id: timer.yerp_boilerplate_failsafe_timer
id: Elevated Begins
alias: Elevated Begins
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_failsafe_timer
id: Elevated Ends
alias: Elevated Ends
- platform: event
event_type: timer.cancelled
event_data:
entity_id: timer.yerp_boilerplate_failsafe_timer
id: Elevated Canceled
alias: Elevated Canceled
condition: []
action:
- if:
- condition: trigger
id: Warmup Begins
then:
- service: light.turn_on
data:
brightness_pct: 100
flash: short
color_name: green
target:
entity_id: light.yerp_boilerplate_lights
- if:
- condition: trigger
id: Warmup Ends
then:
- service: light.turn_on
data:
brightness_pct: 100
rgb_color:
- 0
- 6
- 179
target:
entity_id: light.yerp_boilerplate_lights
- if:
- condition: trigger
id: Spotting Begins
then:
- service: light.turn_on
data:
rgb_color:
- 38
- 128
- 0
brightness_pct: 100
target:
entity_id: light.yerp_boilerplate_lights
- delay:
seconds: '{{ ( states(''input_number.yerp_boilerplate_threshold'') | int(0)
* 0.75 ) }}'
- service: light.turn_on
data:
rgb_color:
- 255
- 194
- 26
brightness_pct: 100
transition: 5
target:
entity_id: light.yerp_boilerplate_lights
- delay:
seconds: '{{ ( states(''input_number.yerp_boilerplate_threshold'') | int(0)
/ 12 ) }}'
- service: light.turn_on
data:
rgb_color:
- 255
- 0
- 0
brightness_pct: 100
transition: 5
flash: long
target:
entity_id: light.yerp_boilerplate_lights
- delay:
seconds: '{{ ( states(''input_number.yerp_boilerplate_threshold'') | int(0)
/ 12 ) }}'
- if:
- condition: trigger
id: Spotting Ends
then:
- service: light.turn_on
data:
brightness_pct: 100
transition: 5
flash: short
target:
entity_id: light.yerp_boilerplate_lights
- if:
- condition: trigger
id: Duration Limit Ends
then:
- service: media_player.play_media
target:
entity_id: media_player.vlc_telnet
data:
media_content_id: media-source://media_source/local/deskbell.mp3
media_content_type: audio/mpeg
metadata:
title: deskbell.mp3
thumbnail:
media_class: music
children_media_class:
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
- if:
- condition: trigger
id: Elevated Begins
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_failsafe_countdown
- if:
- condition: trigger
id: Elevated Ends
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_failsafe
- service: input_select.select_option
data:
option: seekinghelp
target:
entity_id: input_select.yerp_boilerplate_session_status
mode: restart
- id: '1672023939822'
alias: YERP [Boilerplate] Visitor Button Presses
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 066a95fd8c0951aa26e267cf98abcb53
type: action
subtype: single
discovery_id: 0x00158d000282cf6d action_single
alias: Bypass Button - Single
id: Bypass Button - Single
- platform: device
domain: mqtt
device_id: 91c2bf4ec4ca6109eacac1a6418bea13
type: action
subtype: single
discovery_id: 0x00124b0022e96283 action_single
id: Activity Button - Single
alias: Activity Button - Single
- platform: device
domain: mqtt
device_id: 066a95fd8c0951aa26e267cf98abcb53
type: action
subtype: hold
discovery_id: 0x00158d000282cf6d action_hold
id: Bypass Button - Hold
alias: Bypass Button - Hold
- platform: device
domain: mqtt
device_id: 91c2bf4ec4ca6109eacac1a6418bea13
type: action
subtype: double
discovery_id: 0x00124b0022e96283 action_double
id: Activity Button - Double
alias: Activity Button - Double
condition:
- condition: or
conditions:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: warmup
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: standby
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: spotting
action:
- if:
- condition: or
conditions:
- condition: trigger
id: Bypass Button - Single
- condition: trigger
id: Bypass Button - Hold
alias: Bypass Button Single or Hold
then:
- service: input_boolean.toggle
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_spotting_bypass
- service: input_select.select_option
data:
option: userbypass
target:
entity_id: input_select.yerp_boilerplate_session_status
- service: logbook.log
data:
name: Visitor Button Press
message: Bypass button pressed
- service: light.turn_on
data:
color_name: purple
brightness_pct: 100
target:
entity_id: light.yerp_boilerplate_lights
- if:
- condition: or
conditions:
- condition: trigger
id: Activity Button - Single
- condition: trigger
id: Activity Button - Double
alias: Activity Button Single or Hold
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_active
- delay:
seconds: 5
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_active
- service: logbook.log
data:
name: Visitor Button Press
message: Bypass button pressed
- service: light.turn_on
data:
color_name: pink
target:
entity_id: light.yerp_boilerplate_lights
mode: restart
- id: '1672023987730'
alias: YERP [Boilerplate] Spotting Flow
description: ''
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_threshold_countdown
alias: Threshold Expires
id: Threshold Expires
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_warmup
alias: Warmup Expires
id: Warmup Expires
- platform: state
entity_id:
- input_boolean.yerp_boilerplate_area_enabled
alias: Area Enabled/Disabled
id: Area Enabled/Disabled
- platform: state
entity_id:
- input_select.yerp_boilerplate_spotting_status
alias: Spotting Status Changes
id: Spotting Status Changes
- platform: state
entity_id:
- input_boolean.yerp_boilerplate_this_session_spotting
id: This Session Spotting Changes
alias: This Session Spotting Changes
- platform: state
entity_id:
- input_boolean.yerp_boilerplate_gate_status
id: Gate Status Changes
alias: Gate Status Changes
- platform: state
entity_id:
- input_boolean.yerp_boilerplate_session_active
alias: Activity Entity State Changes
id: Activity Entity State Changes
- platform: state
entity_id:
- input_boolean.yerp_boilerplate_session_completed
alias: Session Completed
id: Session Completed
to: 'on'
- platform: homeassistant
event: start
id: HA Starts
- platform: state
entity_id:
- input_boolean.yerp_boilerplate_spotting_bypass
to: 'on'
alias: Spotting Bypass
- platform: state
entity_id:
- input_select.yerp_boilerplate_session_status
id: Elevated
to: elevated
condition: []
action:
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_area_enabled
state: 'on'
then:
- if:
- condition: or
conditions:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: offline
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: warmup
then:
- service: input_select.select_option
data:
option: online
target:
entity_id: input_select.yerp_boilerplate_area_status
- service: input_select.select_option
data:
option: warmup
target:
entity_id: input_select.yerp_boilerplate_session_status
- service: mqtt.publish
data:
payload: online
topic: homeassistant/alarm/yerp/boilerplate_session/availability
retain: true
- service: mqtt.publish
data:
topic: homeassistant/alarm/yerp/boilerplate_session/set
payload: arming
retain: true
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'on'
alias: Gated Status is ready
- condition: or
conditions:
- condition: trigger
id: Area Enabled/Disabled
- condition: trigger
id: Gate Status Changes
then:
- service: timer.start
data:
duration: '{{ states(''input_number.yerp_boilerplate_warmup'') }}'
target:
entity_id: timer.yerp_boilerplate_warmup
else: []
alias: If Session is Offline or Warmup
- if:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: spotting
then:
- if:
- condition: trigger
id: Threshold Expires
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_failsafe_countdown
- service: input_select.select_option
data:
option: elevated
target:
entity_id:
- input_select.yerp_boilerplate_session_status
alias: If threshold expires, mark session as elevated
- if:
- condition: trigger
id: Activity Entity State Changes
then:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.yerp_boilerplate_session_active
state: 'on'
alias: If activity turned on
sequence:
- service: timer.cancel
target:
entity_id: timer.yerp_boilerplate_threshold_countdown
data: {}
- service: input_text.set_value
data:
value: '0'
target:
entity_id: input_text.yerp_boilerplate_this_session_this_idle_duration_seconds
- conditions:
- condition: state
entity_id: input_boolean.yerp_boilerplate_session_active
state: 'off'
alias: If activity turned off
sequence:
- service: timer.start
data:
duration: '{{ states(''input_number.yerp_boilerplate_threshold'')
}}'
target:
entity_id: timer.yerp_boilerplate_threshold_countdown
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_this_session_spotting
state: 'on'
then:
- service: input_text.set_value
data:
value: '{{ now().timestamp() | round }}'
target:
entity_id: input_text.yerp_boilerplate_this_session_idle_start_timestamp
alias: Pick Activity on or off
alias: If Activity Boolean changes
- if:
- condition: trigger
id: Gate Status Changes
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'off'
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_completed
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_this_session_spotting
- service: input_select.select_option
data:
option: userexit
target:
entity_id: input_select.yerp_boilerplate_session_status
alias: If open/close triggers, set session to userexit
alias: If Session is Spotting
- if:
- condition: trigger
id: Warmup Expires
then:
- if:
- condition: state
entity_id: input_select.yerp_boilerplate_activity_status
state: active
then:
- wait_for_trigger:
- platform: state
entity_id:
- input_select.yerp_boilerplate_activity_status
to: idle
alias: Wait until idle
else: []
alias: Check to see if activity status is on
- service: input_select.select_option
data:
option: standby
target:
entity_id: input_select.yerp_boilerplate_session_status
alias: If Warmup Timer Expires, Advance
- if:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: warmup
alias: If Warmup
then:
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_adjusted
state: 'on'
then:
- service: timer.start
data:
duration: '{{ states(''input_number.yerp_boilerplate_warmup'') | int(0)
}}'
target:
entity_id: timer.yerp_boilerplate_warmup
alias: If Session is Warmup
- if:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: standby
then:
- if:
- condition: trigger
id: Activity Entity State Changes
then:
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_session_active
state: 'on'
then:
- service: input_select.select_option
data:
option: spotting
target:
entity_id: input_select.yerp_boilerplate_session_status
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_this_session_spotting
- service: input_text.set_value
target:
entity_id: input_text.yerp_boilerplate_this_session_activation_timestamp
data:
value: '{{ now().timestamp() | round }}'
- service: input_text.set_value
target:
entity_id: input_text.yerp_boilerplate_this_session_duration_seconds
data:
value: '0'
- service: script.yerp_boilerplate_update_sensors_every_second_while_spotting
data: {}
- if:
- condition: trigger
id: Gate Status Changes
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'off'
then:
- service: input_select.select_option
data:
option: warmup
target:
entity_id: input_select.yerp_boilerplate_session_status
alias: If Session is Standby
- if:
- condition: trigger
id: Gate Status Changes
then:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'on'
alias: If open/closed status is on, go to warmup
sequence:
- service: input_select.select_option
target:
entity_id: input_select.yerp_boilerplate_session_status
data:
option: warmup
- service: timer.start
data:
duration: '{{ states(''input_number.yerp_boilerplate_warmup'') }}'
target:
entity_id: timer.yerp_boilerplate_warmup
- conditions:
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'off'
alias: If open/closed status is off
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: spotting
alias: If Spotting
sequence:
- service: timer.cancel
target:
entity_id: timer.yerp_boilerplate_warmup
data: {}
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_completed
alias: Mark Session as Completed
alias: If Gate status changes
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_spotting_bypass
state: 'on'
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: userbypass
then:
- if:
- condition: state
entity_id: timer.yerp_boilerplate_threshold_countdown
state: active
then:
- service: timer.cancel
data: {}
target:
entity_id: timer.yerp_boilerplate_threshold_countdown
alias: If Visitor Activates Bypass
alias: Area is On and Completed is Off
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_area_enabled
state: 'off'
then:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_spotting_bypass
- service: input_select.select_option
target:
entity_id: input_select.yerp_boilerplate_session_status
data:
option: offline
- service: input_boolean.turn_off
target:
entity_id: input_boolean.yerp_boilerplate_this_session_spotting
data: {}
- service: input_select.select_option
data:
option: offline
target:
entity_id: input_select.yerp_boilerplate_area_status
- service: timer.cancel
data: {}
target:
entity_id:
- timer.yerp_boilerplate_warmup
- timer.yerp_boilerplate_threshold_countdown
- timer.yerp_boilerplate_session_duration_limit
- service: input_select.select_option
data:
option: offline
target:
entity_id: input_select.yerp_boilerplate_reason_for_deactivation
- service: light.turn_off
data: {}
target:
entity_id: light.yerp_boilerplate_lights
- service: mqtt.publish
data:
payload: offline
topic: homeassistant/alarm/yerp/boilerplate_session/availability
retain: true
alias: Area is Off
- if:
- condition: trigger
id: Session Completed
then:
- service: timer.cancel
data: {}
target:
entity_id:
- timer.yerp_boilerplate_threshold_countdown
- timer.yerp_boilerplate_warmup
alias: Cancel out the timers
- service: input_text.set_value
data:
value: '{{ states(''input_text.yerp_boilerplate_this_session_activation_timestamp'')
| int(0) | timestamp_custom(''%Y-%m-%dT%H:%M:%S%z'') }}'
target:
entity_id: input_text.yerp_boilerplate_last_session_activation_datetime
alias: Set Last Session's activation time
- service: input_text.set_value
data:
value: '{{ now().timestamp() | int(0) | timestamp_custom(''%Y-%m-%dT%H:%M:%S%z'')
}}'
target:
entity_id: input_text.yerp_boilerplate_last_spotting_deactivation_datetime
alias: Set Last Session's completed time
- service: input_text.set_value
data:
value: '{{ states(''input_text.yerp_boilerplate_this_session_max_idle_duration_seconds'')
}}'
target:
entity_id: input_text.yerp_boilerplate_last_session_max_idle_duration_seconds
alias: Set Last Session's Max Idle
- service: input_text.set_value
data:
value: '{{ states(''input_text.yerp_boilerplate_this_session_duration_seconds'')
}}'
target:
entity_id: input_text.yerp_boilerplate_last_session_duration_seconds
alias: Set Last Session's Duration
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_this_session_spotting
- service: input_select.select_option
data:
option: '{{ states(''input_select.yerp_boilerplate_session_status'') }}'
target:
entity_id: input_select.yerp_boilerplate_reason_for_deactivation
- service: input_text.set_value
data:
value: Session started in {{states('input_text.yerp_boilerplate_friendly_room_name')}}
at {{states('input_text.yerp_boilerplate_last_session_activation_datetime')}}
ended, because {{states('input_select.yerp_boilerplate_reason_for_deactivation')}}.
Max idle was {{states('input_text.yerp_boilerplate_last_session_max_idle_duration_seconds')}}
seconds.
target:
entity_id: input_text.yerp_session_log
- service: rest_command.update_nocodb_sessions
continue_on_error: true
data:
sessionstart: '{{ states(''input_text.yerp_boilerplate_last_session_activation_datetime'')
}}'
sessionend: '{{ states(''input_text.yerp_boilerplate_last_spotting_deactivation_datetime'')
}}'
sessionlength: '{{ states(''input_text.yerp_boilerplate_last_session_duration_seconds'')
}}'
longestgap: '{{ states(''input_text.yerp_boilerplate_last_session_max_idle_duration_seconds'')
}}'
endtrigger: '{{ states(''input_select.yerp_reason_for_deactivation'') }}'
suppliesused: ''
calledems: ''
area: boilerplate
alias: Send Report to DB
enabled: false
- service: script.toggle
data: {}
target:
entity_id: script.yerp_boilerplate_reset_session_automatic
enabled: true
alias: Session Completed
- if:
- condition: trigger
id: Gate Status Changes
then:
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'off'
alias: If Status is Off
then:
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_this_session_spotting
state: 'on'
then:
- service: timer.cancel
data: {}
target:
entity_id:
- timer.yerp_boilerplate_threshold_countdown
- timer.yerp_boilerplate_warmup
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_completed
- if:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: warmup
then:
- service: timer.cancel
data: {}
target:
entity_id: timer.yerp_boilerplate_warmup
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_completed
- service: light.turn_off
data: {}
target:
entity_id: light.yerp_boilerplate_lights
- if:
- condition: state
entity_id: input_boolean.yerp_boilerplate_gate_status
state: 'on'
alias: If Status is On
then:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.yerp_boilerplate_session_completed
alias: Gate Status Changes
- if:
- condition: trigger
id: HA Starts
then:
- service: input_boolean.reload
data: {}
mode: parallel
max: 20
- id: '1672024005449'
alias: YERP! [Boilerplate] Hardware Configurator
description: ''
use_blueprint:
path: YERP/area-configurator.yaml
input:
activity_state: binary_sensor.yerp_boilerplate_zy_m100_presence
activity_boolean: input_boolean.yerp_boilerplate_session_active
gate_state: binary_sensor.yerp_boilerplate_door
gate_boolean: input_boolean.yerp_boilerplate_gate_status
- id: '1672024077508'
alias: YERP [Boilerplate] Session Duration Limit Flow
description: ''
trigger:
- platform: state
entity_id:
- input_select.yerp_boilerplate_session_status
from: standby
to: spotting
id: Standby to Spotting
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.yerp_boilerplate_session_duration_limit
alias: Timer Finishes
id: Timer Finishes
- platform: state
entity_id:
- input_select.yerp_boilerplate_session_status
id: Session Status Change
enabled: false
condition: []
action:
- if:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: spotting
enabled: false
- condition: trigger
id: Standby to Spotting
then:
- service: timer.start
data:
entity_id: timer.yerp_boilerplate_session_duration_limit
duration: '{{ states(''input_number.yerp_boilerplate_session_duration_limit'')
| int(0) }}'
alias: If Spotting, Start the Timer
- if:
- condition: trigger
id: Session Status Change
- condition: not
conditions:
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: spotting
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: adminbypass
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: userbypass
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: elevated
- condition: state
entity_id: input_select.yerp_boilerplate_session_status
state: seekinghelp
- condition: state
entity_id: timer.yerp_boilerplate_session_duration_limit
state: active
then:
- service: timer.cancel
data:
entity_id: timer.yerp_boilerplate_session_duration_limit
alias: If Anything Else (other than bypass) and the Timer is On, Cancel the Timer
mode: restart
- id: '1672024105630'
alias: Set theme on Home Assistant startup
description: ''
trigger:
- event: start
platform: homeassistant
action: