forked from Egyras/HeishaMon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheishamon.yaml
689 lines (616 loc) · 20.6 KB
/
heishamon.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
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
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
################################################################
## Packages / Heishamon
################################################################
################################################################
## Changelog
################################################################
##
## 1.0.0 (08-01-2020)
## Added
## - Initial version
##
## 1.1.0 (10-01-2020)
## Added
## - Added power switch and Fan RPM sensors
##
## 1.2.0 (17-05-2020)
## Fixed
## - New/changed topics
##
## 1.3.0 (22-06-2022)
## Compatibility with Home Assistant 2022.6 MQTT configuration format
##
## 1.4.0 (18-09-2022)
## Added
## - Split heatshift into separate Z1 and Z2
# Automations #
###############
automation:
#Fetches quiet level from status and sets the selector accordingly
- alias: Set quiet level selector
trigger:
platform: mqtt
topic: "panasonic_heat_pump/main/Quiet_Mode_Level"
action:
service: input_select.select_option
data_template:
entity_id: input_select.heishamon_quietmode
option: >-
{%- if trigger.payload == "0" -%}
Off
{%- else -%}
{{ trigger.payload }}
{%- endif -%}
#Sets quiet level to the selected value
- alias: Set quiet level
trigger:
platform: state
entity_id: input_select.heishamon_quietmode
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetQuietMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_quietmode') == "Off" -%}
0
{%- else -%}
{{ states('input_select.heishamon_quietmode') }}
{%- endif -%}
#Fetches powerful level from status and sets the selector accordingly
- alias: Set powerful level selector
trigger:
platform: mqtt
topic: "panasonic_heat_pump/main/Powerful_Mode_Time"
action:
service: input_select.select_option
data_template:
entity_id: input_select.heishamon_powermode
option: >-
{%- if trigger.payload == "0" -%}
Off
{%- else -%}
{{ (trigger.payload | int) * 30 }} min
{%- endif -%}
#Sets powerful level to the selected value
- alias: Set powerful level
trigger:
platform: state
entity_id: input_select.heishamon_powermode
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetPowerfulMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_powermode') == "Off" -%}
0
{%- else -%}
{{ "%.0f" % ((states('input_select.heishamon_powermode') | replace("min", "") | int) / 30) }}
{%- endif -%}
#Fetches heatmode from status and sets the selector accordingly
- alias: Set heatmode selector
trigger:
platform: mqtt
topic: "panasonic_heat_pump/main/Operating_Mode_State"
action:
service: input_select.select_option
data_template:
entity_id: input_select.heishamon_heatmode
option: >-
{%- if trigger.payload == "0" -%}
Heat
{%- elif trigger.payload == "3" -%}
DHW
{%- elif trigger.payload == "4" -%}
Heat+DHW
{%- endif -%}
#Sets heatmode to the selected value
- alias: Set heatmode
trigger:
platform: state
entity_id: input_select.heishamon_heatmode
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetOperationMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_heatmode') == "Heat" -%}
0
{%- elif states('input_select.heishamon_heatmode') == "DHW" -%}
3
{%- elif states('input_select.heishamon_heatmode') == "Heat+DHW" -%}
4
{%- endif -%}
#Fetches Z1 temperature from status and sets the selector accordingly
- alias: Set Z1 selector
trigger:
platform: mqtt
topic: "panasonic_heat_pump/main/Z1_Heat_Request_Temp"
action:
service: input_number.set_value
data_template:
entity_id: input_number.heishamon_heatshift_z1
value: >-
{{ "%.1f" % (trigger.payload | int) }}
#Sets Z1 temperature to the selected value
- alias: Set Z1
trigger:
platform: state
entity_id: input_number.heishamon_heatshift_z1
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetZ1HeatRequestTemperature
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_heatshift_z1') | int) }}
#Fetches Z2 temperature from status and sets the selector accordingly
- alias: Set Z2 selector
trigger:
platform: mqtt
topic: "panasonic_heat_pump/main/Z2_Heat_Request_Temp"
action:
service: input_number.set_value
data_template:
entity_id: input_number.heishamon_heatshift_z2
value: >-
{{ "%.1f" % (trigger.payload | int) }}
#Sets Z2 temperature to the selected value
- alias: Set Z2
trigger:
platform: state
entity_id: input_number.heishamon_heatshift_z2
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetZ2HeatRequestTemperature
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_heatshift_z2') | int) }}
#Fetches tank target temperature from status and sets the selector accordingly
- alias: Set tank target temperature selector
trigger:
platform: mqtt
topic: "panasonic_heat_pump/main/DHW_Target_Temp"
action:
service: input_number.set_value
data_template:
entity_id: input_number.heishamon_tank_temp
value: >-
{{ "%.1f" % (trigger.payload | int) }}
#Sets tank target temperature to the selected value
- alias: Set tank target temperature
trigger:
platform: state
entity_id: input_number.heishamon_tank_temp
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetDHWTemp
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_tank_temp') | int) }}
# input_number #
################
input_number:
heishamon_tank_temp:
name: Set Tank Temperature
min: 40
max: 75
step: 1
heishamon_heatshift_z1:
name: Set Zone 1 Temperature
min: -5
max: 40
step: 1
heishamon_heatshift_z2:
name: Set Zone 2 Temperature
min: -5
max: 40
step: 1
# input_select #
################
input_select:
heishamon_quietmode:
name: Set Quiet Mode
options:
- "Off"
- "1"
- "2"
- "3"
heishamon_powermode:
name: Set Powerful Mode
options:
- "Off"
- 30 min
- 60 min
- 90 min
heishamon_heatmode:
name: Set Heat Mode
options:
- Heat+DHW
- Heat
- DHW
# sensor #
##########
mqtt:
sensor:
#TOP0 - Power state
- name: Aquarea Power State
state_topic: "panasonic_heat_pump/main/Heatpump_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP1 - Pumpflow
- name: Aquarea Pump Flow
state_topic: "panasonic_heat_pump/main/Pump_Flow"
unit_of_measurement: "L/min"
state_class: "measurement"
#TOP2 - Force DHW
- name: Aquarea Force DHW Mode
state_topic: "panasonic_heat_pump/main/Force_DHW_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP4 - Heat mode (Hot water, Heat or Hot water + heat)
- name: Aquarea Mode
state_topic: "panasonic_heat_pump/main/Operating_Mode_State"
value_template: >-
{%- if value == "0" -%}
Heat
{%- elif value == "1" -%}
Cool
{%- elif value == "2" -%}
Auto
{%- elif value == "3" -%}
DHW
{%- elif value == "4" -%}
Heat+DHW
{%- elif value == "5" -%}
Cool+DHW
{%- elif value == "6" -%}
Auto+DHW
{%- endif -%}
#TOP5 - Water inlet temp
- name: Aquarea Inlet Temperature
state_topic: "panasonic_heat_pump/main/Main_Inlet_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP6 - Water outlet temp
- name: Aquarea Outlet Temperature
state_topic: "panasonic_heat_pump/main/Main_Outlet_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP7 - Water outlet target temp
- name: Aquarea Outlet Target Temperature
state_topic: "panasonic_heat_pump/main/Main_Target_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP8 - Compressor frequency
- name: Aquarea Compressor Frequency
state_topic: "panasonic_heat_pump/main/Compressor_Freq"
unit_of_measurement: "Hz"
state_class: "measurement"
#TOP9 - Tank set temperature
- name: Aquarea Tank Set Temperature
state_topic: "panasonic_heat_pump/main/DHW_Target_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP10 - Tank current temperature
- name: Aquarea Actual Tank Temperature
state_topic: "panasonic_heat_pump/main/DHW_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP11 - Compressor Operating Time
- name: Aquarea Compressor Operating Hours
state_topic: "panasonic_heat_pump/main/Operations_Hours"
unit_of_measurement: "Hours"
# state_class: total
state_class: "measurement"
#TOP12 - Compressor On/Off cycle number
- name: Aquarea Compressor Start/Stop Counter
state_topic: "panasonic_heat_pump/main/Operations_Counter"
# state_class: total
state_class: "measurement"
#TOP14 - Outdoor unit ambient temperature
- name: Aquarea Outdoor Ambient
state_topic: "panasonic_heat_pump/main/Outside_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
# state_class: "measurement"
#TOP15 - Heating power produced
- name: Aquarea Power Produced
state_topic: "panasonic_heat_pump/main/Heat_Energy_Production"
unit_of_measurement: "W"
device_class: "power"
state_class: "measurement"
force_update: true
#TOP16 - Heating power consumed
- name: Aquarea Power Consumed
state_topic: "panasonic_heat_pump/main/Heat_Energy_Consumption"
unit_of_measurement: "W"
device_class: "power"
state_class: "measurement"
force_update: true
#TOP17 - Heating powerful mode
- name: Aquarea Powerful Mode
state_topic: "panasonic_heat_pump/main/Powerful_Mode_Time"
unit_of_measurement: "Min"
value_template: >-
{{ (value | int) * 30 }}
#TOP18 - Heating quiet mode
- name: Aquarea Quiet Mode
state_topic: "panasonic_heat_pump/main/Quiet_Mode_Level"
value_template: >-
{%- if value == "4" -%}
Scheduled
{%- elif value == "0" -%}
Off
{%- else -%}
{{ value }}
{%- endif -%}
#TOP19 - Holiday Mode
- name: Aquarea Holiday Mode
state_topic: "panasonic_heat_pump/main/Holiday_Mode_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP20 - 3-way valve state
- name: Aquarea 3-way Valve
state_topic: "panasonic_heat_pump/main/ThreeWay_Valve_State"
value_template: >-
{%- if value == "0" -%}
Room
{%- elif value == "1" -%}
Tank
{%- endif -%}
#TOP21 - Outside pipe temp
- name: Aquarea Outdoor Pipe Temperature
state_topic: "panasonic_heat_pump/main/Outside_Pipe_Temp"
unit_of_measurement: "°C"
#TOP26 - Defrost state
- name: Aquarea Defrost State
state_topic: "panasonic_heat_pump/main/Defrosting_State"
value_template: >-
{%- if value == "0" -%}
Inactive
{%- elif value == "1" -%}
Active
{%- endif -%}
#TOP27 - Heatshift Temperature
- name: Aquarea Heatshift Temperature
state_topic: "panasonic_heat_pump/main/Z1_Heat_Request_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP40 - DHW power produced
- name: Aquarea DHW Power Produced
state_topic: "panasonic_heat_pump/main/DHW_Energy_Production"
unit_of_measurement: "W"
device_class: "power"
state_class: "measurement"
force_update: true
#TOP41 - DHW power consumed
- name: Aquarea DHW Power Consumed
state_topic: "panasonic_heat_pump/main/DHW_Energy_Consumption"
unit_of_measurement: "W"
device_class: "power"
state_class: "measurement"
force_update: true
#TOP44 - Last active error
- name: Aquarea Last Error
state_topic: "panasonic_heat_pump/main/Error"
#TOP49 - Main HEX Outlet temp
- name: Aquarea Main HEX Outlet Temperature
state_topic: "panasonic_heat_pump/main/Main_Hex_Outlet_Temp"
unit_of_measurement: "°C"
#TOP50 - Discharge temp
- name: Aquarea Discharge Temperature
state_topic: "panasonic_heat_pump/main/Discharge_Temp"
unit_of_measurement: "°C"
#TOP51 - Inside Pipe temp
- name: Aquarea Inside Pipe Temperature
state_topic: "panasonic_heat_pump/main/Inside_Pipe_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP52 - Defrost temp
- name: Aquarea Defrost Temperature
state_topic: "panasonic_heat_pump/main/Defrost_Temp"
unit_of_measurement: "°C"
#TOP53 - Eva Outlet temp
- name: Aquarea Eva Outlet Temperature
state_topic: "panasonic_heat_pump/main/Eva_Outlet_Temp"
unit_of_measurement: "°C"
#TOP54 - Bypass Outlet temp
- name: Aquarea Bypass Outlet Temperature
state_topic: "panasonic_heat_pump/main/Bypass_Outlet_Temp"
unit_of_measurement: "°C"
state_class: "measurement"
#TOP55 - lpm temp
- name: Aquarea Ipm Temperature
state_topic: "panasonic_heat_pump/main/Ipm_Temp"
unit_of_measurement: "°C"
#TOP58 - Tank electric heater allowed state
- name: Aquarea Tank Heater Enabled
state_topic: "panasonic_heat_pump/main/DHW_Heater_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP59 - Water electric heater allowed state
- name: Aquarea Room Heater Enabled
state_topic: "panasonic_heat_pump/main/Room_Heater_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP60 - Internal heater state
- name: Aquarea Internal Heater State
state_topic: "panasonic_heat_pump/main/Internal_Heater_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP61 - External heater state
- name: Aquarea External Heater State
state_topic: "panasonic_heat_pump/main/External_Heater_State"
value_template: >-
{%- if value == "0" -%}
Off
{%- elif value == "1" -%}
On
{%- endif -%}
#TOP62 - Fan1 speed
- name: Aquarea Fan 1 Speed
state_topic: "panasonic_heat_pump/main/Fan1_Motor_Speed"
unit_of_measurement: "R/min"
state_class: "measurement"
#TOP63 - Fan2 speed
- name: Aquarea Fan 2 Speed
state_topic: "panasonic_heat_pump/main/Fan2_Motor_Speed"
unit_of_measurement: "R/min"
state_class: "measurement"
#TOP64 - High pressure
- name: Aquarea High pressure
state_topic: "panasonic_heat_pump/main/High_Pressure"
unit_of_measurement: "Kgf/cm2"
state_class: "measurement"
#TOP65 - Pump speed
- name: Aquarea Pump Speed
state_topic: "panasonic_heat_pump/main/Pump_Speed"
unit_of_measurement: "R/min"
state_class: "measurement"
#TOP66 - Low pressure
- name: Aquarea Low pressure
state_topic: "panasonic_heat_pump/main/Low_Pressure"
unit_of_measurement: "Kgf/cm2"
state_class: "measurement"
#TOP67 - Compressor Current
- name: Aquarea Compressor Current
state_topic: "panasonic_heat_pump/main/Compressor_Current"
unit_of_measurement: "A"
state_class: "measurement"
##1-Wire - Example, replace with correct sensor ID
#- name: 1-wire sensor temperature
# state_topic: "panasonic_heat_pump/1wire/1234567890abcdef"
# unit_of_measurement: '°C'
# value_template: '{{value | round(1) }}'
# The following S0 topics are only available if S0 is enabled.
#
#S0 kWh Meter 1 - Assumed to measure the heat pump consumption
- name: Aquarea Metered Power Consumption
state_topic: "panasonic_heat_pump/s0/Watt/1"
unit_of_measurement: "W"
state_class: "measurement"
- name: Aquarea Metered Power Consumption Total
state_topic: "panasonic_heat_pump/s0/WatthourTotal/1"
unit_of_measurement: "kWh"
value_template: >-
{{ (value | int) / 1000}}
state_class: "measurement"
#S0 kWh Meter 2 - Assumed to measure the backup heater consumption
- name: Aquarea Metered Backup Heater Power Consumption
state_topic: "panasonic_heat_pump/s0/Watt/2"
unit_of_measurement: "W"
state_class: "measurement"
- name: Aquarea Metered Backup Heater Power Consumption Total
state_topic: "panasonic_heat_pump/s0/WatthourTotal/2"
unit_of_measurement: "kWh"
value_template: >-
{{ (value | int) / 1000}}
state_class: "measurement"
# switch #
##########
switch:
#Turn on/off holiday mode
- name: Aquarea Holiday Mode
command_topic: "panasonic_heat_pump/commands/SetHolidayMode"
state_topic: "panasonic_heat_pump/main/Holiday_Mode_State"
qos: 0
payload_on: "1"
payload_off: "0"
retain: false
#Turn on/off heatpump
- name: Aquarea Main Power
command_topic: "panasonic_heat_pump/commands/SetHeatpump"
state_topic: "panasonic_heat_pump/main/Heatpump_State"
qos: 0
payload_on: "1"
payload_off: "0"
retain: false
- name: Aquarea Force DHW Mode
command_topic: "panasonic_heat_pump/commands/SetForceDHW"
state_topic: "panasonic_heat_pump/main/Force_DHW_State"
qos: 0
payload_on: "1"
payload_off: "0"
retain: false
sensor:
#### SENSORS BELOW ARE NOT IN FIRMWARE ####
#Energy use/production
- platform: template
sensors:
heishamon_w_production:
friendly_name: "Aquarea Energy Production"
unit_of_measurement: "W"
value_template: >-
{%- if states('sensor.aquarea_dhw_power_produced') != "0" -%}
{{ states('sensor.aquarea_dhw_power_produced') }}
{%- else -%}
{{ states('sensor.aquarea_power_produced') }}
{%- endif -%}
heishamon_w_consumption:
friendly_name: "Aquarea Energy Consumption"
unit_of_measurement: "W"
value_template: >-
{%- if states('sensor.aquarea_dhw_power_consumed') != "0" -%}
{{ states('sensor.aquarea_dhw_power_consumed') }}
{%- else -%}
{{ states('sensor.aquarea_power_consumed') }}
{%- endif -%}
#COP Calculations
- platform: template
sensors:
heishamon_cop:
friendly_name: "Aquarea COP"
unit_of_measurement: "x"
value_template: >-
{%- if states('sensor.heishamon_w_consumption') | float(0) > 0 -%}
{{ '%0.1f' % ((states('sensor.heishamon_w_production') | float ) / (states('sensor.heishamon_w_consumption') | float )) }}
{%- else -%}
0.0
{%- endif -%}
availability_template: >-
{%- if is_number(states('sensor.heishamon_w_consumption')) and is_number(states('sensor.heishamon_w_production')) %}
true
{%- else %}
false
{%- endif %}
#Calculation Energy consumed (kWh) - DHW
- platform: integration
source: sensor.aquarea_dhw_power_consumed
name: Aquarea DHW Energy Consumed
unit_prefix: k
method: left
#Calculation Energy consumed (kWh) - Heat
- platform: integration
source: sensor.aquarea_power_consumed
name: Aquarea Heat Energy Consumed
unit_prefix: k
method: left