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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
| ################################################
## ESPAltherma
################################################
################################################
## Component setup
################################################
# - platform: generic_thermostat
# name: ESPAltherma
# heater: switch.altherma
# target_sensor: sensor.woonkamer_temperature
# min_temp: 15
# max_temp: 25
# cold_tolerance: 0.5
# hot_tolerance: 0.5
# min_cycle_duration:
# minutes: 30
# away_temp: 15
# precision: 0.1
# climate:
# - platform: smart_thermostat
# name: ESPAltherma
# unique_id: climate_espaltherma
# heater: switch.altherma #esp
# invert_heater: true
# target_sensor: sensor.gemiddelde_woonkamer_temperatuur
# outdoor_sensor: sensor.espaltherma_outdoorairtemp
# keep_alive:
# seconds: 120
# cold_tolerance: 0.5
# hot_tolerance: 0.5
# #standaard
# #kp: 5
# #ki: 0.01
# #kd: 500
# #vloerverwarming?
# kp: 100
# ki: 0.0032
# kd: 3000 #half uur response? Wellicht minderen
# ke: 0.5 #outdoor sensor gain
# sampling_period: 0 #?
# pwm: 01:30:00
# min_cycle_duration: 00:60:00
# min_off_cycle_duration: 00:10:00
# precision: 0.1
# noiseband: 0.2
# ac_mode: false
# away_temp: 17
# eco_temp: 18
# boost_temp: 22
# comfort_temp: 21
# home_temp: 20
# sleep_temp: 18
# target_temp: 20
# target_temp_step: 0.1
# min_temp: 7
# max_temp: 28
################################################
## Sensor etc
################################################
homeassistant:
customize:
sensor.althermasensors_fan:
friendly_name: "Fan"
icon: mdi:fan
sensor.althermasensors_error_type:
friendly_name: "Error Type"
icon: mdi:alert-circle
sensor.althermasensors_discharge_pipe_temp:
friendly_name: "Discharge pipe temp"
sensor.althermasensors_operation_mode:
friendly_name: "Operation Mode"
sensor.althermasensors_i_o_mode:
friendly_name: "I/O (indoor/outdoor) Mode"
sensor.althermasensors_current_mode:
friendly_name: "Current Mode"
sensor.althermasensors_booster_thermal_protection:
friendly_name: "Booster thermal protection OLD"
sensor.althermasensors_back_up_thermal_protection:
friendly_name: "Back-up thermal protection OLD"
sensor.althermasensors_thermal_protector_backup_heater:
friendly_name: "Thermal Protector Backup Heater"
sensor.althermasensors_thermal_protector_booster_heater:
friendly_name: "Thermal Protector Booster Heater"
sensor.althermasensors_watertanktemperature:
friendly_name: "Watertanktemperature"
icon: mdi:thermometer-water
sensor.althermasensors_flowpump:
friendly_name: "Flowpump"
icon: mdi:water-pump
sensor.althermasensors_water_flow_switch:
friendly_name: "Water flow switch"
sensor.althermasensors_water_pump_operation:
friendly_name: "Water pump operation"
sensor.althermasensors_water_pump_level:
friendly_name: "Water pump level"
sensor.althermasensors_reheat:
friendly_name: "Reheat"
sensor.althermasensors_delta_t_heating:
friendly_name: "Delta T Heating"
sensor.althermasensors_delta_t_cooling:
friendly_name: "Delta T Cooling"
sensor.althermasensors_outdoor_temperature:
friendly_name: "Outdoor temperature"
sensor.althermasensors_thermostat:
friendly_name: "Thermostat"
sensor.althermasensors_defrost_operation:
friendly_name: "Defrost operation"
sensor.althermasensors_back_up_heater:
friendly_name: "Back-up heater"
sensor.althermasensors_watertank_setpoint:
friendly_name: "Watertank setpoint"
sensor.althermasensors_room_temperature_setpoint:
friendly_name: "Room temperature setpoint"
sensor.althermasensors_water_leaving_temperature:
friendly_name: "Water leaving temperature before buh"
icon: mdi:thermometer-water
sensor.althermasensors_water_leaving_temperature_after_buh:
friendly_name: "Water leaving temperature after buh"
icon: mdi:thermometer-water
sensor.althermasensors_water_inlet_temperature:
friendly_name: "Water inlet temperature"
icon: mdi:thermometer-water
sensor.althermasensors_heat_exchanger_temperature:
friendly_name: "Heat exchanger temperature"
sensor.althermasensors_refrigerator_liquid_temperature:
friendly_name: "Refrigerator liquid temperature"
sensor.althermasensors_water_pressure:
friendly_name: "Water pressure"
icon: mdi:car-brake-low-pressure
sensor.althermasensors_leaving_water_setpoint:
friendly_name: "Leaving water setpoint"
sensor.althermasensors_roomtemperature:
friendly_name: "Roomtemperature"
sensor.althermasensors_inverter_current:
friendly_name: "Inverter current"
icon: mdi:current-ac
sensor.althermasensors_inverter_frequency:
friendly_name: "Inverter frequency"
sensor.althermasensors_inverter_usage:
friendly_name: "Inverter usage"
sensor.althermasensors_voltage:
friendly_name: "Voltage"
icon: mdi:flash-triangle
sensor.althermasensors_heat_yield:
friendly_name: "Heat yield"
sensor.althermasensors_suction_pipe_temperature:
friendly_name: "Suction pipe temperature"
sensor.althermasensors_inverter_current_secondary:
friendly_name: "Inverter current secondary"
sensor.althermasensors_pressure_sensor:
friendly_name: "Pressure sensor"
icon: mdi:car-brake-low-pressure
sensor.althermasensors_std_compressor_1:
friendly_name: "STD Compressor 1"
sensor.althermasensors_freeze_protection:
friendly_name: "Freeze Protection"
sensor.althermasensors_silent_mode:
friendly_name: "Silent mode"
sensor.althermasensors_espaltherma_last_update:
friendly_name: "ESPAltherma last update"
sensor.althermasensors_cop:
friendly_name: "COP"
sensor.althermasensors_cop_with_cooling:
friendly_name: "COP with cooling"
sensor.althermasensors_t:
friendly_name: "∆T"
sensor.althermasensors_desinfectie:
friendly_name: "Desinfectie"
sensor:
- platform: min_max
name: Gemiddelde Woonkamer Temperatuur
unique_id: woonkamer_gemiddelde
type: mean
round_digits: 2
entity_ids:
- sensor.althermasensors_roomtemperature #via espaltherma
#- sensor.airco_woonkamer_inside_temperature #airco geeft geen goede resultaten
- sensor.airthings_woonkamer_temperature #airthings
#- sensor.temperatuurmeter_temperature #zigbee temperatuurmeter
- platform: template
sensors:
# smart_thermostat_output:
# friendly_name: PID Output
# unit_of_measurement: "%"
# value_template: "{{ state_attr('climate.espaltherma', 'control_output') | float(0) }}"
# smart_thermostat_p:
# friendly_name: PID P
# unit_of_measurement: "%"
# value_template: "{{ state_attr('climate.espaltherma', 'pid_p') | float(0) }}"
# smart_thermostat_i:
# friendly_name: PID I
# unit_of_measurement: "%"
# value_template: "{{ state_attr('climate.espaltherma', 'pid_i') | float(0) }}"
# smart_thermostat_d:
# friendly_name: PID D
# unit_of_measurement: "%"
# value_template: "{{ state_attr('climate.espaltherma', 'pid_d') | float(0) }}"
# smart_thermostat_e:
# friendly_name: PID E
# unit_of_measurement: "%"
# value_template: "{{ state_attr('climate.espaltherma', 'pid_e') | float(0) }}"
#test!
espaltherma_cop:
friendly_name: "COP"
unit_of_measurement: "COP"
value_template:
"{% if is_state_attr('sensor.althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF') %}
{{
((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float(0) * 0.06 * 1.16 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float(0) - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float(0)) )
/
(state_attr('sensor.althermasensors','INV primary current (A)') | float(0) * state_attr('sensor.althermasensors','Voltage (N-phase) (V)')|float(0) / 1000))
|round(2)
}}
{% else %} 0 {%endif%}"
availability_template: >-
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
template:
- unique_id: "althermasensors"
sensor:
- name: "Althermasensors Fan"
unique_id: fan
state: "{{ state_attr('sensor.althermasensors','Fan 1 (10 rpm)') | float(0) | round * 10 }}"
unit_of_measurement: "rpm"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Error type"
unique_id: errortype
state: "{{ state_attr('sensor.althermasensors','Error type') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Discharge pipe temp"
unique_id: dischargepipetemp
state: "{{ state_attr('sensor.althermasensors','Discharge pipe temp.') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Discharge pipe temp.') | is_number }}
- name: "Althermasensors Operation mode"
unique_id: operationmode
state: "{{ state_attr('sensor.althermasensors','Operation Mode') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors I/O Mode"
unique_id: iomode
state: "{{ state_attr('sensor.althermasensors','I/U operation mode') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Current mode"
unique_id: currentmode
##??state: "{% if is_state('sensor.althermasensors_thermostat', 'ON') %} {{ state_attr('sensor.althermasensors','Operation Mode') }} {% else %} Off {% endif %}"
state: "{{ state_attr('sensor.althermasensors','Operation Mode') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Thermal Protector Backup Heater"
unique_id: backupthermalprotectionnew
state: "{{ state_attr('sensor.althermasensors','Thermal protector (Q1L) BUH') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Thermal Protector Booster Heater"
unique_id: boosterthermalprotectionnew
state: "{{ state_attr('sensor.althermasensors','Thermal protector BSH') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Watertanktemperature"
unique_id: watertanktemperature
state: "{{ state_attr('sensor.althermasensors','DHW tank temp. (R5T)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','DHW tank temp. (R5T)') | is_number }}
- name: "Althermasensors Flowpump"
unique_id: flowpump
state: "{{ state_attr('sensor.althermasensors','Flow sensor (l/min)') }}"
unit_of_measurement: "l/min"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Flow sensor (l/min)') | is_number }}
- name: "Althermasensors Water flow switch"
unique_id: waterflowswitch
state: "{{ state_attr('sensor.althermasensors','Water flow switch') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Water pump operation"
unique_id: waterpumpoperation
state: "{{ state_attr('sensor.althermasensors','Water pump operation') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Water pump level"
unique_id: waterpumplevel
state: "{{ 100 - state_attr('sensor.althermasensors','Water pump signal (0:max-100:stop)') }}"
unit_of_measurement: "%"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Water pump signal (0:max-100:stop)') | is_number }}
- name: "Althermasensors Reheat"
unique_id: reheat
state: "{{ state_attr('sensor.althermasensors','Reheat ON/OFF') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Circulation pump"
unique_id: circulationpump
state: "{{ state_attr('sensor.althermasensors','Circulation pump operation') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Delta T Heating"
unique_id: deltatheating
state: "{{ state_attr('sensor.althermasensors','Target delta T heating') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Delta T Cooling"
unique_id: deltatcooling
state: "{{ state_attr('sensor.althermasensors','Target delta T cooling') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Outdoor temperature"
unique_id: outdoortemperature
state: "{{ state_attr('sensor.althermasensors','R1T-Outdoor air temp.') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','R1T-Outdoor air temp.') | is_number }}
- name: "Althermasensors Thermostat"
unique_id: thermostat
state: "{{ state_attr('sensor.althermasensors','Thermostat ON/OFF') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Defrost operation"
unique_id: defrostoperation
state: "{{ state_attr('sensor.althermasensors','Defrost Operation') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Back-up heater"
unique_id: backupheater
state: "{{ state_attr('sensor.althermasensors','BUH Step1') }}"
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Watertank setpoint"
unique_id: watertanksetpoint
state: "{{ state_attr('sensor.althermasensors','DHW setpoint') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','DHW setpoint') | is_number }}
- name: "Althermasensors Room temperature setpoint"
unique_id: roomtemperaturesetpoint
state: "{{ state_attr('sensor.althermasensors','RT setpoint') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','RT setpoint') | is_number }}
- name: "Althermasensors Water leaving temperature"
unique_id: waterleavingtemperature
state: "{{ state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | is_number }}
- name: "Althermasensors Water leaving temperature after buh"
unique_id: waterleavingtemperatureafterbuh
state: "{{ state_attr('sensor.althermasensors','Leaving water temp. after BUH (R2T)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Leaving water temp. after BUH (R2T)') | is_number }}
- name: "Althermasensors Water inlet temperature"
unique_id: waterinlettemperature
state: "{{ state_attr('sensor.althermasensors','Inlet water temp.(R4T)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Inlet water temp.(R4T)') | is_number }}
- name: "Althermasensors Heat exchanger temperature"
unique_id: heatexchangertemperature
state: "{{ state_attr('sensor.althermasensors','Heat exchanger mid-temp.') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Heat exchanger mid-temp.') | is_number }}
- name: "Althermasensors Refrigerator liquid temperature"
unique_id: refrigeratorliquidtemperature
state: "{{ state_attr('sensor.althermasensors','Refrig. Temp. liquid side (R3T)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Refrig. Temp. liquid side (R3T)') | is_number }}
- name: "Althermasensors Water pressure"
unique_id: waterpressure
state: "{{ state_attr('sensor.althermasensors','Water pressure') }}"
unit_of_measurement: "bar"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Water pressure') | is_number }}
- name: "Althermasensors Leaving water setpoint"
unique_id: leavingwatersetpoint
state: "{{ state_attr('sensor.althermasensors','LW setpoint (main)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','LW setpoint (main)') | is_number }}
- name: "Althermasensors Roomtemperature"
unique_id: roomtemperature
state: "{{ state_attr('sensor.althermasensors','Indoor ambient temp. (R1T)') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Indoor ambient temp. (R1T)') | is_number }}
- name: "Althermasensors Inverter current"
unique_id: invertercurrent
state: "{{ state_attr('sensor.althermasensors','INV primary current (A)') }}"
unit_of_measurement: "A"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','INV primary current (A)') | is_number }}
- name: "Althermasensors Inverter frequency"
unique_id: inverterfrequency
state: "{{ state_attr('sensor.althermasensors','INV frequency (rps)') }}"
unit_of_measurement: "rps"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Inverter usage"
unique_id: inverterusage
state: "{% if is_state_attr('sensor.althermasensors', 'Thermostat ON/OFF', 'ON') %} {{ (states('sensor.althermasensors_inverter_current')|float(0) * 230 | float(0)) }} {% else %} 0 {% endif %}"
unit_of_measurement: "W"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Voltage"
unique_id: voltage
state: "{{ state_attr('sensor.althermasensors','Voltage (N-phase) (V)') }}"
unit_of_measurement: "V"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Voltage (N-phase) (V)') | is_number }}
- name: "Althermasensors Heat yield"
unique_id: heatyield
state: "{% if is_state_attr('sensor.althermasensors', 'Thermostat ON/OFF', 'ON') %} {{ (states('sensor.althermasensors_inverter_usage')|float(0) * states('sensor.althermasensors_cop')| float(0))|round|int }} {% else %} 0 {% endif %}"
unit_of_measurement: "W"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
#- name: "Althermasensors Low noise control"
# unique_id: lownoisecontrol
# state: "{{ state_attr('sensor.althermasensors', 'Low noise control') }}"
# state_class: measurement
- name: "Althermasensors Suction pipe temperature"
unique_id: suctionpipetemperature
state: "{{ state_attr('sensor.althermasensors', 'Suction pipe temp.') }}"
unit_of_measurement: "°C"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','Suction pipe temp.') | is_number }}
- name: "Althermasensors Inverter current secondary"
unique_id: invertercurrentsecondary
state: "{{ state_attr('sensor.althermasensors', 'INV secondary current (A)') }}"
unit_of_measurement: "A"
state_class: measurement
availability: >
{{ state_attr('sensor.althermasensors','INV secondary current (A)') | is_number }}
- name: "Althermasensors Pressure sensor"
unique_id: pressuresensor
state: "{{ state_attr('sensor.althermasensors', 'Pressure sensor') }}"
state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors STD Compressor 1"
unique_id: stdcompressor1
state: "{{ state_attr('sensor.althermasensors', 'STD Compressor 1') }}"
#state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Freeze Protection"
unique_id: freezeprotection
state: "{{ state_attr('sensor.althermasensors', 'Freeze Protection') }}"
#state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors Silent mode"
unique_id: silentmode
state: "{{ state_attr('sensor.althermasensors', 'Silent Mode') }}"
#ON OFF dus geen measurement?
#state_class: measurement
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors ESPAltherma last update"
unique_id: espalthermalastupdate
state: "{{ as_timestamp(states.sensor.althermasensors.last_updated) | timestamp_custom('%H:%M:%S',True) }}"
- name: "Althermasensors COP"
unique_id: cop
unit_of_measurement: "COP"
state_class: measurement
state: >-
{% if is_state_attr('sensor.althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF') %}
{% if states('sensor.althermasensors_inverter_usage') | float(0) < 90 %}
{% set cop = 0.0 | float(default=0) %}
{% elif states('sensor.althermasensors_inverter_usage') | float(0) > 90 %}
{% set t1 = states('sensor.althermasensors_water_leaving_temperature') | float(0) %}
{% set t2 = states('sensor.althermasensors_water_inlet_temperature') | float(0) %}
{% set f = states('sensor.althermasensors_flowpump') | float(0) %}
{% set pw = states('sensor.althermasensors_inverter_usage') | float(0) %}
{% set pwg = ((t1 - t2)*f) / 60 * 4184 | float(0) %}
{% set cop = pwg / pw | float(0) %}
{% endif %}
{{ cop | float(0) | round(1) }}
{% else %}
0.0
{% endif %}
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors COP with cooling"
unique_id: copcooling
unit_of_measurement: "COP"
state_class: measurement
state: >-
{% if is_state_attr('sensor.althermasensors','Operation Mode', 'Cooling') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF') %}
{% if states('sensor.althermasensors_inverter_usage') | float(0) < 90 %}
{% set cop = 0.0 | float(default=0) %}
{% elif states('sensor.althermasensors_inverter_usage') | float(0) > 90 %}
{% set t1 = states('sensor.althermasensors_water_leaving_temperature') | float(0) %}
{% set t2 = states('sensor.althermasensors_water_inlet_temperature') | float(0) %}
{% set f = states('sensor.althermasensors_flowpump') | float(0) %}
{% set pw = states('sensor.althermasensors_inverter_usage') | float(0) %}
{% set pwg = ((t1 - t2)*f) / 60 * 4184 | float(0) %}
{% set cop = pwg / pw | float(0) %}
{% endif %}
{{ cop | float(0) | round(1) }}
{% else %}
0.0
{% endif %}
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- name: "Althermasensors ∆T"
unique_id: deltat
unit_of_measurement: "°C"
state_class: measurement
## if else prevent dipping DT when warming DHW or not heating
state: >-
{% if is_state_attr('sensor.althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF') %}
{{ (states('sensor.althermasensors_water_leaving_temperature')|float(0) - states('sensor.althermasensors_water_inlet_temperature') | float(0))|round(1) }}
{% else %}
{{ (states('sensor.althermasensors_t')|float(0)) }}
## use previous value or use 0?
{% endif %}
availability: >
{{ states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
## {{ states('sensor.althermasensors_operation_mode') == 'Heating' and states('sensor.althermasensors') not in ['0', 'unavailable', 'unknown', 'none'] }}
- trigger:
- platform: numeric_state
entity_id: sensor.althermasensors_watertanktemperature
above: 55
sensor:
- name: "Althermasensors Desinfectie"
unique_id: desinfectie
state: >
{% if today_at('5:00') < now() < today_at('23:30') %}
{{ this.state }}
{% else %}
{{ now().strftime('%d-%m-%Y %H:%M') }}
{% endif %}
################################################
## Automation
################################################
automation:
- alias: "Warmtepomp - Pendel counter"
id: "warmtepomp_pendel_counter"
description: ""
trigger:
- platform: state
entity_id:
- sensor.althermasensors_inverter_current
to: "0"
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id:
- counter.pendel_counter
mode: single
- alias: "Warmtepomp - Defrost counter"
id: "warmtepomp_defrost_counter"
description: ""
trigger:
- platform: state
entity_id:
- sensor.althermasensors_defrost_operation
to: "ON"
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.defrost
mode: single
# - alias: "Warmtepomp - Google Sheets"
# id: "warmtepomp_google_sheets"
# description: ""
# trigger:
# - platform: state
# entity_id:
# - sensor.althermasensors_espaltherma_last_update
# condition: []
# action:
# - service: google_sheets.append_sheet
# data:
# config_entry: 9df3c895d3d971c61*snip*
# data:
# Date: "{{ now().strftime('%-d-%m-%Y') }}"
# Thermostat: "{{ states('sensor.althermasensors_thermostat') }}"
# Inverter usage: "{{ states('sensor.althermasensors_inverter_usage') }}"
# Setpoint: "{{ states('sensor.althermasensors_leaving_water_setpoint') }}"
# Water out: "{{ states('sensor.althermasensors_water_leaving_temperature') }}"
# Water in: "{{ states('sensor.althermasensors_water_inlet_temperature') }}"
# Flow: "{{ states('sensor.althermasensors_flowpump') }}"
# COP: "{{ states('sensor.althermasensors_cop') }}"
# Defrosts: "{{ states('counter.defrost') }}"
# worksheet: Daikin Warmtepomp Statistieken
# mode: single |