-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage_ventilation.yaml
More file actions
123 lines (112 loc) · 3.9 KB
/
Copy pathstorage_ventilation.yaml
File metadata and controls
123 lines (112 loc) · 3.9 KB
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
blueprint:
name: "GSW: Smart Ventilation Control"
description: >
## 🌬️ Absolute Humidity & Dew Point Controller
This automation manages ventilation by comparing the Absolute Humidity (g/m³)
between indoor and outdoor environments.
**Developer:** Iakovos Venieris
**Project:** [Greece Sky and Weather](https://www.youtube.com/@GreeceSkyandWeather)
**Requirements:** [Thermal Comfort Integration](https://github.com/dizzyit/thermal_comfort) (for Absolute Humidity & Dew Point sensors).
domain: automation
input:
bathroom_ah_sensor:
name: "Bathroom Absolute Humidity"
description: "Select the sensor that provides Absolute Humidity (g/m³) for the bathroom."
selector:
entity:
domain: sensor
indoor_ah_sensor:
name: "Indoor Absolute Humidity"
description: "Select the baseline Absolute Humidity sensor (e.g., from the Living Room)."
selector:
entity:
domain: sensor
outdoor_ah_sensor:
name: "Outdoor Absolute Humidity"
description: "Select the sensor that provides outdoor Absolute Humidity (g/m³)."
selector:
entity:
domain: sensor
bathroom_dew_point:
name: "Bathroom Dew Point"
description: "Select the Dew Point sensor for the bathroom."
selector:
entity:
domain: sensor
bathroom_temp:
name: "Bathroom Temperature"
description: "Select the temperature sensor for the bathroom."
selector:
entity:
domain: sensor
device_class: temperature
fan_switch:
name: "Ventilation Switch"
description: "Choose the fan or switch that controls the bathroom ventilation."
selector:
target:
entity:
domain:
- switch
- fan
alarm_panel:
name: "Security System (Optional)"
description: "If selected, the automation will only run when the alarm is disarmed."
default: []
selector:
entity:
domain: alarm_control_panel
variables:
b_ah: !input bathroom_ah_sensor
i_ah: !input indoor_ah_sensor
o_ah: !input outdoor_ah_sensor
b_dp: !input bathroom_dew_point
b_t: !input bathroom_temp
fan_target: !input fan_switch
alarm_entity: !input alarm_panel
trigger:
- platform: time_pattern
seconds: "/30"
condition:
- condition: and
conditions:
- condition: template
value_template: >
{{ alarm_entity == [] or is_state(alarm_entity, 'disarmed') }}
- condition: template
value_template: >
{% set entity_list = fan_target.entity_id if fan_target.entity_id is list else [fan_target.entity_id] %}
{{ is_state(entity_list[0], 'off') }}
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: "{{ states(b_ah)|float(0) > states(i_ah)|float(0) + 1 }}"
- condition: template
value_template: "{{ states(b_ah)|float(0) > states(o_ah)|float(0) + 1 }}"
- condition: template
value_template: "{{ states(b_ah)|float(0) >= 14.5 }}"
action:
- action: switch.turn_on
target: !input fan_switch
- delay:
minutes: >
{% set diff = states(b_ah)|float(0) - states(o_ah)|float(0) %}
{% if diff > 5 %} 60
{% elif diff > 3 %} 30
{% elif (states(b_dp)|float(0) > (states(b_t)|float(0) - 2)) %} 30
{% else %} 15
{% endif %}
- choose:
- conditions:
- condition: template
value_template: >
{{
(states(b_ah)|float(0) <= 14) and
((states(b_ah)|float(0) <= (states(i_ah)|float(0) + 1)) or
(states(b_ah)|float(0) <= (states(o_ah)|float(0) + 1)))
}}
sequence:
- action: switch.turn_off
target: !input fan_switch