-
Notifications
You must be signed in to change notification settings - Fork 1
/
sensor_node.conf
1440 lines (1232 loc) · 55.8 KB
/
sensor_node.conf
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
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
esphome:
name: esp-sensor-node-hzg
platform: ESP32
board: esp32dev
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "<password>"
# Service to pull individual can message from home assistant
services:
- service: pull_canmsg
variables:
idx: int
addr: int
val: int
then:
- lambda: |-
int getA = static_cast<int>(addr); //Adresse in Byte 0 u. 1 schreiben
id(sh_state)[0]=getA>>8;
id(sh_state)[1]=getA-((getA>>8)<<8);
getA = static_cast<int>(idx); //Elster-Index übernehmen
//Wenn Elster-Index <= 0xff => an Byte-Stelle 2 schreiben
if( (getA>>8) == 0x00) {
id(sh_state)[2]=getA-((getA>>8)<<8);
getA = static_cast<int>(val); //Datenwert übernehmen und an Stelle 3 u. 4 schreiben, 5 u. 6 ist 0x00
id(sh_state)[3]=getA>>8;
id(sh_state)[4]=getA-((getA>>8)<<8);
id(sh_state)[5]=0x00;
id(sh_state)[6]=0x00;
}
else {
//Wenn Elster-Index > 0xff kommt 0xfa an Stelle 2, der Index steht dann an Stelle 3 u. 4
id(sh_state)[2]=0xfa;
id(sh_state)[3]=getA>>8;
id(sh_state)[4]=getA-((getA>>8)<<8);
getA = static_cast<int>(val); //der Datenwert steht dann an Stelle 5 u. 6
id(sh_state)[5]=getA>>8;
id(sh_state)[6]=getA-((getA>>8)<<8);
}
ota:
password: "<password>"
wifi:
ssid: "<ssid>"
password: "<wifi-password>"
use_address: <ip-address>
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "<fallback_ssid>"
password: "<fallback_password>"
captive_portal:
globals:
#################################################################
#Stiebel Eltron WPF-07 Cool 2018
#WPM3i software version 391-08
#FEK software version 416 - 02
#################################################################
#CAN ID 180: read - 3100, write - 3000
#CAN ID 301: read - 0c01, FEK-device (no active can request, only listening)
#
#other addresses
# 180 read: 3100 write: 3000
# 301 read: 6101 write: 6001
# 480 read: 9100 write: 9000 WMPme Wärmepumpenmanager
# 601 read: C101 write: C001
# 680 confirmation: D200
#################################################################
#change this IDs if required
#CAN read address for heat pump manager
- id: PumpCANread_id
type: int[2]
initial_value: '{0x31, 0x00}'
restore_value: no
#CAN write adress for heat pump manager
- id: PumpCANwrite_id
type: int[2]
initial_value: '{0x30, 0x00}'
restore_value: no
#CAN_ID of FEK
- id: FekCANread_id
type: int[2]
initial_value: '{0xc0, 0x01}'
restore_value: no
#CAN ID of esp-home device is set to 680 here, change this if you have to change the CAN-id
#Don't forget to also change the CAN-ID below
- id: internalResponse_id
type: int[2]
initial_value: '{0xd2, 0x00}'
restore_value: no
################################################################
#Array declaration to send CAN-Bus message from homeassistant
- id: sh_state
type: int[7]
initial_value: '{0x00,0x00,0x00,0x00,0x00,0x00,0x00}'
restore_value: no
#Array declaration to send CAN-Bus message from programcode
- id: send_state
type: int[7]
initial_value: '{0x00,0x00,0x00,0x00,0x00,0x00,0x00}'
restore_value: no
#declaration of sensor variables
- id: el_aufnahmeleistung_ww_tag_wh_float
type: float
restore_value: no
- id: el_aufnahmeleistung_ww_tag_wh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_ww_tag_kwh
type: float
restore_value: no
- id: el_aufnahmeleistung_ww_tag_kwh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_heiz_tag_wh_float
type: float
restore_value: no
- id: el_aufnahmeleistung_heiz_tag_wh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_heiz_tag_kwh
type: float
restore_value: no
- id: el_aufnahmeleistung_heiz_tag_kwh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_ww_total_kWh_float
type: float
restore_value: no
- id: el_aufnahmeleistung_ww_total_kWh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_ww_total_mWh
type: float
restore_value: no
- id: el_aufnahmeleistung_ww_total_mWh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_heiz_total_kWh_float
type: float
restore_value: no
- id: el_aufnahmeleistung_heiz_total_kWh_flag
type: bool
restore_value: no
- id: el_aufnahmeleistung_heiz_total_mWh
type: float
restore_value: no
- id: volumenstrom_float
type: float
restore_value: no
- id: el_aufnahmeleistung_heiz_total_mWh_flag
type: bool
restore_value: no
- id: VD_starts_h
type: int
initial_value: '0'
restore_value: no
- id: VD_starts_t
initial_value: '0'
type: float
restore_value: no
- id: waermemertrag_ww_tag_wh_float
type: float
restore_value: no
- id: waermemertrag_ww_tag_wh_flag
type: bool
restore_value: no
- id: waermemertrag_ww_tag_kwh
type: float
restore_value: no
- id: waermemertrag_ww_tag_kwh_flag
type: bool
- id: waermemertrag_electr_ww_tag_wh_float
type: float
restore_value: no
- id: waermemertrag_electr_ww_tag_wh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_ww_tag_kwh
type: float
restore_value: no
- id: waermemertrag_electr_ww_tag_kwh_flag
type: bool
restore_value: no
- id: waermemertrag_heiz_tag_wh_float
type: float
restore_value: no
- id: waermemertrag_heiz_tag_wh_flag
type: bool
restore_value: no
- id: waermemertrag_heiz_tag_kwh
type: float
restore_value: no
- id: waermemertrag_heiz_tag_kwh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_heiz_tag_wh_float
type: float
restore_value: no
- id: waermemertrag_electr_heiz_tag_wh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_heiz_tag_kwh
type: float
restore_value: no
- id: waermemertrag_electr_heiz_tag_kwh_flag
type: bool
restore_value: no
- id: waermemertrag_ww_total_kWh_float
type: float
restore_value: no
- id: waermemertrag_ww_total_kWh_flag
type: bool
restore_value: no
- id: waermemertrag_ww_total_mWh
type: float
restore_value: no
- id: waermemertrag_ww_total_mWh_flag
type: bool
restore_value: no
- id: waermemertrag_heiz_total_kWh_float
type: float
restore_value: no
- id: waermemertrag_heiz_total_kWh_flag
type: bool
restore_value: no
- id: waermemertrag_heiz_total_mWh
type: float
restore_value: no
- id: waermemertrag_heiz_total_mWh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_heiz_total_kWh_float
type: float
restore_value: no
- id: waermemertrag_electr_heiz_total_kWh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_heiz_total_mWh
type: float
restore_value: no
- id: waermemertrag_electr_heiz_total_mWh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_ww_total_kWh_float
type: float
restore_value: no
- id: waermemertrag_electr_ww_total_kWh_flag
type: bool
restore_value: no
- id: waermemertrag_electr_ww_total_mWh
type: float
restore_value: no
- id: waermemertrag_electr_ww_total_mWh_flag
type: bool
restore_value: no
#request of sensor state by executing lambda-commands. send_state is set to the request-packet. After that update_sensor is activated which sends the command via CAN and gets inactive again
#Abfrage des Sensorstatus durch Ausführen des Lambda-Befehls. send_state wird auf das request-Paket gesetzt. Anschließend wird Update_sensor aktiviert, der den Befehl via CAN absetzt und wieder deaktiviert
#Outside temperature
sensor:
- platform: template
name: "Außentemperatur"
id: temperature_outside
unit_of_measurement: "°C"
icon: "mdi:thermometer-lines"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x00;id(send_state)[4]=0x0c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 10min
#Source temperature
- platform: template
name: "Quellentemperatur"
id: temperature_source
unit_of_measurement: "°C"
icon: "mdi:thermometer-lines"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x01;id(send_state)[4]=0xd4;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 10min
- platform: template
name: "Warmwassertemperatur"
id: temperature_water
unit_of_measurement: "°C"
icon: "mdi:thermometer-lines"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0x0e;id(send_state)[3]=0x01;id(send_state)[4]=0x00;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 10min
- platform: template
name: "Verdichterstarts"
id: VD_starts
unit_of_measurement: "a.u."
icon: "mdi:chart-bell-curve-cumulative"
device_class: "power_factor"
state_class: "measurement"
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x07;id(send_state)[4]=0x1c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x07;id(send_state)[4]=0x1d;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(VD_starts_t>0) and id(VD_starts_h>0)){
float VD_starts_float = id(VD_starts_h)+id(VD_starts_t);
return VD_starts_float;
}
else {return {};}
update_interval: 5h
accuracy_decimals: 0
#Berechnung COP erfolgt über Sensoren für Stromverbrauch und Wärmeproduktion - kein aktiver Update-Befehl
- platform: template
name: "COP-Wert Heizung"
id: cop_heater
unit_of_measurement: "a.u."
icon: "mdi:chart-bell-curve-cumulative"
device_class: "power_factor"
state_class: "measurement"
accuracy_decimals: 2
lambda: |-
id(total_electric_energy_heating).update();
id(total_heating_energy).update();
id(total_electric_heating_energy).update();
float heat_cop_float = (id(waermemertrag_heiz_total_mWh)+id(waermemertrag_electr_heiz_total_mWh))/id(el_aufnahmeleistung_heiz_total_mWh);
return heat_cop_float;
force_update: true
- platform: template
name: "COP-Wert Warmwasser"
id: cop_water
unit_of_measurement: "a.u."
icon: "mdi:chart-bell-curve-cumulative"
device_class: "power_factor"
state_class: "measurement"
accuracy_decimals: 2
lambda: |-
id(total_heating_energy_water).update();
id(total_electric_energy_water).update();
id(total_heating_energy_water).update();
float ww_cop_float = (id(waermemertrag_ww_total_mWh)+id(waermemertrag_electr_ww_total_mWh))/id(el_aufnahmeleistung_ww_total_mWh);
return ww_cop_float;
force_update: true
- platform: template
name: "COP-Wert Gesamt"
id: cop_total
unit_of_measurement: "a.u."
icon: "mdi:chart-bell-curve-cumulative"
device_class: "power_factor"
state_class: "measurement"
accuracy_decimals: 2
lambda: |-
id(cop_water).update();
id(cop_heater).update();
float total_cop_float = ((id(waermemertrag_heiz_total_mWh)+id(waermemertrag_electr_heiz_total_mWh))+(id(waermemertrag_ww_total_mWh)+id(waermemertrag_electr_ww_total_mWh)))/(id(el_aufnahmeleistung_heiz_total_mWh)+id(el_aufnahmeleistung_ww_total_mWh));
return total_cop_float;
force_update: true
update_interval: 6h
- platform: template
name: "Rücklauftemperatur Heizung"
id: temperature_return
unit_of_measurement: "°C"
icon: "mdi:waves-arrow-left"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x00;id(send_state)[4]=0x16;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 5min
- platform: template
name: "T Heizkreis IST"
id: t_heizkreis_ist
unit_of_measurement: "°C"
icon: "mdi:waves-arrow-right"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x02;id(send_state)[4]=0xca;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 5min
- platform: template
name: "T Heizkreis Soll"
id: t_heizkreis_soll
unit_of_measurement: "°C"
icon: "mdi:waves-arrow-left"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x01;id(send_state)[4]=0xd7;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 15min
- platform: template
name: "Speicher Soll Temperatur"
id: t_ww_soll
unit_of_measurement: "°C"
icon: "mdi:thermometer-water"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0x03;id(send_state)[3]=0x00;id(send_state)[4]=0x00;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 15min
- platform: template
name: "Speicher IST Temperatur"
id: t_ww_ist
unit_of_measurement: "°C"
icon: "mdi:thermometer-lines"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
- platform: template
name: "Eco Speicher Soll Temperatur"
id: ww_temp_eco_log
unit_of_measurement: "°C"
icon: "mdi:thermometer-low"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x0a;id(send_state)[4]=0x06;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 10min
- platform: template
name: "Komfort Speicher Soll Temperatur"
id: ww_temp_komfort_log
unit_of_measurement: "°C"
icon: "mdi:thermometer-high"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0x13;id(send_state)[3]=0x00;id(send_state)[4]=0x00;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 10min
- platform: template
name: "Volumenstrom"
id: volumenstrom_log
unit_of_measurement: "l/min"
icon: "mdi:waves-arrow-right"
state_class: "measurement"
accuracy_decimals: 2
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x06;id(send_state)[4]=0x73;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 1min
- platform: template
name: "Heizungsdruck"
id: heizungsdruck_log
unit_of_measurement: "bar"
icon: "mdi:gauge"
device_class: "pressure"
state_class: "measurement"
accuracy_decimals: 2
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x06;id(send_state)[4]=0x74;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
return {};
update_interval: 7min
- platform: template
name: "Puffertemperatur"
id: puffertemperatur_log
unit_of_measurement: "°C"
icon: "mdi:thermometer-high"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
#Automatische Updates durch FEK
- platform: template
name: "Luftfeuchtigkeit Wohnraum"
id: humidity_inside
unit_of_measurement: "%rH"
icon: "mdi:water-percent"
device_class: "humidity"
state_class: "measurement"
accuracy_decimals: 1
- platform: template
name: "Temperatur Wohnraum"
id: temperature_inside
unit_of_measurement: "°C"
icon: "mdi:thermometer-lines"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
- platform: template
name: "Stromverbrauch Warmwasser heute"
id: daily_electric_energy_water
unit_of_measurement: "kWh"
device_class: "energy"
state_class: "measurement"
accuracy_decimals: 3
icon: "mdi:transmission-tower"
lambda: |-
//el. Leistungsaufnahme WW Tag Wh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1a;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//el. Leistungsaufnahme WW Tag kWh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1b;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(el_aufnahmeleistung_ww_tag_kwh_flag) and id(el_aufnahmeleistung_ww_tag_wh_flag)){
id(el_aufnahmeleistung_ww_tag_kwh) += id(el_aufnahmeleistung_ww_tag_wh_float);
float daily_electric_energy_water=id(el_aufnahmeleistung_ww_tag_kwh);
id(el_aufnahmeleistung_ww_tag_kwh_flag)=false;
id(el_aufnahmeleistung_ww_tag_wh_flag)=false;
return daily_electric_energy_water;
}
else{return {};}
update_interval: 15min
- platform: template
name: "WM Heizung heute"
id: daily_heating_energy
unit_of_measurement: "kWh"
device_class: "energy"
icon: "mdi:water-boiler"
state_class: "measurement"
accuracy_decimals: 3
lambda: |-
//WM Heizen Tag wh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2e;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//WM Heizen Tag kwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2f;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(waermemertrag_heiz_tag_kwh_flag) and id(waermemertrag_heiz_tag_wh_flag)){
id(waermemertrag_heiz_tag_kwh) += id(waermemertrag_heiz_tag_wh_float);
float daily_heating_energy=id(waermemertrag_heiz_tag_kwh);
id(waermemertrag_heiz_tag_kwh_flag)=false;
id(waermemertrag_heiz_tag_wh_flag)=false;
return daily_heating_energy;
}
else {
return {};
}
update_interval: 15min
- platform: template
name: "Stromverbrauch Heizung heute"
id: daily_electric_energy_heating
unit_of_measurement: "kWh"
device_class: "energy"
state_class: "measurement"
icon: "mdi:transmission-tower"
accuracy_decimals: 3
lambda: |-
//el. Leistungsaufnahme Heizen Tag Wh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1e;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//el. Leistungsaufnahme Heizen Tag kWh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1f;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(el_aufnahmeleistung_heiz_tag_kwh_flag) and id(el_aufnahmeleistung_heiz_tag_wh_flag)){
id(el_aufnahmeleistung_heiz_tag_kwh) += id(el_aufnahmeleistung_heiz_tag_wh_float);
float daily_electric_energy_heating=id(el_aufnahmeleistung_heiz_tag_kwh);
id(el_aufnahmeleistung_heiz_tag_kwh_flag)=false;
id(el_aufnahmeleistung_heiz_tag_wh_flag)=false;
return daily_electric_energy_heating;
}
else{return {};}
update_interval: 6h
- platform: template
name: "WM Warmwasser heute"
id: daily_heating_energy_water
unit_of_measurement: "kWh"
device_class: "energy"
icon: "mdi:water-boiler"
state_class: "measurement"
accuracy_decimals: 3
lambda: |-
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2a;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2b;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(waermemertrag_ww_tag_kwh_flag) and id(waermemertrag_ww_tag_wh_flag)){
id(waermemertrag_ww_tag_kwh) += id(waermemertrag_ww_tag_wh_float);
float daily_heating_energy_water=id(waermemertrag_ww_tag_kwh);
id(waermemertrag_ww_tag_kwh_flag)=false;
id(waermemertrag_ww_tag_wh_flag)=false;
return daily_heating_energy_water;
}
else{ return {};
}
update_interval: 15min
- platform: template
name: "Stromverbrauch Warmwasser total"
id: total_electric_energy_water
unit_of_measurement: "MWh"
device_class: "energy"
state_class: "total_increasing"
icon: "mdi:transmission-tower"
accuracy_decimals: 3
lambda: |-
//el. Leistungsaufnahme WW Summe kwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//el. Leistungsaufnahme WW Summe Mwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1d;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(el_aufnahmeleistung_ww_total_mWh_flag) and id(el_aufnahmeleistung_ww_total_kWh_flag)){
id(el_aufnahmeleistung_ww_total_mWh) += id(el_aufnahmeleistung_ww_total_kWh_float);
float total_electric_energy_water=id(el_aufnahmeleistung_ww_total_mWh);
id(el_aufnahmeleistung_ww_total_mWh_flag)=false;
id(el_aufnahmeleistung_ww_total_kWh_flag)=false;
return total_electric_energy_water;
}
else { return {};}
- platform: template
name: "Stromverbrauch Heizung total"
id: total_electric_energy_heating
unit_of_measurement: "MWh"
device_class: "energy"
icon: "mdi:transmission-tower"
state_class: "total_increasing"
accuracy_decimals: 3
lambda: |-
//el. Leistungsaufnahme Heizen Summe kwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x20;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//el. Leistungsaufnahme Heizen Summe Mwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x21;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
if (id(el_aufnahmeleistung_heiz_total_mWh_flag) and id(el_aufnahmeleistung_heiz_total_kWh_flag)){
id(el_aufnahmeleistung_heiz_total_mWh) += id(el_aufnahmeleistung_heiz_total_kWh_float);
float total_electric_energy_heating=id(el_aufnahmeleistung_heiz_total_mWh);
id(el_aufnahmeleistung_heiz_total_mWh_flag)=false;
id(el_aufnahmeleistung_heiz_total_mWh_flag)=false;
return total_electric_energy_heating;
}
else {return {};
}
- platform: template
name: "WM Heizen total"
id: total_heating_energy
unit_of_measurement: "MWh"
device_class: "energy"
icon: "mdi:water-boiler"
state_class: "total_increasing"
accuracy_decimals: 3
lambda: |-
//WM Heizen Summe kwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x30;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//WM Heizen Summe Mwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x31;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//Überprüfung ob beide Leistungswerte empfangen wurden
if (id(waermemertrag_heiz_total_kWh_flag) and id(waermemertrag_heiz_total_mWh_flag)){
id(waermemertrag_heiz_total_mWh) += id(waermemertrag_heiz_total_kWh_float);
float total_heating_energy=id(waermemertrag_heiz_total_mWh);
id(waermemertrag_heiz_total_kWh_flag)=false;
id(waermemertrag_heiz_total_mWh_flag)=false;
return total_heating_energy;
}
else {
return {};
}
- platform: template
name: "WM Warmwasser total"
id: total_heating_energy_water
unit_of_measurement: "MWh"
device_class: "energy"
icon: "mdi:water-boiler"
state_class: "total_increasing"
accuracy_decimals: 3
lambda: |-
//WM WW Summe kwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//WM WW Summe Mwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2d;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//Überprüfung ob beide Leistungswerte empfangen wurden
if (id(waermemertrag_ww_total_mWh_flag) and id(waermemertrag_ww_total_kWh_flag)){
id(waermemertrag_ww_total_mWh) += id(waermemertrag_ww_total_kWh_float);
float total_heating_energy_water=id(waermemertrag_ww_total_mWh);
id(waermemertrag_ww_total_mWh_flag)=false;
id(waermemertrag_ww_total_kWh_flag)=false;
return total_heating_energy_water;
}
else {
return {};
}
- platform: template
name: "WM elektr. Warmwasser total"
id: total_electric_heating_energy_water
unit_of_measurement: "kWh"
device_class: "energy"
icon: "mdi:water-boiler"
state_class: "total_increasing"
accuracy_decimals: 3
lambda: |-
//WM NE WW Summe kwh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x24;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//WM NE WW Summe MWh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x25;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//Überprüfung ob beide Leistungswerte empfangen wurden
if (id(waermemertrag_electr_ww_total_mWh_flag) and id(waermemertrag_electr_ww_total_kWh_flag)){
id(waermemertrag_electr_ww_total_mWh) += id(waermemertrag_electr_ww_total_kWh_float);
float total_electric_heating_energy_water=id(waermemertrag_electr_ww_total_mWh);
id(waermemertrag_electr_ww_total_mWh_flag)=false;
id(waermemertrag_electr_ww_total_kWh_flag)=false;
return total_electric_heating_energy_water;
}
else {
return {};
}
- platform: template
name: "WM elektr. heizen total"
id: total_electric_heating_energy
unit_of_measurement: "kWh"
device_class: "energy"
icon: "mdi:water-boiler"
state_class: "total_increasing"
accuracy_decimals: 3
lambda: |-
//WM NE Heizen Summe kWh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x28;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//WM NE Heizen Summe MWh
id(send_state)[0]=id(PumpCANread_id)[0];id(send_state)[1]=id(PumpCANread_id)[1];id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x29;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
//Überprüfung ob beide Leistungswerte empfangen wurden
if (id(waermemertrag_electr_heiz_total_kWh_flag) and id(waermemertrag_electr_heiz_total_mWh_flag)){
id(waermemertrag_electr_heiz_total_mWh) += id(waermemertrag_electr_heiz_total_kWh_float);
float total_electric_heating_energy=id(waermemertrag_electr_heiz_total_mWh);
id(waermemertrag_electr_heiz_total_kWh_flag)=false;
id(waermemertrag_electr_heiz_total_mWh_flag)=false;
return total_electric_heating_energy;
}
else {
return {};
}
text_sensor:
#Text sensor to change comfort temperature of warm water for automation in homeassistant with photovoltaic
#Sensor zum verändern der Warmwasser-Komfort-Temperatur für Automatisierung mit PV-Anlage
- platform: homeassistant
name: "ww_komfort_temp"
entity_id: input_text.ww_komfort_temp
id: HASSeingabe_wwkomforttemp
filters:
- lambda: |-
int eingabe=atoi(x.c_str());
if (eingabe < 250 or eingabe > 600) {
//Einfache Abfrage der Temperatur durchführen, falls keine gültige Eingabe erfolgt ist
id(send_state)[0]=id(PumpCANread_id)[0];
id(send_state)[1]=id(PumpCANread_id)[1];
id(send_state)[2]=0x13;
id(send_state)[3]=0x00;
id(send_state)[4]=0x00;
id(send_state)[5]=0x00;
id(send_state)[6]=0x00;
return x;
} else {
//Wenn User-Eingabe gültig war, Daten für Übertragung an Heizung bereit machen
id(send_state)[0]=id(PumpCANwrite_id)[0];
id(send_state)[1]=id(PumpCANwrite_id)[1];
id(send_state)[2]=0x13;
id(send_state)[3]=eingabe>>8;
id(send_state)[4]=eingabe-((eingabe>>8)<<8);
id(send_state)[5]=0x00;
id(send_state)[6]=0x00;
return x;
}
on_value:
then:
- lambda: |-
//Daten senden
id(update_sensor).publish_state(true);
id(update_sensor).publish_state(false);
#Text sensor to change eco temperature of warm water for automation in homeassistant with photovoltaic
#Sensor zum verändern der Warmwasser-Eco-Temperatur für Automatisierung mit PV-Anlage
- platform: homeassistant
name: "ww_eco_temp"
entity_id: input_text.ww_eco_temp
id: HASSeingabe_wwecotemp
filters:
- lambda: |-
int eingabe=atoi(x.c_str());
if (eingabe < 250 or eingabe > 600) {
id(send_state)[0]=id(PumpCANread_id)[0];
id(send_state)[1]=id(PumpCANread_id)[0];
id(send_state)[2]=0xfa;
id(send_state)[3]=0x0a;
id(send_state)[4]=0x06;
id(send_state)[5]=0x00;
id(send_state)[6]=0x00;
return x;
} else {
id(send_state)[0]=id(PumpCANwrite_id)[0];
id(send_state)[1]=id(PumpCANwrite_id)[1];
id(send_state)[2]=0xfa;
id(send_state)[3]=0x0a;
id(send_state)[4]=0x06;
id(send_state)[5]=eingabe>>8;
id(send_state)[6]=eingabe-((eingabe>>8)<<8);
return x;
}
on_value: