-
Notifications
You must be signed in to change notification settings - Fork 0
/
home_assistant_watchwinder_package.yaml
819 lines (809 loc) · 24.6 KB
/
home_assistant_watchwinder_package.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
group:
grp_watchwinder_power:
name: Watch Winder Power
entities:
- switch.watchwinder_1
- switch.watchwinder_2
- switch.watchwinder_3
- switch.watchwinder_4
- switch.watchwinder_5
- switch.watchwinder_6
grp_watchwinder_display:
name: Watch Winder OLEDs
entities:
- switch.watchwinder_1_display
- switch.watchwinder_2_display
- switch.watchwinder_3_display
- switch.watchwinder_4_display
- switch.watchwinder_5_display
- switch.watchwinder_6_display
grp_watchwinder_keep_it_wound:
name: Mantieni Carico
entities:
- input_boolean.keep_it_wound_1
- input_boolean.keep_it_wound_2
- input_boolean.keep_it_wound_3
- input_boolean.keep_it_wound_4
- input_boolean.keep_it_wound_5
- input_boolean.keep_it_wound_6
sensor:
- platform: mqtt
state_topic: 'stat/watchwinder_1/INFO'
name: 'Last Seen Watchwinder 1'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/watchwinder_2/INFO'
name: 'Last Seen Watchwinder 2'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/watchwinder_3/INFO'
name: 'Last Seen Watchwinder 3'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/watchwinder_4/INFO'
name: 'Last Seen Watchwinder 4'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/watchwinder_5/INFO'
name: 'Last Seen Watchwinder 5'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/watchwinder_6/INFO'
name: 'Last Seen Watchwinder 6'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/watchwinder_1/INFO'
name: 'Watchwinder 1 version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/watchwinder_2/INFO'
name: 'Watchwinder 2 version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/watchwinder_3/INFO'
name: 'Watchwinder 3 version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/watchwinder_4/INFO'
name: 'Watchwinder 4 version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/watchwinder_5/INFO'
name: 'Watchwinder 5 version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/watchwinder_6/INFO'
name: 'Watchwinder 6 version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/watchwinder_1/INFO'
name: 'Rotazioni effettuate 1'
value_template: '{{ value_json.rotation_done }}'
- platform: mqtt
state_topic: 'stat/watchwinder_2/INFO'
name: 'Rotazioni effettuate 2'
value_template: '{{ value_json.rotation_done }}'
- platform: mqtt
state_topic: 'stat/watchwinder_3/INFO'
name: 'Rotazioni effettuate 3'
value_template: '{{ value_json.rotation_done }}'
- platform: mqtt
state_topic: 'stat/watchwinder_4/INFO'
name: 'Rotazioni effettuate 4'
value_template: '{{ value_json.rotation_done }}'
- platform: mqtt
state_topic: 'stat/watchwinder_5/INFO'
name: 'Rotazioni effettuate 5'
value_template: '{{ value_json.rotation_done }}'
- platform: mqtt
state_topic: 'stat/watchwinder_6/INFO'
name: 'Rotazioni effettuate 6'
value_template: '{{ value_json.rotation_done }}'
input_boolean:
keep_it_wound_1:
name: Mantieni carico 1
initial: off
keep_it_wound_2:
name: Mantieni carico 2
initial: off
keep_it_wound_3:
name: Mantieni carico 3
initial: off
keep_it_wound_4:
name: Mantieni carico 4
initial: off
keep_it_wound_5:
name: Mantieni carico 5
initial: off
keep_it_wound_6:
name: Mantieni carico 6
initial: off
input_select:
marcia_watchwinder:
name: Marcia
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
marcia1:
name: Marcia 1
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
marcia2:
name: Marcia 2
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
marcia3:
name: Marcia 3
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
marcia4:
name: Marcia 4
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
marcia5:
name: Marcia 5
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
marcia6:
name: Marcia 6
options:
- Orario
- Antiorario
- Misto
initial: Misto
icon: mdi:autorenew
input_number:
roration_speed_watchwinder:
name: Durata rotazione
initial: 900
min: 900
max: 2500
step: 100
rotation_number_watchwinder:
name: Numero rotazioni giornaliere
initial: 700
min: 50
max: 900
step: 50
roration_speed_1:
name: Durata rotazione 1
initial: 900
min: 900
max: 2500
step: 100
rotation_number_1:
name: Numero rotazioni giornaliere 1
initial: 800
min: 50
max: 900
step: 50
roration_speed_2:
name: Durata rotazione 2
initial: 900
min: 900
max: 2500
step: 100
rotation_number_2:
name: Numero rotazioni giornaliere 2
initial: 700
min: 50
max: 900
step: 50
roration_speed_3:
name: Durata rotazione 3
initial: 900
min: 900
max: 2500
step: 100
rotation_number_3:
name: Numero rotazioni giornaliere 3
initial: 700
min: 50
max: 900
step: 50
roration_speed_4:
name: Durata rotazione 4
initial: 900
min: 900
max: 2500
step: 100
rotation_number_4:
name: Numero rotazioni giornaliere 4
initial: 900
min: 50
max: 900
step: 50
roration_speed_5:
name: Durata rotazione 5
initial: 900
min: 900
max: 2500
step: 100
rotation_number_5:
name: Numero rotazioni giornaliere 5
initial: 700
min: 50
max: 900
step: 50
roration_speed_6:
name: Durata rotazione 6
initial: 900
min: 900
max: 2500
step: 100
rotation_number_6:
name: Numero rotazioni giornaliere 6
initial: 700
min: 50
max: 900
step: 50
watchwinder_display_brightness:
name: Display Brightness
initial: 160
min: 10
max: 255
step: 5
switch:
- platform: mqtt
name: "Watchwinder 1"
command_topic: "cmnd/watchwinder_1/POWER"
state_topic: "stat/watchwinder_1/POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 2"
command_topic: "cmnd/watchwinder_2/POWER"
state_topic: "stat/watchwinder_2/POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 3"
command_topic: "cmnd/watchwinder_3/POWER"
state_topic: "stat/watchwinder_3/POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 4"
command_topic: "cmnd/watchwinder_4/POWER"
state_topic: "stat/watchwinder_4/POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 5"
command_topic: "cmnd/watchwinder_5/POWER"
state_topic: "stat/watchwinder_5/POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 6"
command_topic: "cmnd/watchwinder_6/POWER"
state_topic: "stat/watchwinder_6/POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 1 display"
command_topic: "cmnd/watchwinder_1/DISPLAY_POWER"
state_topic: "stat/watchwinder_1/DISPLAY_POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 2 display"
command_topic: "cmnd/watchwinder_2/DISPLAY_POWER"
state_topic: "stat/watchwinder_2/DISPLAY_POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 3 display"
command_topic: "cmnd/watchwinder_3/DISPLAY_POWER"
state_topic: "stat/watchwinder_3/DISPLAY_POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 4 display"
command_topic: "cmnd/watchwinder_4/DISPLAY_POWER"
state_topic: "stat/watchwinder_4/DISPLAY_POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 5 display"
command_topic: "cmnd/watchwinder_5/DISPLAY_POWER"
state_topic: "stat/watchwinder_5/DISPLAY_POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Watchwinder 6 display"
command_topic: "cmnd/watchwinder_6/DISPLAY_POWER"
state_topic: "stat/watchwinder_6/DISPLAY_POWER"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "rebootwatchwinder"
command_topic: "cmnd/watchwinder/reboot"
state_topic: "stat/watchwinder/reboot"
qos: 1
retain: false
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "showlastpage"
command_topic: "cmnd/watchwinder/OLEDINFO"
qos: 0
retain: false
payload_on: "ON"
payload_off: "OFF"
automation:
- id: '1566387252088'
alias: Sync Watch Winder
trigger:
- entity_id: input_number.roration_speed_watchwinder
platform: state
- entity_id: input_number.rotation_number_watchwinder
platform: state
- entity_id: input_select.marcia_watchwinder
platform: state
- entity_id: switch.watchwinder
platform: state
condition:
action:
- service: input_number.set_value
data_template:
entity_id: input_number.rotation_number_1
value: "{{ states.input_number.rotation_number_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.rotation_number_2
value: "{{ states.input_number.rotation_number_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.rotation_number_3
value: "{{ states.input_number.rotation_number_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.rotation_number_4
value: "{{ states.input_number.rotation_number_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.rotation_number_5
value: "{{ states.input_number.rotation_number_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.rotation_number_6
value: "{{ states.input_number.rotation_number_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.roration_speed_1
value: "{{ states.input_number.roration_speed_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.roration_speed_2
value: "{{ states.input_number.roration_speed_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.roration_speed_3
value: "{{ states.input_number.roration_speed_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.roration_speed_4
value: "{{ states.input_number.roration_speed_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.roration_speed_5
value: "{{ states.input_number.roration_speed_watchwinder.state }}"
- service: input_number.set_value
data_template:
entity_id: input_number.roration_speed_6
value: "{{ states.input_number.roration_speed_watchwinder.state }}"
- service: input_select.select_option
data_template:
entity_id: input_select.marcia1
option: "{{ states.input_select.marcia_watchwinder.state }}"
- service: input_select.select_option
data_template:
entity_id: input_select.marcia2
option: "{{ states.input_select.marcia_watchwinder.state }}"
- service: input_select.select_option
data_template:
entity_id: input_select.marcia3
option: "{{ states.input_select.marcia_watchwinder.state }}"
- service: input_select.select_option
data_template:
entity_id: input_select.marcia4
option: "{{ states.input_select.marcia_watchwinder.state }}"
- service: input_select.select_option
data_template:
entity_id: input_select.marcia5
option: "{{ states.input_select.marcia_watchwinder.state }}"
- service: input_select.select_option
data_template:
entity_id: input_select.marcia6
option: "{{ states.input_select.marcia_watchwinder.state }}"
- id: '1548796542057'
alias: watchwinder_settings_1
trigger:
- entity_id: input_select.marcia1
platform: state
- entity_id: input_number.roration_speed_1
platform: state
- entity_id: input_number.rotation_number_1
platform: state
- entity_id: input_boolean.keep_it_wound_1
platform: state
- platform: time_pattern
seconds: '/300'
condition:
action:
- service: mqtt.publish
data_template:
topic: "cmnd/watchwinder_1/SETTINGS"
retain: "false"
payload: '{"orientation":"{{states.input_select.marcia1.state}}","keep_it_wound":"{{states.input_boolean.keep_it_wound_1.state}}","rotation_speed":"{{states.input_number.roration_speed_1.state}}","rotation_number":"{{states.input_number.rotation_number_1.state}}","brightness":"{{states.input_number.watchwinder_display_brightness.state}}"}'
- id: '1548796542060'
alias: watchwinder_settings_2
trigger:
- entity_id: input_select.marcia2
platform: state
- entity_id: input_number.roration_speed_2
platform: state
- entity_id: input_number.rotation_number_2
platform: state
- entity_id: input_boolean.keep_it_wound_2
platform: state
- platform: time_pattern
seconds: '/300'
condition:
action:
- service: mqtt.publish
data_template:
topic: "cmnd/watchwinder_2/SETTINGS"
retain: "false"
payload: '{"orientation":"{{states.input_select.marcia2.state}}","keep_it_wound":"{{states.input_boolean.keep_it_wound_2.state}}","rotation_speed":"{{states.input_number.roration_speed_2.state}}","rotation_number":"{{states.input_number.rotation_number_2.state}}","brightness":"{{states.input_number.watchwinder_display_brightness.state}}"}'
- id: '1548796542061'
alias: watchwinder_settings_3
trigger:
- entity_id: input_select.marcia3
platform: state
- entity_id: input_number.roration_speed_3
platform: state
- entity_id: input_number.rotation_number_3
platform: state
- entity_id: input_boolean.keep_it_wound_3
platform: state
- platform: time_pattern
seconds: '/300'
condition:
action:
- service: mqtt.publish
data_template:
topic: "cmnd/watchwinder_3/SETTINGS"
retain: "false"
payload: '{"orientation":"{{states.input_select.marcia3.state}}","keep_it_wound":"{{states.input_boolean.keep_it_wound_3.state}}","rotation_speed":"{{states.input_number.roration_speed_3.state}}","rotation_number":"{{states.input_number.rotation_number_3.state}}","brightness":"{{states.input_number.watchwinder_display_brightness.state}}"}'
- id: '1548796542062'
alias: watchwinder_settings_4
trigger:
- entity_id: input_select.marcia4
platform: state
- entity_id: input_number.roration_speed_4
platform: state
- entity_id: input_number.rotation_number_4
platform: state
- entity_id: input_boolean.keep_it_wound_4
platform: state
- platform: time_pattern
seconds: '/300'
condition:
action:
- service: mqtt.publish
data_template:
topic: "cmnd/watchwinder_4/SETTINGS"
retain: "false"
payload: '{"orientation":"{{states.input_select.marcia4.state}}","keep_it_wound":"{{states.input_boolean.keep_it_wound_4.state}}","rotation_speed":"{{states.input_number.roration_speed_4.state}}","rotation_number":"{{states.input_number.rotation_number_4.state}}","brightness":"{{states.input_number.watchwinder_display_brightness.state}}"}'
- id: '1548796542063'
alias: watchwinder_settings_5
trigger:
- entity_id: input_select.marcia5
platform: state
- entity_id: input_number.roration_speed_5
platform: state
- entity_id: input_number.rotation_number_5
platform: state
- entity_id: input_boolean.keep_it_wound_5
platform: state
- platform: time_pattern
seconds: '/300'
condition:
action:
- service: mqtt.publish
data_template:
topic: "cmnd/watchwinder_5/SETTINGS"
retain: "false"
payload: '{"orientation":"{{states.input_select.marcia5.state}}","keep_it_wound":"{{states.input_boolean.keep_it_wound_5.state}}","rotation_speed":"{{states.input_number.roration_speed_5.state}}","rotation_number":"{{states.input_number.rotation_number_5.state}}","brightness":"{{states.input_number.watchwinder_display_brightness.state}}"}'
- id: '1548796542064'
alias: watchwinder_settings_6
trigger:
- entity_id: input_select.marcia6
platform: state
- entity_id: input_number.roration_speed_6
platform: state
- entity_id: input_number.rotation_number_6
platform: state
- entity_id: input_boolean.keep_it_wound_6
platform: state
- platform: time_pattern
seconds: '/300'
condition:
action:
- service: mqtt.publish
data_template:
topic: "cmnd/watchwinder_6/SETTINGS"
retain: "false"
payload: '{"orientation":"{{states.input_select.marcia6.state}}","keep_it_wound":"{{states.input_boolean.keep_it_wound_6.state}}","rotation_speed":"{{states.input_number.roration_speed_6.state}}","rotation_number":"{{states.input_number.rotation_number_6.state}}","brightness":"{{states.input_number.watchwinder_display_brightness.state}}"}'
- id: '1566422132712'
alias: Mantieni Carico 1
trigger:
- at: '19:00:00'
platform: time
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.keep_it_wound_1
state: 'on'
- condition: template
value_template: '{{ (now().strftime("%d") | int) == 1 }}'
action:
- data:
entity_id: switch.watchwinder_1
service: switch.turn_on
- id: '1566422132713'
alias: Mantieni Carico 2
trigger:
- at: '19:00:00'
platform: time
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.keep_it_wound_2
state: 'on'
- condition: template
value_template: '{{ (now().strftime("%d") | int) == 2 }}'
action:
- data:
entity_id: switch.watchwinder_2
service: switch.turn_on
- id: '1566422132714'
alias: Mantieni Carico 3
trigger:
- at: '19:00:00'
platform: time
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.keep_it_wound_3
state: 'on'
- condition: template
value_template: '{{ (now().strftime("%d") | int) == 3 }}'
action:
- data:
entity_id: switch.watchwinder_3
service: switch.turn_on
- id: '1566422132715'
alias: Mantieni Carico 4
trigger:
- at: '19:00:00'
platform: time
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.keep_it_wound_4
state: 'on'
- condition: template
value_template: '{{ (now().strftime("%d") | int) == 4 }}'
action:
- data:
entity_id: switch.watchwinder_4
service: switch.turn_on
- id: '1566422132716'
alias: Mantieni Carico 5
trigger:
- at: '19:00:00'
platform: time
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.keep_it_wound_5
state: 'on'
- condition: template
value_template: '{{ (now().strftime("%d") | int) == 5 }}'
action:
- data:
entity_id: switch.watchwinder_5
service: switch.turn_on
- id: '1566422132717'
alias: Mantieni Carico 6
trigger:
- at: '19:00:00'
platform: time
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.keep_it_wound_6
state: 'on'
- condition: template
value_template: '{{ (now().strftime("%d") | int) == 6 }}'
action:
- data:
entity_id: switch.watchwinder_6
service: switch.turn_on
- id: '1598649874581'
alias: Watchwinder Alive 1
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_watchwinder_1')) + 60)) }}"
action:
- data:
message: "Watchwinder 1 ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1598649874582'
alias: Watchwinder Alive 2
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_watchwinder_2')) + 60)) }}"
action:
- data:
message: "Watchwinder 2 ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1598649874583'
alias: Watchwinder Alive 3
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_watchwinder_3')) + 60)) }}"
action:
- data:
message: "Watchwinder 3 ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1598649874584'
alias: Watchwinder Alive 4
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_watchwinder_4')) + 60)) }}"
action:
- data:
message: "Watchwinder 4 ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1598649874585'
alias: Watchwinder Alive 5
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_watchwinder_5')) + 60)) }}"
action:
- data:
message: "Watchwinder 5 ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1598649874586'
alias: Watchwinder Alive 6
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_watchwinder_6')) + 60)) }}"
action:
- data:
message: "Watchwinder 6 ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '15651419131870'
alias: WatchwinderMotionOn
trigger:
- entity_id: binary_sensor.sr501pir
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: group.grp_watchwinder_display
state: 'off'
- condition: state
entity_id: group.grp_watchwinder_power
state: 'on'
action:
- data:
entity_id: group.grp_watchwinder_display
service: switch.turn_on
- id: '15651275318971'
alias: WatchwinderMotionOff
trigger:
- entity_id: binary_sensor.sr501pir
for:
minutes: 3
platform: state
to: 'off'
condition:
- condition: state
entity_id: group.grp_watchwinder_display
state: 'on'
- condition: state
entity_id: switch.wake_on_lan
state: 'off'
action:
- data:
entity_id: group.grp_watchwinder_display
service: switch.turn_off