-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcaldaia.yaml
509 lines (478 loc) · 13.7 KB
/
caldaia.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
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
esphome:
name: caldaia
friendly_name: Caldaia
project:
name: Riello.Residence
version: "1.0"
platformio_options:
board_build.ldscript: eagle.flash.4m.ld
lib_deps: # required by freebear-nc/esphome-opentherm
- https://github.com/PxPert/opentherm_library.git
on_boot:
priority: -100.0
then:
- number.set:
id: t_set
value: !lambda "return id(t_set_template).state;"
- number.set:
id: t_dwh_set
value: !lambda "return id(t_dwh_set_template).state;"
# - lambda: |-
# id(error_text) = "caricato";
# id(test_float) = id(t_set_template).state;
# id(test_float2) = id(t_dwh_set_template).state;
esp8266:
board: esp12e
# Enable logging
logger:
level: INFO
preferences:
flash_write_interval: 6h
mdns:
disabled: True
# Enable Home Assistant API
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_pwd_sec
wifi:
ssid: !secret wifi_dmz_ssid
password: !secret wifi_dmz_password
use_address: 192.168.2.13
external_components:
- source: github://PxPert/esphome-opentherm
# external_components:
# source:
# type: local
# path: /config/components/esphome-opentherm/components
opentherm:
in_pin: 12
out_pin: 14
ch_enable: true
dhw_enable: true
# cooling_enable: false
# otc_active: false
# ch2_active: false
# sync_mode: false
dallas:
- pin: GPIO13
#output:
# - platform: opentherm
# t_set:
# id: t_set
# min_value: 20
# max_value: 65
# zero_means_zero: true
#
#climate:
# - platform: pid
# name: "Central heating"
# heat_output: t_set
# default_target_temperature: 20
# sensor: ch_room_temperature
# control_parameters:
# kp: 0.4
# ki: 0.004
globals:
- id: error_text
type: const char*
initial_value: 'NULL'
restore_value: no
- id: display_on
type: bool
initial_value: 'false'
restore_value: no
# - id: test_float
# type: float
# initial_value: '0'
# restore_value: no
# - id: test_float2
# type: float
# initial_value: '0'
# restore_value: no
number:
- platform: opentherm
t_set:
id: t_set
internal: true
# zero_means_zero: true
t_dhw_set:
internal: true
id: t_dwh_set
# zero_means_zero: true
- platform: template
name: "Temperatura boiler"
id: t_set_template
restore_value: true
min_value: 0
# minimo effettivo 40
max_value: 75
mode: slider
device_class: temperature
unit_of_measurement: "°C"
initial_value: 65
set_action:
- number.set:
id: t_set
value: !lambda "return x;"
optimistic: true
step: 1
- platform: template
name: "Temperatura acqua"
id: t_dwh_set_template
restore_value: true
min_value: 37
max_value: 60
device_class: temperature
unit_of_measurement: "°C"
initial_value: 40
mode: slider
set_action:
- number.set:
id: t_dwh_set
value: !lambda "return x;"
optimistic: true
step: 1
switch:
- platform: opentherm
ch_enable:
id: ch_enable
name: "Riscaldamento"
mode: restore_default_off
dhw_enable:
id: dhw_enable
name: "Acqua calda"
mode: restore_default_on
sm_active:
id: sm_active
name: "Summer mode"
mode: restore_default_off
dhw_block:
id: dhw_block
name: "Blocca Acqua calda"
mode: restore_default_off
# - platform: template
# name: Test Error1
# id: test_1
# optimistic: true
# restore_mode: ALWAYS_OFF
# on_turn_on:
# - lambda: |-
# id(error_text) = id(test_1).state?"Low Water Press":NULL;
# - component.update: lcd_display
# on_turn_off:
# - lambda: |-
# id(error_text) = id(test_1).state?"Test1":NULL;
# - component.update: lcd_display
# - platform: template
# id: test_2
# name: Test Error2
# optimistic: true
# restore_mode: ALWAYS_OFF
# on_turn_on:
# - lambda: |-
# id(error_text) = id(test_2).state?"Test2":NULL;
# - component.update: lcd_display
# on_turn_off:
# - lambda: |-
# id(error_text) = id(test_2).state?"Test2":NULL;
# - component.update: lcd_display
script:
- id: delay_reset_display
mode: restart
then:
- delay: 60s
- globals.set:
id: display_on
value: 'false'
- component.update: lcd_display
binary_sensor:
- platform: gpio
pin:
number: 0
mode:
input: true
pullup: true
name: "Pulsante"
filters:
- delayed_on: 10ms
on_press:
then:
- if:
condition:
lambda: 'return id(display_on);'
then:
- lambda: |-
if (id(ch_enable).state) {
if ( (id(dhw_enable).state) && (! id(sm_active).state)) {
id(sm_active).toggle();
id(dhw_enable).toggle();
} else if (id(dhw_enable).state) {
id(sm_active).toggle();
} else {
id(dhw_enable).toggle();
}
} else {
id(sm_active).turn_on();
id(dhw_enable).toggle();
}
- globals.set:
id: display_on
value: 'true'
else:
- globals.set:
id: display_on
value: 'true'
- component.update: lcd_display
- script.execute: delay_reset_display
- platform: opentherm
ch_active:
id: ch_active
name: "Central Heating active"
dhw_active:
id: dhw_active
name: "Domestic Hot Water active"
on_state:
then:
- component.update: lcd_display
flame_on:
name: "Flame on"
id: flame_on
on_state:
then:
- component.update: lcd_display
fault_indication:
id: fault_indication
name: "Fault indication"
on_state:
then:
- lambda: |-
id(error_text) = id(fault_indication).state?"Fault indication":NULL;
- component.update: lcd_display
diagnostic_indication:
id: diagnostic_indication
name: "Diagnostic event"
on_state:
then:
- lambda: |-
id(error_text) = id(diagnostic_indication).state?"Diagnostic event":NULL;
- component.update: lcd_display
service_request:
id: service_request
name: "Service Request"
on_state:
then:
- lambda: |-
id(error_text) = id(service_request).state?"Service request":NULL;
- component.update: lcd_display
lockout_reset:
id: lockout_reset
name: "Lockout Reset"
on_state:
then:
- lambda: |-
id(error_text) = id(lockout_reset).state?"Lockout reset":NULL;
- component.update: lcd_display
low_water_pressure:
id: low_water_pressure
name: "Low Water Pressure"
on_state:
then:
- lambda: |-
id(error_text) = id(low_water_pressure).state?"Low water press":NULL;
- component.update: lcd_display
flame_fault:
id: flame_fault
name: "Gas/Flame Fault"
on_state:
then:
- lambda: |-
id(error_text) = id(flame_fault).state?"Gas/Flame fault":NULL;
- component.update: lcd_display
air_pressure_fault:
id: air_pressure_fault
name: "Air Pressure Fault"
on_state:
then:
- lambda: |-
id(error_text) = id(air_pressure_fault).state?"Air Press fault":NULL;
- component.update: lcd_display
water_over_temperature:
id: water_over_temperature
name: "Water Over Temperature"
on_state:
then:
- lambda: |-
id(error_text) = id(water_over_temperature).state?"Water overtemp":NULL;
- component.update: lcd_display
sensor:
- platform: opentherm
rel_mod_level:
name: "Boiler Relative modulation level"
ch_pressure:
id: ch_pressure
name: "Water pressure in CH circuit (bar)"
on_value:
then:
- component.update: lcd_display
t_boiler:
name: "Boiler water temperature"
id: t_boiler
on_value:
then:
- component.update: lcd_display
t_dhw:
id: t_dhw
name: "DHW temperature (°C)"
on_value:
then:
- component.update: lcd_display
t_ret:
id: t_ret
name: "Return water temperature (°C)"
t_exhaust:
name: "Boiler exhaust temperature (°C)"
burner_operation_hours:
name: "Number of hours that burner is in operation"
t_dhw_set:
name: "Domestic hot water temperature setpoint (°C)"
oem_fault_code:
id: oem_fault_code
name: "OEM fault code"
oem_diagnostic_code:
id: oem_diagnostic_code
name: "OEM diagnostic code"
# # 60°
# t_dhw_set_ub:
# name: "Upper bound for adjustment of DHW setpoint (°C)"
# # 37°
# t_dhw_set_lb:
# name: "Lower bound for adjustment of DHW setpoint (°C)"
#
# # 80°
# max_t_set_ub:
# name: "Upper bound for adjustment of max CH setpoint (°C)"
# # 40°
# max_t_set_lb:
# name: "Lower bound for adjustment of max CH setpoint (°C)"
#
# # Fisso 80°
# max_t_set:
# name: "Maximum allowable CH water setpoint (°C)"
# Letture non disponibili
# t_outside:
# name: "Outside temperature (°C)"
# dhw_flow_rate:
# name: "Water flow rate in DHW circuit (l/min)"
# t_flow_ch2:
# name: "Flow water temperature CH2 circuit (°C)"
# t_dhw2:
# name: "Domestic hot water temperature 2 (°C)"
# burner_starts:
# name: "Number of starts burner"
# ch_pump_starts:
# name: "Number of starts CH pump"
# dhw_pump_valve_starts:
# name: "Number of starts DHW pump/valve"
# dhw_burner_starts:
# name: "Number of starts burner during DHW mode"
# ch_pump_operation_hours:
# name: "Number of hours that CH pump has been running"
# dhw_pump_valve_operation_hours:
# name: "Number of hours that DHW pump has been running or DHW valve has been opened"
# dhw_burner_operation_hours:
# name: "Number of hours that burner is in operation during DHW mode"
# otc_ratio_ub:
# name: "Upper bound of OTC curve ()"
# otc_ratio_lb:
# name: "Lower bound of OTC curve ()"
# otc_hc_ratio:
# name: "OTC heat curve ratio (°C)"
# t_heat_exchanger:
# name: "Boiler heat exchanger temperature (°C)"
# boiler_fan_speed:
# name: "Boiler fan speed"
# boiler_flame_current:
# name: "Boiler flame current (uA)"
# max_capacity:
# name: "Maximum boiler capacity (KW)"
# min_mod_level:
# name: "Minimum modulation level (%)"
- platform: dallas
address: 0xed0622700cacb928
name: "Temperatura cucina"
i2c:
sda: GPIO5
scl: GPIO4
frequency: 500kHz
font:
- file: 'fonts/Roboto-Regular.ttf'
id: font_small
size: 11
- file: 'fonts/Roboto-Regular.ttf'
id: font_big
size: 18
- file: 'fonts/materialdesignicons-webfont.ttf'
id: md_state_icons
size: 16
glyphs:
- "\U000F0AD7" # radiator-disabled
- "\U000F0AD8" # radiator-off
- "\U000F1B29" # faucet (rubinetto)
- "\U000F0238" # flame
- "\U000F1A85" # water-thermometer
- "\U000F0438" # radiator
- file: 'fonts/materialdesignicons-webfont.ttf'
id: md_big_icons
size: 20
glyphs:
- "\U000F0026" # alert
display:
- platform: ssd1306_i2c
id: lcd_display
model: "SSD1306 128x32"
address: 0x3C
# invert: True
lambda: |-
if ( ! ( (id(display_on)) || (id(error_text))) ) {
return;
}
if (id(error_text)) {
// Errore
it.printf(14,16,id(md_big_icons),TextAlign::CENTER_LEFT,"\U000F0026");
// it.printf(34,0,id(font_big),TextAlign::TOP_LEFT,"Err %.0f/%.0f",id(test_float),id(test_float2));
it.printf(34,0,id(font_big),TextAlign::TOP_LEFT,"Err %.0f/%.0f",id(oem_fault_code).state,id(oem_diagnostic_code).state);
it.printf(34,32,id(font_small),TextAlign::BOTTOM_LEFT,"%s",id(error_text));
} else if (id(dhw_active).state) {
// Rubinetto aperto
it.print(128, 32,id(md_state_icons),TextAlign::BOTTOM_RIGHT,"\U000F1A85");
it.printf(64,0,id(font_big),TextAlign::TOP_CENTER,"%.1f°/%.0f°",id(t_dhw).state,id(t_dwh_set).state);
it.printf(64,32,id(font_small),TextAlign::BOTTOM_CENTER,"%.1f bar %.1f°/%.0f°",id(ch_pressure).state,id(t_boiler).state,id(t_set).state);
} else if (id(ch_active).state) {
// Riscaldamento acceso
it.print(128, 32,id(md_state_icons),TextAlign::BOTTOM_RIGHT,"\U000F0438");
it.printf(64,0,id(font_big),TextAlign::TOP_CENTER,"%.1f°/%.0f°",id(t_boiler).state,id(t_set).state);
it.printf(64,32,id(font_small),TextAlign::BOTTOM_CENTER,"%.1f bar r:%.1f°",id(ch_pressure).state,id(t_ret).state);
} else {
it.printf(64,0,id(font_big),TextAlign::TOP_CENTER,"%.1f bar",id(ch_pressure).state);
it.printf(64,32,id(font_small),TextAlign::BOTTOM_CENTER,"%.1f°",id(t_boiler).state);
}
if ( ! id(display_on) ) {
return;
}
if (id(flame_on).state) {
// Fiamma accesa
it.print(128, 0,id(md_state_icons),TextAlign::TOP_RIGHT,"\U000F0238");
}
if ((id(dhw_enable).state) || (! id(sm_active).state)) {
// Acqua calda abilitata
it.print(0, 0,id(md_state_icons),TextAlign::TOP_LEFT,"\U000F1B29");
}
if (! id(ch_enable).state) {
// Riscaldamento disabilitato
it.print(0, 32,id(md_state_icons),TextAlign::BOTTOM_LEFT,"\U000F0AD8");
} else if (! id(sm_active).state) {
// Riscaldamento abilitato
it.print(0, 32,id(md_state_icons),TextAlign::BOTTOM_LEFT,"\U000F0AD7");
}