-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathHASSIO.Implementation.txt
390 lines (371 loc) · 11.8 KB
/
HASSIO.Implementation.txt
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
#-----THESE Entries are entered in your Configuration.yaml
#---- AQUALINK THERMOSTATS (Freeze, Pool, Spa) -------------
climate:
- platform: mqtt
unique_id: aqualink_pool_heater
name: Pool Heater
modes:
- "off"
- "heat"
send_if_off: true
initial: 70
power_command_topic: "aqualinkd/Pool_Heater/set"
payload_on: "1"
payload_off: "0"
current_temperature_topic: "aqualinkd/Temperature/Pool"
min_temp: 70
max_temp: 90
mode_command_topic: "aqualinkd/Pool_Heater/set"
mode_state_topic: "aqualinkd/Pool_Heater/enabled"
mode_state_template: >-
{% set values1 = { '0':'off', '1':'heat'} %}
{{ values1[value] if value in values1.keys() else 'off' }}
temperature_command_topic: "aqualinkd/Pool_Heater/setpoint/set"
temperature_state_topic: "aqualinkd/Pool_Heater/setpoint"
temperature_state_template: "{{ value_json }}"
- platform: mqtt
unique_id: aqualink_spa_heater
name: Spa Heater
modes:
- "off"
- "heat"
send_if_off: true
initial: 100
power_command_topic: "aqualinkd/Spa_Heater/set"
payload_on: "1"
payload_off: "0"
current_temperature_topic: "aqualinkd/Temperature/Spa"
min_temp: 80
max_temp: 104
mode_command_topic: "aqualinkd/Spa_Heater/set"
mode_state_topic: "aqualinkd/Spa_Heater/enabled"
mode_state_template: >-
{% set values2 = { '0':'off', '1':'heat'} %}
{{ values2[value] if value in values2.keys() else 'off' }}
temperature_command_topic: "aqualinkd/Spa_Heater/setpoint/set"
temperature_state_topic: "aqualinkd/Spa_Heater/setpoint"
temperature_state_template: "{{ value_json }}"
- platform: mqtt
unique_id: aqualink_freeze_protect
name: Freeze Protect
modes:
- "off"
- "cool"
send_if_off: true
initial: 36
power_command_topic: "aqualinkd/Freeze_Protect/set"
payload_on: "1"
payload_off: "0"
current_temperature_topic: "aqualinkd/Temperature/Air"
min_temp: 34
max_temp: 42
mode_command_topic: "aqualinkd/Freeze_Protect/set"
mode_state_topic: "aqualinkd/Freeze_Protect/enabled"
mode_state_template: >-
{% set values = { '0':'off', '1':'cool'} %}
{{ values[value] if value in values.keys() else 'off' }}
temperature_command_topic: "aqualinkd/Freeze_Protect/setpoint/set"
temperature_state_topic: "aqualinkd/Freeze_Protect/setpoint"
temperature_state_template: "{{ value_json }}"
#----AQUALINK SWITCHES
switch:
- platform: mqtt
unique_id: aqualink_freeze_protect
name: "Freeze Protection"
state_topic: "aqualinkd/Freeze_Protect/enabled"
command_topic: "aqualinkd/Freeze_Protect/set" #NOTE: aqualinkd does not support toggling Freeze Protect due to being a menu option rather than a simple command. Use your RS controller to change the setting. This should be configured as a binary_sensor instead of a switch to make it more obvious but I kept it a switch in case the limitation changes in the future.
json_attributes_topic: "aqualinkd/Freeze_Protect"
json_attributes_template: "{{ {'active': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:snowflake
- platform: mqtt
unique_id: aqualink_filter_pump
name: "Filter Pump"
state_topic: "aqualinkd/Filter_Pump"
command_topic: "aqualinkd/Filter_Pump/set"
json_attributes_topic: "aqualinkd/Filter_Pump/delay"
json_attributes_template: "{{ {'delay': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
- platform: mqtt
unique_id: aqualink_pool_light
name: "Pool Light"
state_topic: "aqualinkd/Solar_Heater"
command_topic: "aqualinkd/Solar_Heater/set"
json_attributes_topic: "aqualinkd/Solar_Heater/delay"
json_attributes_template: "{{ {'delay': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:lightbulb
- platform: mqtt
unique_id: aqualink_spa_mode
name: "Spa Mode"
state_topic: "aqualinkd/Spa"
command_topic: "aqualinkd/Spa/set"
json_attributes_topic: "aqualinkd/Spa/delay"
json_attributes_template: "{{ {'delay': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:hot-tub
- platform: mqtt
unique_id: aqualink_cleaner
name: "Cleaner"
state_topic: "aqualinkd/Aux_1"
command_topic: "aqualinkd/Aux_1/set"
json_attributes_topic: "aqualinkd/Aux_1/delay"
json_attributes_template: "{{ {'delay': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:broom
- platform: mqtt
unique_id: aqualink_spa_blower
name: "Spa Blower"
state_topic: "aqualinkd/Aux_2"
command_topic: "aqualinkd/Aux_2/set"
json_attributes_topic: "aqualinkd/Aux_2/delay"
json_attributes_template: "{{ {'delay': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:fan
- platform: mqtt
unique_id: aqualink_spa_light
name: "Spa Light"
state_topic: "aqualinkd/Aux_3"
command_topic: "aqualinkd/Aux_3/set"
json_attributes_topic: "aqualinkd/Aux_3/delay"
json_attributes_template: "{{ {'delay': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:lightbulb
- platform: mqtt
unique_id: aqualink_pool_heater
name: "Pool Heater"
state_topic: "aqualinkd/Pool_Heater/enabled"
command_topic: "aqualinkd/Pool_Heater/set"
json_attributes_topic: "aqualinkd/Pool_Heater"
json_attributes_template: "{{ {'active': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:fire
- platform: mqtt
unique_id: aqualink_spa_heater
name: "Spa Heater"
state_topic: "aqualinkd/Spa_Heater/enabled"
command_topic: "aqualinkd/Spa_Heater/set"
json_attributes_topic: "aqualinkd/Spa_Heater"
json_attributes_template: "{{ {'active': value|int} | tojson }}"
qos: 1
payload_on: "1"
payload_off: "0"
retain: false
icon: mdi:fire
#----AQUALINK SENSORS
sensor:
- platform: mqtt
unique_id: aqualink_pool_state
state_topic: "aqualinkd/Service_Mode"
name: "Aqualink Mode"
value_template: "{{ value }}"
icon: mdi:wrench
- platform: mqtt
unique_id: aqualink_air_temp
state_topic: "aqualinkd/Temperature/Air"
name: "Air Temp"
value_template: "{{ value_json }}"
unit_of_measurement: "°F"
device_class: temperature
- platform: mqtt
unique_id: aqualink_spa_temp
state_topic: "aqualinkd/Temperature/Spa"
name: "Spa Temp"
value_template: "{{ value_json }}"
unit_of_measurement: "°F"
device_class: temperature
- platform: mqtt
unique_id: aqualink_pool_temp
state_topic: "aqualinkd/Temperature/Pool"
name: "Pool Temp"
value_template: "{{ value_json }}"
unit_of_measurement: "°F"
device_class: temperature
- platform: mqtt
unique_id: aqualink_pool_heater_temp
state_topic: "aqualinkd/Pool_Heater/setpoint"
name: "Pool Heater Temp"
value_template: "{{ value_json }}"
unit_of_measurement: "°F"
device_class: temperature
- platform: mqtt
unique_id: aqualink_spa_heater_temp
state_topic: "aqualinkd/Spa_Heater/setpoint"
name: "Spa Heater Temp"
value_template: "{{ value_json }}"
unit_of_measurement: "°F"
device_class: temperature
- platform: template
sensors:
#this sensor simulates a numeric state, but since we only get NORMAL or LOW from Aqualink we can't do a true range
aqualink_battery_level:
value_template: >-
{%- if states('binary_sensor.aqualink_battery') == "off" %}
80
{% else %}
5
{%- endif %}
icon_template: >-
{%- if states('binary_sensor.aqualink_battery') == "off" %}
mdi:battery
{% else %}
mdi:battery-alert
{%- endif %}
friendly_name: 'Aqualink Battery Level'
unit_of_measurement: '%'
device_class: battery
#this sensor translates the service mode values
aqualink_run_mode:
value_template: >-
{%- if states('sensor.aqualink_mode') == '0' %}
AUTO
{% elif states('sensor.aqualink_mode') == '1' %}
SERVICE
{% elif states('sensor.aqualink_mode') == '2' %}
TIMEOUT
{%- endif %}
icon_template: >-
{%- if states('sensor.aqualink_mode') == '0' %}
mdi:robot
{% elif states('sensor.aqualink_mode') == '1' %}
mdi:cog
{% elif states('sensor.aqualink_mode') == '2' %}
mdi:clock
{%- endif %}
friendly_name: 'Aqualink Run Mode'
#----AQUALINK BINARY SENSORS
binary_sensor:
- platform: mqtt
unique_id: aqualink_pool_heater
state_topic: "aqualinkd/Pool_Heater"
name: "Pool Heating"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: aqualink_spa_heater
state_topic: "aqualinkd/Spa_Heater"
name: "Spa Heating"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: aqualink_freeze_protection
state_topic: "aqualinkd/Freeze_Protect"
name: "Freeze Protecting"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: aqualink_alive
state_topic: "aqualinkd/Alive"
name: "AqualinkD Alive"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: aqualink_battery
state_topic: "aqualinkd/Battery"
name: "Aqualink Battery"
qos: 0
payload_on: "0"
payload_off: "1"
device_class: battery
- platform: mqtt
unique_id: filter_pump_delay
state_topic: "aqualinkd/Filter_Pump/delay"
name: "Filter Pump Delay"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: spa_mode_delay
state_topic: "aqualinkd/Spa/delay"
name: "Spa Mode Delay"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: pool_light_delay
state_topic: "aqualinkd/Solar_Heater/delay"
name: "Pool Light Delay"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: cleaner_delay
state_topic: "aqualinkd/Aux_1/delay"
name: "Cleaner Delay"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: spa_blower_delay
state_topic: "aqualinkd/Aux_2/delay"
name: "Spa Blower Delay"
qos: 0
payload_on: "1"
payload_off: "0"
- platform: mqtt
unique_id: spa_light_delay
state_topic: "aqualinkd/Aux_3/delay"
name: "Spa Light Delay"
qos: 0
payload_on: "1"
payload_off: "0"
#-----Automation Entries---------
automation:
- alias: 'Notify of Low Pool Battery'
initial_state: 'on'
trigger:
platform: state
entity_id: sensor.battery_check
from: 'OK'
to: 'LOW'
condition:
condition: time
after: '08:15:00'
before: '16:00:00'
action:
# Change notify.ios.brianphone to whatever your phone name is...
- service: notify.ios_brianphone
data:
message: 'The Aqualink Pool Controller Battery is LOW'
title: 'Home Assistant'
- id: disable-heater-when-pool-off
alias: Disable heater when pool off
initial_state: on
trigger:
platform: state
entity_id: switch.filter_pump
from: 'on'
to: 'off'
action:
- service: switch.turn_off
entity_id:
- switch.pool_heater
- switch.spa_heater