forked from smarthome53/homeassistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrivent.yaml
74 lines (69 loc) · 2.55 KB
/
drivent.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
drivent:
binary_sensor:
# Время проветривания по ночам
- platform: tod
name: night_air
after: '01:00'
before: '04:00'
# Время проветривания утром
- platform: tod
name: day_air
after: '07:00'
before: '08:00'
- platform: template
sensors:
air_time:
value_template: >-
{{ is_state('binary_sensor.night_air', 'on')
or is_state('binary_sensor.day_air', 'on')
and is_state('binary_sensor.workday_sensor', 'off') }}
automation:
- alias: "Drivent night airing"
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.air_time
condition:
- condition: template
value_template: "{{ state_attr('weather.gismeteo_hourly', 'temperature') | float > - 10 }}"
- condition: state
entity_id: group.trackdevice
state: 'home'
action:
- choose:
- conditions:
- condition: template # Началось время проветривания
value_template: "{{ trigger.to_state.state == 'on' and trigger.from_state.state == 'off' }}"
sequence:
- service: cover.set_cover_position
target:
entity_id: cover.drivent
data:
position: 10
- service: input_select.select_option
target:
entity_id: input_select.target_temp
data:
option: "Комната"
- service: climate.set_temperature
data:
entity_id: climate.gasboiler_esp32
temperature: "{{ state_attr('climate.gasboiler_esp32', 'temperature') + 1 }}"
- conditions:
- condition: template # Закончилось время проветривания
value_template: "{{ trigger.to_state.state == 'off' and trigger.from_state.state == 'on' }}"
sequence:
- service: cover.set_cover_position
target:
entity_id: cover.drivent
data:
position: 0
- service: input_select.select_option
target:
entity_id: input_select.target_temp
data:
option: Среднее значение
- service: climate.set_temperature
data:
entity_id: climate.gasboiler_esp32
temperature: "{{ state_attr('climate.gasboiler_esp32', 'temperature') - 1 }}"