-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
168 lines (160 loc) · 4.86 KB
/
automations.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
# Turn on the sauna thermostat when the top button on the Hue dimmer switch is
# pressed. Also set the sauna temperature to 85 as its a nice default.
# Do NOT do anything when the thermostat was already on, to allow for changing
# the lights without messing with any custom set temperature.
- id: '1585843475212'
alias: Sauna thermostat on with dimmer
description: ''
trigger:
- event_data:
event: 1002
id: "hue_dimmer_switch_1"
event_type: hue_event
platform: event
condition:
- condition: state
entity_id: climate.sauna
state: 'off'
action:
- data: {}
entity_id: climate.sauna
service: climate.turn_on
- data:
temperature: 85
entity_id: climate.sauna
service: climate.set_temperature
# Turn the thermostat off with the bottom button on the dimmer switch.
- id: '1586440246397'
alias: Sauna thermostat off with dimmer
description: ''
trigger:
- event_data:
event: 4002
id: "hue_dimmer_switch_1"
event_type: hue_event
platform: event
action:
- data: {}
entity_id: climate.sauna
service: climate.turn_off
# helper automation to delay starting of HomeKit until the Zwave integration has
# fully started
- alias: Autostart HomeKit when ZWave is ready
trigger:
- platform: event
event_type: zwave.network_ready
- platform: event
event_type: zwave.network_complete
- platform: event
event_type: zwave.network_complete_some_dead
action:
- service: homekit.start
id: ec052d36d3c24d6ca2ee0d1fc1539f8a
# To keep things fresh, restart Home Assistant every night at 4am.
- alias: Restart HA
trigger:
platform: time
at: 04:00:00
action:
- service: homeassistant.restart
id: 182840f8c4ac4e24b7d61ce3953b6372
# When the sauna is turned off, reset our little helper variable that we use to
# keep track of whether the sauna has reached the desired temperature.
- id: '1586914797351'
alias: Reset Sauna Has Triggered when Sauna Thermostat is turned off
description: ''
trigger:
- entity_id: climate.sauna
from: heat
platform: state
to: 'off'
condition: []
action:
- data:
value: 0
entity_id: input_number.sauna_ready_has_triggered
service: input_number.set_value
# When the sauna reaches the desired temperature, store that in our little
# helper variable.
- id: '1586932458356'
alias: Set Sauna Has Triggered when sauna thermostat reaches set temperature
description: ''
trigger:
- entity_id: sensor.sauna_temperature
platform: state
condition:
- condition: template
value_template: "{{ not is_state('climate.sauna', 'off') }}"
- condition: template
value_template: "{{ states('sensor.sauna_temperature')|float > state_attr('climate.sauna','temperature')|float }}"
action:
- data:
value: 1
entity_id: input_number.sauna_ready_has_triggered
service: input_number.set_value
# When the thermostat temperature is changed to a value higher than the current
# temperature, reset the helper variable to it can trigger again when we reach
# the new desired temperature.
- id: '1586933949206'
alias: Reset Sauna Triggered when thermostat temp is set higher than current temperature
description: ''
trigger:
- entity_id: climate.sauna
platform: state
condition:
- condition: template
value_template: "{{ not is_state('climate.sauna', 'off') }}"
- condition: template
value_template: >
{{ trigger.from_state and
trigger.to_state.attributes.temperature !=
trigger.from_state.attributes.temperature }}
- condition: template
value_template: "{{ states('sensor.sauna_temperature')|float < state_attr('climate.sauna','temperature')|float }}"
action:
- data:
value: 0
entity_id: input_number.sauna_ready_has_triggered
service: input_number.set_value
# When the helper variable is set, run a script that will announce that the
# sauna is ready over Sonos.
- id: '1586934652491'
alias: Announce Sauna is Ready
description: ''
trigger:
- entity_id: input_number.sauna_ready_has_triggered
from: '0.0'
platform: state
to: '1.0'
condition: []
action:
- data:
delay: 00:00:05
sonos_entity: media_player.kitchen
volume: 0.25
service: script.sauna_sonos_announce
# Turn just the lights on when the brighten button is pushed
- id: '1587189680546'
alias: Sauna spots on with brighten button
description: ''
trigger:
- event_data:
event: 2002
id: "hue_dimmer_switch_1"
event_type: hue_event
platform: event
condition:
- condition: device
device_id: d62adfa62d3549a98e887a0c7fb49071
domain: light
entity_id: light.sauna_spot_1
type: is_off
action:
- device_id: d62adfa62d3549a98e887a0c7fb49071
domain: light
entity_id: light.sauna_spot_1
type: turn_on
- device_id: 3b13712ead96466db7ffa0626bd8e1ab
domain: light
entity_id: light.sauna_spot_2
type: turn_on