-
Notifications
You must be signed in to change notification settings - Fork 0
/
fan_control_based_on_humidity_or_light.yaml
117 lines (111 loc) · 2.97 KB
/
fan_control_based_on_humidity_or_light.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
blueprint:
name: Fan Control (Light, Humidity)
description: Controls a fan based on a light or humidity
domain: automation
input:
control_mode:
name: Control Mode
description: An input select with control modes "Linked to a light", "Humidity" and "Disabled"
selector:
entity:
domain: input_select
control_light:
name: Light
description: The light that controls the fan. Only applicable with "Linked to light"
selector:
entity:
domain: light
control_humidity_sensor:
name: Humidity Sensor
description: Humidity sensor
selector:
entity:
domain: sensor
reference_humidity:
name: Reference Humidity
description: Humidity reference.
default: 60
control_fan:
name: Fan
description: The fan to control
selector:
entity:
domain: fan
trigger:
- platform: state
entity_id: !input control_light
id: trigger_light_off
to: on
- platform: numeric_state
entity_id: !input control_humidity_sensor
id: trigger_humidity_high
above: !input reference_humidity
- platform: state
entity_id: !input control_light
id: trigger_light_off
from: 'on'
to: unavailable
- platform: numeric_state
entity_id: !input control_humidity_sensor
id: trigger_humidity_normal
below: !input reference_humidity
condition:
- condition: not
conditions:
- condition: state
entity_id: !input control_mode
state: 'False'
action:
- choose:
- conditions:
- condition: trigger
id: trigger_light_on
- condition: state
entity_id: !input control_mode
state: Linked to light
sequence:
- service: fan.turn_on
target:
entity_id: !input control_fan
- conditions:
- condition: trigger
id: trigger_humidity_high
- condition: state
entity_id: !input control_mode
state: Humidity
sequence:
- service: fan.turn_on
target:
entity_id: !input control_fan
- conditions:
- condition: trigger
id: trigger_light_off
- condition: state
entity_id: !input control_mode
state: Linked to light
- condition: state
entity_id: !input control_fan
state: 'on'
sequence:
- service: fan.turn_off
target:
entity_id: !input control_fan
- conditions:
- condition: trigger
id: trigger_humidity_normal
- condition: state
entity_id: !input control_fan
state: Humidity
- condition: state
entity_id: !input control_fan
state: 'on'
sequence:
- service: fan.turn_off
target:
entity_id: !input control_fan
variables:
control_light: !input control_light
control_humidity_sensor: !input control_humidity_sensor
control_mode: !input control_mode
control_fan: !input control_fan
reference_humidity: !input reference_humidity