forked from smarthome53/homeassistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhumidifier.yaml
294 lines (280 loc) · 11 KB
/
humidifier.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
humidifier:
fan:
- platform: xiaomi_miio_airpurifier
host: 192.168.1.238
token: !secret smartmi_hum_token
name: Humidifier
sensor:
- platform: template
sensors:
humidifier_temperature:
friendly_name: Humidifier temperature
value_template: '{{ states.fan.humidifier.attributes.temperature }}'
unit_of_measurement: '°C'
icon_template: mdi:thermometer
humidifier_humidity:
friendly_name: Humidifier humidity
value_template: '{{ states.fan.humidifier.attributes.humidity }}'
unit_of_measurement: '%'
icon_template: mdi:water-percent
humidifier_water_level:
friendly_name: Humidifier water level
value_template: '{{ states.fan.humidifier.attributes.water_level }}'
unit_of_measurement: '%'
icon_template: mdi:waves
switch:
- platform: template
switches:
xiaomi_humidifier_child_lock:
friendly_name: "Child lock"
value_template: "{{ is_state_attr('fan.humidifier', 'child_lock', True) }}"
turn_on:
service: xiaomi_miio_airpurifier.fan_set_child_lock_on
data:
entity_id: fan.humidifier
turn_off:
service: xiaomi_miio_airpurifier.fan_set_child_lock_off
data:
entity_id: fan.humidifier
icon_template: "mdi:lock-outline"
xiaomi_humidifier_buzzer:
friendly_name: "Buzzer"
value_template: "{{ is_state_attr('fan.humidifier', 'buzzer', True) }}"
turn_on:
service: xiaomi_miio_airpurifier.fan_set_buzzer_on
data:
entity_id: fan.humidifier
turn_off:
service: xiaomi_miio_airpurifier.fan_set_buzzer_off
data:
entity_id: fan.humidifier
icon_template: "mdi:volume-off"
xiaomi_humidifier_dry:
friendly_name: "Dry"
value_template: "{{ is_state_attr('fan.humidifier', 'dry', True) }}"
turn_on:
service: xiaomi_miio_airpurifier.fan_set_dry_on
data:
entity_id: fan.humidifier
turn_off:
service: xiaomi_miio_airpurifier.fan_set_dry_off
data:
entity_id: fan.humidifier
icon_template: "mdi:hair-dryer"
automation:
# Выключить увлажнитель
- alias: humidifier_turn_off
initial_state: true
trigger:
- platform: template # Влажность в комнате больше 60,влажность на кухне больше 50
value_template: "{{ (states('sensor.0x00158d000408d1a1_humidity')|float > 60) and (states('sensor.gasboiler_kitchen_hum')|float > 50) }}"
action:
- service: fan.turn_off
data:
entity_id: fan.humidifier
# Включить увлажнитель на максимальную скорость если влажность в комнате меньше 45
- alias: humidifier_turn_on_below_45
initial_state: true
trigger:
- platform: numeric_state # Влажность в комнате меньше 45
entity_id: sensor.0x00158d000408d1a1_humidity
below: 45
action:
- choose:
- conditions: # Если влажность меньше 50 и больше 45 днем
- condition: or
conditions:
- condition: and # По будням с 7:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: '07:00:00'
before: '22:30:00'
- condition: and # По выходным с 9:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: '09:00:00'
before: '22:30:00'
sequence: # Включить на 3 режим обдува
- service: fan.turn_on
data:
entity_id: fan.humidifier
- delay: '00:00:05'
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: High
- conditions: # Если влажность меньше 50 и больше 45 днем
- condition: or
conditions:
- condition: and # По будням с 7:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: '22:30:00'
before: '07:00:00'
- condition: and # По выходным с 9:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: '22:30:00'
before: '09:00:00'
sequence: # Включить на 1 режим обдува
- service: fan.turn_on
data:
entity_id: fan.humidifier
- delay: '00:00:05'
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: Low
# Включить увлажнитель на авто режиме, если влажность в комнате меньше 55 но больше 45
- alias: humidifier_turn_on_below_55_above_45
initial_state: true
trigger:
- platform: numeric_state # Влажность в комнате меньше 55 но больше 45
entity_id: sensor.0x00158d000408d1a1_humidity
below: 55
above: 45
action:
- choose:
- conditions: # Если влажность меньше 50 и больше 45 днем
- condition: or
conditions:
- condition: and # По будням с 7:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: '07:00:00'
before: '22:30:00'
- condition: and # По выходным с 9:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: '09:00:00'
before: '22:30:00'
sequence: # Включить на авто режим обдува
- service: fan.turn_on
data:
entity_id: fan.humidifier
- delay: '00:00:05'
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: Auto
- conditions: # Если влажность меньше 50 и больше 45 ночью
- condition: or
conditions:
- condition: and # По будням с 7:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: '22:30:00'
before: '07:00:00'
- condition: and # По выходным с 9:00 до 22:30
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: '22:30:00'
before: '09:00:00'
sequence: # Включить на 1 режим обдува
- service: fan.turn_on
data:
entity_id: fan.humidifier
- delay: '00:00:05'
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: Low
# Включить низкую скорость увлажнения если влажность в комнате больше 55
- alias: humidifier_turn_on_above_55
initial_state: true
trigger:
- platform: numeric_state # Влажность в комнате больше 55
entity_id: sensor.0x00158d000408d1a1_humidity
above: 55
action:
- service: fan.turn_on # Включить на 1 режим обдува
data:
entity_id: fan.humidifier
- delay: '00:00:05'
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: Low
# Ночной режим увлажнителя
- alias: humidifier_night_mode
initial_state: true
trigger:
- platform: time
at: '22:30:00'
- platform: time
at: '07:00:00'
- platform: time
at: '09:00:00'
condition:
- condition: state
entity_id: fan.humidifier
state: 'on'
action:
- choose:
- conditions: # В 22:30
- condition: time
after: '22:29:00'
before: '22:31:00'
sequence: # Включить на 1 скорость обдува
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: Low
- conditions:
- condition: or
conditions:
- condition: and # По будням в 7 утра
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: '06:59:00'
before: '07:01:00'
- condition: and # По выходным с в 9 утра
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: '08:59:00'
before: '09:01:00'
sequence: # Включить на авто скорость обдува
- service: fan.set_speed
data:
entity_id: fan.humidifier
speed: Auto
- alias: humidifier_low_water_level_notify
initial_state: true
trigger:
- platform: template
value_template: "{{ state_attr('fan.humidifier','water_level')|float < 10 }}"
action:
- service: notify.telegram_loony
data:
title: "Добавьте воды в увлажнитель"
message: "Воды в увлажнителе осталось {{ state_attr('fan.humidifier','water_level')|int }}% в {{ states('sensor.time') }}"