-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoilet_automatization
128 lines (125 loc) · 3.49 KB
/
toilet_automatization
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
## Если сработал датчик движения или выключатель запускаем скрипт
alias: "Туалет: включаем свет"
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.200_33_invert
to: "on"
- platform: state
entity_id:
- switch.vykliuchatel_tualet
to: "on"
condition: []
action:
- service: script.1663501164042
data: {}
mode: single
##скрипт
## настроен на включение света на 100% яркости ламп с 6 утра до 22 вечера.
## 5% с 22 до 6 утра
## музыка включается с 7 утра до 12 и с 15 до 20:30
alias: "Туалет - включаем свет и музыку с проверкой по времени "
sequence:
- service: timer.cancel
data: {}
target:
entity_id: timer.tualet_taimer_4_minuty
- service: timer.start
data: {}
target:
entity_id: timer.tualet_taimer_4_minuty
- if:
- condition: time
after: "06:00:00"
before: "22:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
then:
- if:
- condition: device
type: is_off
device_id: 44e9700b2328265318945255b6b34895
entity_id: switch.vykliuchatel_tualet
domain: switch
then:
- service: switch.turn_on
data: {}
target:
entity_id: switch.vykliuchatel_tualet
- service: light.turn_on
data:
brightness_pct: 100
target:
entity_id: light.gruppa_tualet
else:
- service: light.turn_on
data:
brightness_pct: 5
target:
entity_id: light.gruppa_tualet
alias: c 6 до 22 яркость 100%, иначе 5%
- if:
- condition: device
type: is_off
device_id: 44e9700b2328265318945255b6b34895
entity_id: switch.vykliuchatel_tualet
domain: switch
then:
- type: turn_on
device_id: 44e9700b2328265318945255b6b34895
entity_id: switch.vykliuchatel_tualet
domain: switch
- if:
- condition: or
conditions:
- condition: time
after: "07:00:00"
before: "12:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
- condition: time
after: "15:00:00"
before: "20:30:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- sun
- sat
then:
- if:
- condition: not
conditions:
- condition: state
entity_id: media_player.volumio
state: playing
then:
- service: media_player.volume_set
data:
volume_level: 0.02
target:
entity_id: media_player.volumio
- service: media_player.play_media
data:
media_content_id: " {\"uri\": \"https://pub0202.101.ru:8443/stream/trust/mp3/128/24\", \"service\":\"webradio\"}"
media_content_type: channel
target:
entity_id: media_player.volumio
alias: Проверка по времени и включения музыки
mode: single
icon: mdi:lightbulb-group-outline