-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathradiant_controller.yaml
469 lines (450 loc) · 9.6 KB
/
radiant_controller.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
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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
substitutions:
device_name: radiant_controller
esphome:
name: radiant_controller
friendly_name: Radiant Controller
on_boot:
then:
pcf85063.read_time: # read RTC time once the system boots
esp32:
board: esp32dev
api:
ota:
# see https://github.com/dtlzp/relay_dev_demo
# Enable logging
logger:
level: DEBUG
baud_rate: 0
#wifi:
# ssid: 74ax4k
# password: twosigma
ethernet:
type: JL1101
mdc_pin: GPIO23
mdio_pin: GPIO18
power_pin: GPIO12
clk_mode: GPIO17_OUT
phy_addr: 0
uart:
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
stop_bits: 1
modbus:
flow_control_pin: GPIO33
id: modbus1
modbus_controller:
id: modbus_ctl
address: 0x1
modbus_id: modbus1
setup_priority: -10
i2c:
scl: GPIO32
sda: GPIO16
scan: true
id: i2c_bus
sn74hc595:
- id: sn74hc595_hub
data_pin: GPIO13 #SER
clock_pin: GPIO14 #SRCLK
latch_pin: GPIO15 #RCLK
oe_pin: GPIO0
sr_count: 2
#sn74hc165:
# - id: sn74hc165_hub
# clock_pin: GPIO14
# data_pin: GPIO35
# load_pin: GPIO0
# clock_inhibit_pin: GPIO15
# sr_count: 2
time:
- platform: pcf85063
update_interval: never # internal clock is fine for general use
- platform: homeassistant
on_time_sync:
then:
pcf85063.write_time: # sync RTC to HA when available
sensor:
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: NTC modbus address
register_type: holding
address: 0x0
value_type: U_WORD
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Baud Rate
register_type: holding
address: 0x1
value_type: U_WORD
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: NTC B Value
register_type: holding
address: 0x2
value_type: U_WORD
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 0 Temperature
id: temp_room0
register_type: holding
address: 1024
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 1 Temperature
id: temp_room1
register_type: holding
address: 1025
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
# TODO here we need to check if the floor is overheating, and if so, turn off the pump
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 2 Temperature
id: temp_room2
register_type: holding
address: 1026
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 3 Temperature
id: temp_room3
register_type: holding
address: 1027
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 4 Temperature
id: temp_room4
register_type: holding
address: 1028
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 5 Temperature
id: temp_room5
register_type: holding
address: 1029
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 6 Temperature
id: temp_room6
register_type: holding
address: 1030
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 7 Temperature
id: temp_room7
register_type: holding
address: 1031
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 8 Temperature
id: temp_room8
register_type: holding
address: 1032
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 9 Temperature
id: temp_room9
register_type: holding
address: 1033
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 10 Temperature
id: temp_room10
register_type: holding
address: 1034
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_ctl
name: Room 11 Temperature
id: temp_room11
register_type: holding
address: 1035
unit_of_measurement: ºC
value_type: U_WORD
filters:
- multiply: 0.1
switch:
- platform: gpio
name: Factory LED
pin:
number: GPIO2
- platform: gpio
name: Relay 16 control
id: relay16ctl
pin:
sn74hc595: sn74hc595_hub
number: 0
inverted: false
- platform: gpio
name: Relay 15 control
id: relay15ctl
pin:
sn74hc595: sn74hc595_hub
number: 1
inverted: false
- platform: gpio
name: Relay 14 control
id: relay14ctl
pin:
sn74hc595: sn74hc595_hub
number: 2
inverted: false
- platform: gpio
name: Relay 13 control
id: relay13ctl
pin:
sn74hc595: sn74hc595_hub
number: 3
inverted: false
- platform: gpio
name: Relay 12 control
id: relay12ctl
pin:
sn74hc595: sn74hc595_hub
number: 4
inverted: false
- platform: gpio
name: Relay 11 control
id: relay11ctl
pin:
sn74hc595: sn74hc595_hub
number: 5
inverted: false
- platform: gpio
name: Relay 10 control
id: relay10ctl
pin:
sn74hc595: sn74hc595_hub
number: 6
inverted: false
- platform: gpio
name: Relay 9 control
id: relay9ctl
pin:
sn74hc595: sn74hc595_hub
number: 7
inverted: false
- platform: gpio
name: Relay 8 control
id: relay8ctl
pin:
sn74hc595: sn74hc595_hub
number: 8
inverted: false
- platform: gpio
name: Relay 7 control
id: relay7ctl
pin:
sn74hc595: sn74hc595_hub
number: 9
inverted: false
- platform: gpio
name: Relay 6 control
id: relay6ctl
pin:
sn74hc595: sn74hc595_hub
number: 10
inverted: false
- platform: gpio
name: Relay 5 control
id: relay5ctl
pin:
sn74hc595: sn74hc595_hub
number: 11
inverted: false
- platform: gpio
name: Relay 4 control
id: relay4ctl
pin:
sn74hc595: sn74hc595_hub
number: 12
inverted: false
- platform: gpio
name: Relay 3 control
id: relay3ctl
pin:
sn74hc595: sn74hc595_hub
number: 13
inverted: false
- platform: gpio
name: Relay 2 control
id: relay2ctl
pin:
sn74hc595: sn74hc595_hub
number: 14
inverted: false
- platform: gpio
name: Relay 1 control
id: relay1ctl
pin:
sn74hc595: sn74hc595_hub
number: 15
inverted: false
output:
- platform: sigma_delta_output
update_interval: 30s
id: heater_room1
turn_on_action:
# TODO here we need to check that the floor isn't overheating
# really should register intention in a template
- switch.turn_on: relay1ctl
turn_off_action:
- switch.turn_off: relay1ctl
climate:
platform: pid
name: PID Climate Controller
sensor: temp_room1
default_target_temperature: 21
heat_output: heater_room1
control_parameters:
kp: 0
ki: 0
kd: 0
output_averaging_samples: 5
derivative_averaging_samples: 5
deadband_parameters:
threshold_high: 0.5
threshold_low: -0.5
binary_sensor:
- platform: gpio
name: Factory Button
pin:
number: GPIO34
inverted: true
# - platform: gpio
# name: input8
# pin:
# sn74hc165: sn74hc165_hub
# number: 0
# inverted: true
# - platform: gpio
# name: input7
# pin:
# sn74hc165: sn74hc165_hub
# number: 1
# inverted: true
# - platform: gpio
# name: input6
# pin:
# sn74hc165: sn74hc165_hub
# number: 2
# inverted: true
# - platform: gpio
# name: input5
# pin:
# sn74hc165: sn74hc165_hub
# number: 3
# inverted: true
# - platform: gpio
# name: input4
# pin:
# sn74hc165: sn74hc165_hub
# number: 4
# inverted: true
# - platform: gpio
# name: input3
# pin:
# sn74hc165: sn74hc165_hub
# number: 5
# inverted: true
# - platform: gpio
# name: input2
# pin:
# sn74hc165: sn74hc165_hub
# number: 6
# inverted: true
# - platform: gpio
# name: input1
# pin:
# sn74hc165: sn74hc165_hub
# number: 7
# inverted: true
# - platform: gpio
# name: input16
# pin:
# sn74hc165: sn74hc165_hub
# number: 8
# inverted: true
# - platform: gpio
# name: input15
# pin:
# sn74hc165: sn74hc165_hub
# number: 9
# inverted: true
# - platform: gpio
# name: input14
# pin:
# sn74hc165: sn74hc165_hub
# number: 10
# inverted: true
# - platform: gpio
# name: input13
# pin:
# sn74hc165: sn74hc165_hub
# number: 11
# inverted: true
# - platform: gpio
# name: input12
# pin:
# sn74hc165: sn74hc165_hub
# number: 12
# inverted: true
# - platform: gpio
# name: input11
# pin:
# sn74hc165: sn74hc165_hub
# number: 13
# inverted: true
# - platform: gpio
# name: input10
# pin:
# sn74hc165: sn74hc165_hub
# number: 14
# inverted: true
# - platform: gpio
# name: input9
# pin:
# sn74hc165: sn74hc165_hub
# number: 15
# inverted: true