-
Notifications
You must be signed in to change notification settings - Fork 57
/
datapointconfigurator.fn
executable file
·1816 lines (1639 loc) · 75.1 KB
/
datapointconfigurator.fn
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
function ::dcCreateTable()
{
object c2Obj = dom.GetObject( system.GetVar("cId") );
string sName = c2Obj.Name();
WriteLine('<table cellpadding="0" cellspacing="0" class="CLASS02500">');
if( iFavNamePosition == 1 )
{
WriteLine('<tr>');
WriteLine('<td class="CLASS02501">');
WriteLine('<div class="CLASS02502">' # sName # '</div>');
WriteLine('<td>');
WriteLine('</tr>');
WriteLine('<tr>');
WriteLine('<td class="CLASS02503"><div class="CLASS02504" style="visibility:hidden;"></div></td>');
WriteLine('</tr>');
WriteLine('<tr>');
WriteLine('<td id="dpc'#cId#'" class="CLASS02505">');
Call("/esp/datapointconfigurator.fn::dcCreate()");
WriteLine('</td>');
WriteLine('</tr>');
WriteLine('<tr>');
WriteLine('<td class="CLASS02503"><div class="CLASS02504" style="visibility:hidden;"></div></td>');
WriteLine('</tr>');
}
if( iFavNamePosition == 0 )
{
integer iLength = 9;
Call("/esp/datapointconfigurator.fn::StringCut()");
WriteLine('<tr>');
WriteLine('<td class="CLASS02507">');
WriteLine('<div class="CLASS02509">'#sName#'</div></td>');
WriteLine('<td id="dpc'#cId#'" class="CLASS02508">');
Call("/esp/datapointconfigurator.fn::dcCreate()");
WriteLine('</td>');
WriteLine('</tr>');
}
WriteLine('</table>');
}
! dcCreate()
! [cId]: idnumber, [iStatusOnly]: Controls (un)bedienbar
function ::dcCreate()
{
! Control Button Dimensions
integer ictCH = 0;
integer chnId = system.GetVar("cId");
boolean ctrlReqUpdate = false;
object cObj = dom.GetObject( system.GetVar("cId") );
if( cObj.IsTypeOf( OT_PROGRAM ) )
{
ictCH = 0;
ctrlReqUpdate = true;
string progId = cObj.ID();
string viewstatus = "";
Call("/esp/system.fn::writeProgCtrl()");
}
if( cObj.IsTypeOf( OT_DP ) )
{
ictCH = 0;
ctrlReqUpdate = true;
integer iVT = cObj.ValueType();
integer iST = cObj.ValueSubType();
boolean bLogic = ( (iVT==ivtBinary) && (iST==istBool) );
boolean bList = ( (iVT==ivtInteger) && (iST==istEnum) );
boolean bNumber = ( (iVT==ivtFloat) && (iST==istGeneric) );
boolean bAlarm = ( (iVT==ivtBinary) && (iST==istAlarm) );
boolean bString = ( (iVT==ivtString) && (iST==istChar8859));
boolean bSysVar = ( bLogic || bList || bNumber || bAlarm || bString);
if( bSysVar )
{
WriteLine( '<table id="ctrl'#chnId#'tbl" cellspacing="0" class="ctrlTbl CLASS02510" border="0">' );
WriteLine( '<tr>' );
Call( "/esp/datapointconfigurator.fn::CreateSysVar()" );
WriteLine( '</tr>' );
WriteLine( '</table>' );
}
}
if( cObj.IsTypeOf( OT_CHANNEL ) )
{
var CN_ACCELERATION_TRANSCEIVER = "ACCELERATION_TRANSCEIVER.";
var CN_ACCESSPOINT_GENERIC_RECEIVER = "ACCESSPOINT_GENERIC_RECEIVER.";
var CN_ACCESS_RECEIVER = "ACCESS_RECEIVER.";
var CN_ACCESS_TRANSCEIVER = "ACCESS_TRANSCEIVER.";
var CN_ACOUSTIC_DISPLAY_RECEIVER = "ACOUSTIC_DISPLAY_RECEIVER.";
var CN_ACOUSTIC_SIGNAL_TRANSMITTER = "ACOUSTIC_SIGNAL_TRANSMITTER.";
var CN_ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER = "ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER.";
var CN_ALARM_SWITCH_VIRTUAL_RECEIVER = "ALARM_SWITCH_VIRTUAL_RECEIVER.";
var CN_ANALOG_INPUT = "ANALOG_INPUT.";
var CN_ARMING = "ARMING.";
var CN_BLIND = "BLIND.";
var CN_BLIND_TRANSMITTER = "BLIND_TRANSMITTER.";
var CN_BLIND_VIRTUAL_RECEIVER = "BLIND_VIRTUAL_RECEIVER.";
var CN_BRIGHTNESS_TRANSMITTER = "BRIGHTNESS_TRANSMITTER.";
var CN_BTN_SHORT_ONLY = "BTN_SHORT_ONLY.";
var CN_BUTTON = "BUTTON.";
var CN_CAPACITIVE_FILLING_SENSOR = "CAPACITIVE_FILLING_LEVEL_SENSOR.";
var CN_CARBON_DIOXIDE_RECEIVER = "CARBON_DIOXIDE_RECEIVER.";
var CN_CLIMATE_CONTROL_FLOOR_PUMP_TRANSCEIVER = "CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER.";
var CN_CLIMATE_CONTROL_FLOOR_TRANSCEIVER = "CLIMATECONTROL_FLOOR_TRANSCEIVER.";
var CN_CLIMATE_TRANSCEIVER = "CLIMATE_TRANSCEIVER.";
var CN_COLORTEMP = "COLORTEMP.";
var CN_COND_SWITCH_TRANSMITTER_TEMPERATURE = "COND_SWITCH_TRANSMITTER_TEMPERATURE.";
var CN_DANGER = "_DANGER.";
var CN_DIGITAL_ANALOG_OUTPUT = "DIGITAL_ANALOG_OUTPUT.";
var CN_DIGITAL_STATE = "DIGITAL_STATE.";
var CN_DIMMER = "DIMMER.";
var CN_DIMMER_REAL = "DIMMER_REAL.";
var CN_DOOR_LOCK_STATE_TRANSCEIVER = "DOOR_LOCK_STATE_TRANSCEIVER.";
var CN_DOOR_LOCK_STATE_TRANSMITTER = "DOOR_LOCK_STATE_TRANSMITTER.";
var CN_DOOR_OPENER = "DOOROPENER.";
var CN_DOOR_RECEIVER = "DOOR_RECEIVER.";
var CN_DOOR_SENSOR = "DOOR_SENSOR.";
var CN_DUAL_WHITE_BRIGHTNESS = "DUAL_WHITE_BRIGHTNESS";
var CN_DUAL_WHITE_COLOR = "DUAL_WHITE_COLOR";
var CN_GENERIC_INPUT_TRANSMITTER = "GENERIC_INPUT_TRANSMITTER.";
var CN_GENERIC_MEASURING_TRANSMITTER = "GENERIC_MEASURING_TRANSMITTER.";
var CN_HEATING_CONTROL = "HEATING_CONTROL.";
var CN_HEATING_CONTROL_HMIP = "HEATING_CONTROL_HMIP.";
var CN_HMIP_BUTTON = "BUTTON_NO_FUNCTION.";
var CN_IDENTIFICATION = "IDENTIFICATION.";
var CN_JALOUSIE = "JALOUSIE.";
var CN_LOCK = "LOCK.";
var CN_MAINTENANCE = "MAINTENANCE.";
var CN_MOTIONDETECTOR = "MOTIONDETECTOR_TRANSCEIVER.";
var CN_NONE = "NONE";
var CN_OPTICAL_SIGNAL_RECEIVER = "OPTICAL_SIGNAL_RECEIVER";
var CN_PDDT = "PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.";
var CN_POWERMETER = "POWERMETER.";
var CN_POWERMETER_IEC1 = "POWERMETER_IEC1.";
var CN_POWERMETER_IEC2 = "POWERMETER_IEC2.";
var CN_POWERMETER_IGL = "POWERMETER_IGL.";
var CN_POWERMETER_PSM = "POWERMETER_PSM.";
var CN_RC19_DISPLAY = "RC19_DISPLAY.";
var CN_RAIN_DETECTION_TRANSMITTER = "RAIN_DETECTION_TRANSMITTER.";
var CN_RGB_COLOR = "RGB_COLOR.";
var CN_RGBW_AUTOMATIC = "RGBW_AUTOMATIC.";
var CN_RGBW_COLOR = "RGBW_COLOR.";
var CN_RHS = "RHS.";
var CN_SERVO_TRANSMITTER = "SERVO_TRANSMITTER.";
var CN_SERVO_VIRTUAL_RECEIVER = "SERVO_VIRTUAL_RECEIVER.";
var CN_SHUTTER_TRANSMITTER = "SHUTTER_TRANSMITTER.";
var CN_SHUTTER_VIRTUAL_RECEIVER = "SHUTTER_VIRTUAL_RECEIVER.";
var CN_SIMPLE_SWITCH_RECEIVER = "SIMPLE_SWITCH_RECEIVER.";
var CN_SMOKE_DETECTOR = "SMOKE_DETECTOR.";
var CN_SWITCH = "SWITCH.";
var CN_SWITCH_TRANSM = "SWITCH_TRANSMITTER.";
var CN_TEMP_HUMIDITY_PARTICULATE_MATTER_TRANSMITTER = "TEMP_HUM_PARTICLE_MATTER_TRANSMITTER.";
var CN_THERMO = "TEMP.";
var CN_UNIVERSAL_LIGHT_RECEIVER = "UNIVERSAL_LIGHT_RECEIVER.";
var CN_WATER_DETECTION_TRANSMITTER = "WATER_DETECTION_TRANSMITTER.";
var CN_WEATHER_TRANSMIT = "WEATHER_TRANSMIT.";
var CN_WEEKLY_PROFILE = "WEEK_PROFILE.";
var CN_WIN_SC = "WIN_SC.";
var CN_WIN_SC_SECURE = "WIN_SC_SECURE.";
var CN_WIN_SC_SENSOR = "WIN_SC_SENSOR.";
var CN_WINDOW = "WINDOW.";
var CN_WINDOW_DRIVE_RECEIVER = "WINDOW_DRIVE_RECEIVER.";
var CN_EVENT_INTERFACE = "EVENT_INTERFACE.";
var CN_NOT_ACTIVE = "CHANNEL_NOT_ACTIVE";
var isInvisible = false;
var isKnownControl = false;
ctrlReqUpdate = true;
boolean bUnknown = true;
string sLastControlName = "";
string sControlName = "";
boolean bSV = false;
boolean bIsControl = false;
integer devFwMajor = 0;
integer devFwMinor = 0;
integer devFwPatch = 0;
Call("/esp/functions.fn::getFirmwareVersion()");
ictCH = cObj.ChannelType();
WriteLine("<table id='ctrl"#chnId#"tbl' class='ctrlTbl CLASS02520' border='0' >");
WriteLine("<tr>");
string sE;
string oEName;
string style = "-";
foreach( sE, cObj.DPs().EnumEnabledVisibleIDs() )
{
object oE = dom.GetObject( sE );
if( oE )
{
! WriteLine( "<script>console.log('oE.ID(): "#oE.ID()#"');</script>" );
sControlName = oE.MetaData("CONTROL");
if( sControlName )
{
object oDevice = dom.GetObject(cObj.Device());
object ch = dom.GetObject(chnId);
! WriteLine( "<script>conInfo('sControlName: "#sControlName#"');</script>" );
!#ACCELERATION_TRANSCEIVER
bIsControl = ( sControlName.Find(CN_ACCELERATION_TRANSCEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ACCELERATION_TRANSCEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ACCELERATION_TRANSCEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACCELERATION_TRANSCEIVER;
if (ch.Label() == "ELV-SH-TACO") {
Call("/esp/controls/acceleration_transceiver.fn::CreateAccelerationTransceiverTaco()");
} else {
Call("/esp/controls/acceleration_transceiver.fn::CreateAccelerationTransceiver()");
}
}
!#ACCESSPOINT_GENERIC_RECEIVER
bIsControl = ( sControlName.Find(CN_ACCESSPOINT_GENERIC_RECEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ACCESSPOINT_GENERIC_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ACCESSPOINT_GENERIC_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACCESSPOINT_GENERIC_RECEIVER;
Call("/esp/controls/accesspoint_generic_receiver.fn::CreateAccessPointGenericReceiver()");
}
!#ACCESS_RECEIVER
bIsControl = ( sControlName.Find(CN_ACCESS_RECEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ACCESS_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ACCESS_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACCESS_RECEIVER;
Call("/esp/controls/accessreceiver.fn::CreateAccessReceiver()");
}
!#ACCESS_TRANSCEIVER
bIsControl = ( sControlName.Find(CN_ACCESS_TRANSCEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ACCESS_TRANSCEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ACCESS_TRANSCEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACCESS_TRANSCEIVER;
Call("/esp/controls/accessreceiver.fn::CreateAccessTransceiver()");
}
!#ACOUSTIC_DISPLAY_RECEIVER
bIsControl = ( sControlName.Find(CN_ACOUSTIC_DISPLAY_RECEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ACOUSTIC_DISPLAY_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ACOUSTIC_DISPLAY_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACOUSTIC_DISPLAY_RECEIVER;
Call("/esp/controls/acoustic_display_receiver.fn::CreateAcousticDisplayReceiver()");
}
!# CN_ACOUSTIC_SIGNAL_TRANSMITTER
bIsControl = ( sControlName.Find(CN_ACOUSTIC_SIGNAL_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName != CN_ACOUSTIC_SIGNAL_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_ACOUSTIC_SIGNAL_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACOUSTIC_SIGNAL_TRANSMITTER;
Call("/esp/controls/acoustic_signal.fn::CreateAcousticSignalRealInfoControl()");
}
!# CN_ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER
bIsControl = ( sControlName.Find(CN_ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER;
Call("/esp/controls/acoustic_signal.fn::CreateAcousticSignalVirtualReceiver()");
}
!# CN_ALARM_SWITCH_VIRTUAL_RECEIVER - HmIP
bIsControl = ( sControlName.Find(CN_ALARM_SWITCH_VIRTUAL_RECEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_ALARM_SWITCH_VIRTUAL_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_ALARM_SWITCH_VIRTUAL_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ALARM_SWITCH_VIRTUAL_RECEIVER;
Call("/esp/controls/alarmsirene.fn::CreateAlarmSwitchVirtualReceiver()");
}
!#ANALOG_INPUT
bIsControl = ( sControlName.Find(CN_ANALOG_INPUT) > -1 );
if( bIsControl && (sLastControlName != CN_ANALOG_INPUT) )
{
WriteLine( "<script>conInfo('Control CN_ANALOG_INPUT found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ANALOG_INPUT;
Call("/esp/controls/analog_input.fn::CreateAnalogInputVoltage()");
}
!# CN_ARMING
bIsControl = ( sControlName.Find(CN_ARMING) > -1 );
if( bIsControl && (sLastControlName != CN_ARMING) )
{
WriteLine( "<script>conInfo('Control CN_ARMING found.');</script>" );
isKnownControl = true;
sLastControlName = CN_ARMING;
Call("/esp/controls/alarmsirene.fn::CreateAlarmArmingControl()");
}
!# BLIND
bIsControl = ( sControlName.Find(CN_BLIND) > -1 );
if( bIsControl && (sLastControlName!=CN_BLIND) )
{
WriteLine( "<script>conInfo('Control BLIND found.');</script>" );
isKnownControl = true;
sLastControlName = CN_BLIND;
Call("/esp/controls/blind.fn::CreateShutterActuator()");
}
!# CN_BLIND_TRANSMITTER
bIsControl = ( sControlName.Find(CN_BLIND_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName!=CN_BLIND_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control BLIND_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_BLIND_TRANSMITTER;
if ((ch.Label().Substr(0,6) != "HmIPW-") && (ch.Label() != "HmIP-DRBLI4") && (ch.Label() != "HmIP-BBL") && (ch.Label() != "HmIP-BBL-2") && (ch.Label() != "HmIP-FBL") && (ch.Label() != "HmIP-BBL-I")) {
Call("/esp/controls/blind.fn::CreateBlindTransmitter()");
} else {
object mode = dom.GetObject(ch.Address());
if (mode.MetaData("channelMode") == "shutter") {
Call("/esp/controls/blind.fn::CreateShutterTransmitter()");
} else {
Call("/esp/controls/blind.fn::CreateBlindTransmitter()");
}
}
}
!# CN_BLIND_VIRTUAL_RECEIVER
bIsControl = ( sControlName.Find(CN_BLIND_VIRTUAL_RECEIVER) > -1 );
if( bIsControl && (sLastControlName!=CN_BLIND_VIRTUAL_RECEIVER) )
{
WriteLine( "<script>conInfo('Control BLIND_VIRTUAL_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_BLIND_VIRTUAL_RECEIVER;
if ((ch.Label().Substr(0,6) != "HmIPW-") && (ch.Label() != "HmIP-DRBLI4") && (ch.Label() != "HmIP-BBL") && (ch.Label() != "HmIP-BBL-2") && (ch.Label() != "HmIP-FBL") && (ch.Label() != "HmIP-BBL-I")) {
Call("/esp/controls/blind.fn::CreateBlindVirtualReceiver()");
} else {
object mode = dom.GetObject(ch.Address());
if (mode.MetaData("channelMode") == "shutter") {
Call("/esp/controls/blind.fn::CreateShutterVirtualReceiver()");
} else {
Call("/esp/controls/blind.fn::CreateBlindVirtualReceiver()");
}
}
}
!# CN_BRIGHTNESS_TRANSMITTER - HmIP
bIsControl = ( sControlName.Find(CN_BRIGHTNESS_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName != CN_BRIGHTNESS_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_BRIGHTNESS_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_BRIGHTNESS_TRANSMITTER;
Call("/esp/controls/brightness_transmitter.fn::CreateBrightnessTransmitter()");
}
!# BTN
bIsControl = ( sControlName.Find(CN_BTN_SHORT_ONLY) > -1 );
if( bIsControl && (sLastControlName!=CN_BTN_SHORT_ONLY) )
{
WriteLine( "<script>conInfo('Control BTN_SHORT_ONLY found.');</script>" );
isKnownControl = true;
sLastControlName = CN_BTN_SHORT_ONLY;
Call("/esp/controls/button.fn::CreateKeyShortOnly()");
}
!# BUTTON
bIsControl = ( sControlName.Find(CN_BUTTON) > -1 );
if( bIsControl && (sLastControlName!=CN_BUTTON) )
{
WriteLine( "<script>conInfo('Control BUTTON found.');</script>" );
isKnownControl = true;
sLastControlName = CN_BUTTON;
Call("/esp/controls/button.fn::CreateKey()");
}
!# CAPACITIVE FILLING LEVEL SENSOR
bIsControl = ( sControlName.Find(CN_CAPACITIVE_FILLING_SENSOR) > -1 );
if( bIsControl && (sLastControlName!=CN_CAPACITIVE_FILLING_SENSOR) )
{
WriteLine( "<script>conInfo('Control CAPACITIVE_FILLING_SENSOR found.');</script>" );
isKnownControl = true;
sLastControlName = CN_CAPACITIVE_FILLING_SENSOR;
Call("/esp/controls/capacitive_filling_level_sensor.fn::CreateCapacitiveFillingSensor()");
}
!# CN_CARBON_DIOXIDE_RECEIVER
if (ch.Label() != "HmIPW-SCTHD") {
bIsControl = ( sControlName.Find(CN_CARBON_DIOXIDE_RECEIVER) > -1 );
if( bIsControl && (sLastControlName!=CN_CARBON_DIOXIDE_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CARBON_DIOXIDE_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_CARBON_DIOXIDE_RECEIVER;
Call("/esp/controls/weather_sensor.fn::CreateCarbonDioxideReceiver()");
}
}
!# CHANNEL_NOT_ACTIVE
bIsControl = ( sControlName.Find(CN_NOT_ACTIVE) > -1 );
if( bIsControl && (sLastControlName!=CN_NOT_ACTIVE) )
{
WriteLine( "<script>conInfo('Control CHANNEL_NOT_ACTIVE found.');</script>" );
isKnownControl = true;
sLastControlName = CN_NOT_ACTIVE;
Call("/esp/datapointconfigurator.fn::CreateChannelNotActive()");
}
!# CLIMATE_TRANSCEIVER
bIsControl = ( sControlName.Find(CN_CLIMATE_TRANSCEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_CLIMATE_TRANSCEIVER) )
{
WriteLine( "<script>conInfo('Control CN_CLIMATE_TRANSCEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_CLIMATE_TRANSCEIVER;
Call("/esp/controls/climate_transceiver.fn::CreateClimateTransceiver()");
}
!# CN_CLIMATE_CONTROL_FLOOR_PUMP_TRANSCEIVER - HmIP
bIsControl = ( sControlName.Find(CN_CLIMATE_CONTROL_FLOOR_PUMP_TRANSCEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_CLIMATE_CONTROL_FLOOR_PUMP_TRANSCEIVER) )
{
WriteLine( "<script>conInfo('Control CN_CLIMATE_CONTROL_FLOOR_PUMP_TRANSCEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_CLIMATE_CONTROL_FLOOR_PUMP_TRANSCEIVER;
Call("/esp/controls/climatecontrol_floor_transceiver.fn::CreateClimateControlFloorPumpTransceiver()");
}
!# CN_CLIMATE_CONTROL_FLOOR_TRANSCEIVER - HmIP
bIsControl = ( sControlName.Find(CN_CLIMATE_CONTROL_FLOOR_TRANSCEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_CLIMATE_CONTROL_FLOOR_TRANSCEIVER) )
{
WriteLine( "<script>conInfo('Control CN_CLIMATE_CONTROL_FLOOR_TRANSCEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_CLIMATE_CONTROL_FLOOR_TRANSCEIVER;
Call("/esp/controls/climatecontrol_floor_transceiver.fn::CreateClimateControlFloorTransceiver()");
}
!# CN_COLORTEMP
bIsControl = ( sControlName.Find(CN_COLORTEMP) > -1 );
if( bIsControl && (sLastControlName != CN_COLORTEMP) )
{
WriteLine( "<script>conInfo('Control CN_COLORTEMP found.');</script>" );
isKnownControl = true;
sLastControlName = CN_COLORTEMP;
if (ch.Label().Substr(0,7) == "VIR-LG-") {
Call("/esp/controls/rgbw.fn::CreateVIR-LGWhiteLevelControl()");
}
}
!# CN_COND_SWITCH_TRANSMITTER_TEMPERATURE - HmIP
bIsControl = ( sControlName.Find(CN_COND_SWITCH_TRANSMITTER_TEMPERATURE) > -1 );
if( bIsControl && (sLastControlName != CN_COND_SWITCH_TRANSMITTER_TEMPERATURE) )
{
WriteLine( "<script>conInfo('Control CN_COND_SWITCH_TRANSMITTER_TEMPERATURE found.');</script>" );
isKnownControl = true;
sLastControlName = CN_COND_SWITCH_TRANSMITTER_TEMPERATURE;
Call("/esp/controls/cond_switch_transmitter_temp.fn::CreateCondSwitchTransmitterTemperature()");
}
!# DANGER
! bIsControl = ( sControlName.Find(CN_DANGER) > -1 );
! if( bIsControl && (sLastControlName!=CN_DANGER) && (ch.Label() != "HmIP-SWSD-2"))
! {
! WriteLine( "<script>conInfo('Control DANGER-Sensor found.');</script>" );
! isKnownControl = true;
! sLastControlName = CN_DANGER;
! Call("/esp/controls/danger.fn::CreateDangerSensor()");
! }
!# FREQUENCY
bIsControl = ( sControlName.Find(CN_DIGITAL_ANALOG_OUTPUT) > -1 );
if( bIsControl && (sLastControlName!=CN_DIGITAL_ANALOG_OUTPUT) )
{
WriteLine( "<script>conInfo('Control DIGITAL_ANALOG_OUTPUT found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DIGITAL_ANALOG_OUTPUT;
Call("/esp/controls/frequency.fn::CreateFrequency()");
}
bIsControl = ( sControlName.Find(CN_DIGITAL_STATE) > -1 );
if( bIsControl && (sLastControlName!=CN_DIGITAL_STATE) )
{
WriteLine( "<script>conInfo('Control CN_DIGITAL_STATE found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DIGITAL_STATE;
Call("/esp/controls/digitalstate.fn::CreateDigitalState()");
}
!# DIMMER
bIsControl = ( sControlName.Find(CN_DIMMER) > -1 );
if( bIsControl && (sLastControlName!=CN_DIMMER) )
{
isKnownControl = true;
sLastControlName = CN_DIMMER;
if (ch.Label().Substr(0,12) != "VIR-LG-ONOFF") {
WriteLine( "<script>conInfo('Control DIMMER found.');</script>" );
if ((ch.Label() == "HmIP-BSL") && (devFwMajor >= 2)) {
Call("/esp/controls/dimmer.fn::CreateOpticalSignalReceiver()");
} else {
Call("/esp/controls/dimmer.fn::CreateDimmingActuator()");
}
} else {
! This is because the device VIR_LG_ONOFF claims it is a DIMMER instead of a SWITCH
WriteLine( "<script>conInfo('Control VIR_LG_ONOFF (OSRAM, PHILIPS.....) found.');</script>" );
sLastControlName = CN_SWITCH;
Call("/esp/controls/switch.fn::CreateVIR-LG-ONOFF_Actuator()");
}
}
!# CN_DIMMER_REAL
bIsControl = ( sControlName.Find(CN_DIMMER_REAL) > -1 );
if( bIsControl && (sLastControlName != CN_DIMMER_REAL) )
{
WriteLine( "<script>conInfo('Control CN_DIMMER_REAL found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DIMMER_REAL;
Call("/esp/controls/dimmer.fn::CreateDimmerRealInfoControl()");
}
!# DOOR_LOCK_STATE_TRANSCEIVER
bIsControl = ( sControlName.Find(CN_DOOR_LOCK_STATE_TRANSCEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_DOOR_LOCK_STATE_TRANSCEIVER) )
{
WriteLine( "<script>conInfo('Control CN_DOOR_LOCK_STATE_TRANSCEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DOOR_LOCK_STATE_TRANSCEIVER;
Call("/esp/controls/door_opener.fn::CreateDoorLockStateTranseiver()");
}
!# DOOR_LOCK_STATE_TRANSMITTER
bIsControl = ( sControlName.Find(CN_DOOR_LOCK_STATE_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName != CN_DOOR_LOCK_STATE_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_DOOR_LOCK_STATE_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DOOR_LOCK_STATE_TRANSMITTER;
Call("/esp/controls/door_opener.fn::CreateDoorLockStateTransmitter()");
}
!# DOOROPENER
bIsControl = ( sControlName.Find(CN_DOOR_OPENER) > -1 );
if( bIsControl && (sLastControlName!=CN_DOOR_OPENER) )
{
WriteLine( "<script>conInfo('Control DOOROPENER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DOOR_OPENER;
Call("/esp/controls/door_opener.fn::CreateDoorOpener()");
}
!# DOOR_RECEIVER
bIsControl = ( sControlName.Find(CN_DOOR_RECEIVER) > -1 );
if( bIsControl && (sLastControlName!=CN_DOOR_RECEIVER) )
{
WriteLine( "<script>conInfo('Control DOOR_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DOOR_RECEIVER;
Call("/esp/controls/door_opener.fn::CreateDoorReceiver()");
}
!# DOOR_WINDOW_CONTACT
bIsControl = ( sControlName.Find(CN_DOOR_SENSOR) > -1 );
if( bIsControl && (sLastControlName!=CN_DOOR_SENSOR) )
{
if (ch.HssType() != "MULTI_MODE_INPUT_TRANSMITTER") {
WriteLine( "<script>conInfo('Control DOOR_WINDOW_CONTACT found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DOOR_SENSOR;
Call("/esp/controls/door_window_contact.fn::CreateDoorWindowContact()");
} else {
WriteLine( "<script>conInfo('Control CN_MULTI_MODE_INPUT_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DOOR_SENSOR;
if (ch) {
! channelMode 1 and 2 are handled as HMIP_BUTTON
if (ch.MetaData("channelMode") == 3) {
Call("/esp/controls/door_window_contact.fn::CreateDoorWindowContact()");
} else {
Call("/esp/datapointconfigurator.fn::CreateNoFunction()");
}
}
}
}
!# CN_DUAL_WHITE_BRIGHTNESS
bIsControl = ( sControlName.Find(CN_DUAL_WHITE_BRIGHTNESS) > -1 );
if( bIsControl && (sLastControlName!=CN_DUAL_WHITE_BRIGHTNESS) )
{
WriteLine( "<script>conInfo('Control DUAL_WHITE_BRIGHTNESS found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DUAL_WHITE_BRIGHTNESS;
Call("/esp/controls/dual_white_controller.fn::CreateDualWhiteBrightnessActuator()");
}
!# CN_DUAL_WHITE_COLOR
bIsControl = ( sControlName.Find(CN_DUAL_WHITE_COLOR) > -1 );
if( bIsControl && (sLastControlName!=CN_DUAL_WHITE_COLOR) )
{
WriteLine( "<script>conInfo('Control DUAL_WHITE_COLOR found.');</script>" );
isKnownControl = true;
sLastControlName = CN_DUAL_WHITE_COLOR;
Call("/esp/controls/dual_white_controller.fn::CreateDualWhiteColorActuator()");
}
!# EVENT_INTERFACE
bIsControl = ( sControlName.Find(CN_EVENT_INTERFACE) > -1 );
if( bIsControl && (sLastControlName!=CN_EVENT_INTERFACE) )
{
WriteLine( "<script>conInfo('Control EVENT_INTERFACE found.');</script>" );
isKnownControl = true;
sLastControlName = CN_EVENT_INTERFACE;
Call("/esp/datapointconfigurator.fn::CreateEventInterface()");
}
!# CN_GENERIC_INPUT_TRANSMITTER - HmIP
bIsControl = ( sControlName.Find(CN_GENERIC_INPUT_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName != CN_GENERIC_INPUT_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_GENERIC_INPUT_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_GENERIC_INPUT_TRANSMITTER;
Call("/esp/controls/generic_input_transmitter.fn::CreateGenericInputTransmitter()");
}
!# CN_GENERIC_MEASURING_TRANSMITTER - HmIP
bIsControl = ( sControlName.Find(CN_GENERIC_MEASURING_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName != CN_GENERIC_MEASURING_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_GENERIC_MEASURING_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_GENERIC_MEASURING_TRANSMITTER;
Call("/esp/controls/generic_input_transmitter.fn::CreateGenericMeasuringTransmitter()");
}
!# HEATING_CONTROL
bIsControl = ( sControlName.Find(CN_HEATING_CONTROL) > -1 );
if( bIsControl && (sLastControlName != CN_HEATING_CONTROL) )
{
WriteLine( "<script>conInfo('Control CN_HEATING_CONTROL found.');</script>" );
isKnownControl = true;
sLastControlName = CN_HEATING_CONTROL;
Call("/esp/controls/heating_control.fn::CreateHeatingControl()");
}
!# HEATING_CONTROL_HMIP
bIsControl = ( sControlName.Find(CN_HEATING_CONTROL_HMIP) > -1 );
if( bIsControl && (sLastControlName != CN_HEATING_CONTROL_HMIP) )
{
WriteLine( "<script>conInfo('Control CN_HEATING_CONTROL_HMIP found.');</script>" );
isKnownControl = true;
sLastControlName = CN_HEATING_CONTROL_HMIP;
if (ch.Label() == "ALPHA-IP-RBGa") {
Call("/esp/controls/heating_control.fn::CreateHeatingControlHmIPa()");
} else {
Call("/esp/controls/heating_control.fn::CreateHeatingControlHmIP()");
}
}
!# HMIP_BUTTON
bIsControl = ( sControlName.Find(CN_HMIP_BUTTON) > -1 );
if( bIsControl && (sLastControlName!=CN_HMIP_BUTTON) )
{
WriteLine( "<script>conInfo('Control CN_HMIP_BUTTON found.');</script>" );
isKnownControl = true;
sLastControlName = CN_HMIP_BUTTON;
if ((ch.HssType() != "MULTI_MODE_INPUT_TRANSMITTER") || (ch.Label() == "ELV-SH-BM-S")) {
if (ch.Label().Substr(5,7) != "MOD-RC8") {
if ((ch.Label() == "ELV-SH-BM-S")) {
WriteLine( "<script>conInfo('ELV-SH-BM-S found');</script>" );
Call("/esp/controls/key_switch_sc.fn::CreateContentA()");
} else {
Call("/esp/datapointconfigurator.fn::CreateNoFunction()");
}
} else {
WriteLine( "<script>conInfo('HmIP-MOD-RC8 found');</script>" );
Call("/esp/controls/key_switch_sc.fn::CreateContent()");
}
}
}
!# CN_IDENTIFICATION - HmIPW Identification
if (ch.Label() != "HmIPW-DRAP") {
bIsControl = ( sControlName.Find(CN_IDENTIFICATION) > -1 );
if( bIsControl && (sLastControlName != CN_IDENTIFICATION) )
{
WriteLine( "<script>conInfo('Control CN_IDENTIFICATION found.');</script>" );
isKnownControl = true;
sLastControlName = CN_IDENTIFICATION;
Call("/esp/controls/hmipw_identification.fn::CreateIdentification()");
}
}
!# CN_JALOUSIE
bIsControl = ( sControlName.Find(CN_JALOUSIE) > -1 );
if( bIsControl && (sLastControlName!=CN_JALOUSIE) )
{
WriteLine( "<script>conInfo('Control JALOUSIE found.');</script>" );
isKnownControl = true;
sLastControlName = CN_JALOUSIE;
Call("/esp/controls/blind.fn::CreateJalousieActuator()");
}
!# LOCK
bIsControl = ( sControlName.Find(CN_LOCK) > -1 );
if( bIsControl && (sLastControlName!=CN_LOCK) )
{
WriteLine( "<script>conInfo('Control LOCK found.');</script>" );
isKnownControl = true;
sLastControlName = CN_LOCK;
Call("/esp/controls/lock.fn::CreateKeyMatic()");
}
! CN_MAINTENANCE
bIsControl = ( sControlName.Find(CN_MAINTENANCE) > -1 );
if( bIsControl && (sLastControlName != CN_MAINTENANCE) )
{
WriteLine( "<script>conInfo('Control CN_MAINTENANCE found.');</script>" );
if (ch.Label() == "HmIPW-DRAP") {
WriteLine( "<script>conInfo('Create DRAP Control.');</script>" );
sLastControlName = CN_MAINTENANCE;
isKnownControl = true;
Call("/esp/controls/drap.fn::CreateDrap()");
}
if ((ch.Label() == "HmIP-HAP") || (ch.Label() == "HmIP-HAP-A") || (ch.Label() == "HmIP-HAP-B1") || (ch.Label() == "HmIP-HAP JS1")) {
WriteLine( "<script>conInfo('Create HAP Control.');</script>" );
sLastControlName = CN_MAINTENANCE;
isKnownControl = true;
Call("/esp/controls/hap.fn::CreateHAP()");
}
if ((ch.Label() == "RPI-RF-MOD") || (ch.Label() =="HmIP-CCU3")) {
WriteLine( "<script>conInfo('Create CoPro Control.');</script>" );
sLastControlName = CN_MAINTENANCE;
isKnownControl = true;
Call("/esp/controls/coProcessor.fn::CreateCoPro()");
}
if (ch.Label() == "HmIP-FWI") {
WriteLine( "<script>conInfo('Create FWI MAINTENANCE Control.');</script>" );
sLastControlName = CN_MAINTENANCE;
isKnownControl = true;
Call("/esp/controls/maintenanceFWI.fn::CreateMaintenance()");
}
if (ch.Label() == "HmIP-WKP") {
WriteLine( "<script>conInfo('Create WKP MAINTENANCE Control.');</script>" );
sLastControlName = CN_MAINTENANCE;
isKnownControl = true;
Call("/esp/controls/maintenanceWKP.fn::CreateMaintenance()");
}
if (ch.Label() == "HmIP-SWSD-2") {
WriteLine( "<script>conInfo('Create SWSD-2 MAINTENANCE Control.');</script>" );
sLastControlName = CN_MAINTENANCE;
isKnownControl = true;
Call("/esp/controls/maintenanceSmokeDetector.fn::CreateMaintenance()");
}
}
!# CN_MOTIONDETECTOR
bIsControl = ( sControlName.Find(CN_MOTIONDETECTOR) > -1 );
if( bIsControl && (sLastControlName != CN_MOTIONDETECTOR) )
{
WriteLine( "<script>conInfo('Control CN_MOTIONDETECTOR found.');</script>" );
isKnownControl = true;
sLastControlName = CN_MOTIONDETECTOR;
Call("/esp/controls/motiondetector.fn::CreateMotionDetector()");
}
!# NONE
bIsControl = ( sControlName.Find(CN_NONE) > -1 );
if( bIsControl && (sLastControlName != CN_NONE) )
{
! IGNORE NONE
}
!# OPTICAL_SIGNAL_RECEIVER
bIsControl = ( sControlName.Find(CN_OPTICAL_SIGNAL_RECEIVER) > -1 );
if( bIsControl && (sLastControlName != CN_OPTICAL_SIGNAL_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_OPTICAL_SIGNAL_RECEIVER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_OPTICAL_SIGNAL_RECEIVER;
Call("/esp/controls/opticalsignalreceiver.fn::CreateOpticalSignalReceiver()");
}
!# CN_PDDT (PASSAGE_DETECTOR_DIRECTION_TRANSMITTER)
bIsControl = ( sControlName.Find(CN_PDDT) > -1 );
if( bIsControl && (sLastControlName != CN_PDDT) )
{
WriteLine( "<script>conInfo('Control CN_PDDT (PASSAGE_DETECTOR_DIRECTION_TRANSMITTER) found.');</script>" );
isKnownControl = true;
sLastControlName = CN_PDDT;
Call("/esp/controls/passagedetector.fn::CreatePassageDetector()");
}
!# POWERMETER
bIsControl = ( sControlName.Find(CN_POWERMETER) > -1 );
if( bIsControl && (sLastControlName != CN_POWERMETER) )
{
WriteLine( "<script>conInfo('Control CN_POWERMETER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_POWERMETER;
Call("/esp/controls/powermeter.fn::CreatePowermeterControl()");
}
!# POWERMETER_IEC1
bIsControl = ( sControlName.Find(CN_POWERMETER_IEC1) > -1 );
if( bIsControl && (sLastControlName != CN_POWERMETER_IEC1) )
{
WriteLine( "<script>conInfo('Control CN_POWERMETER_IEC1 found.');</script>" );
isKnownControl = true;
sLastControlName = CN_POWERMETER_IEC1;
Call("/esp/controls/powermeter.fn::CreatePowermeterIECControl()");
}
!# POWERMETER_IEC2
bIsControl = ( sControlName.Find(CN_POWERMETER_IEC2) > -1 );
if( bIsControl && (sLastControlName != CN_POWERMETER_IEC2) )
{
WriteLine( "<script>conInfo('Control CN_POWERMETER_IEC2 found.');</script>" );
isKnownControl = true;
sLastControlName = CN_POWERMETER_IEC2;
Call("/esp/controls/powermeter.fn::CreatePowermeterIECControl()");
}
!# POWERMETER_IGL
bIsControl = ( sControlName.Find(CN_POWERMETER_IGL) > -1 );
if( bIsControl && (sLastControlName != CN_POWERMETER_IGL) )
{
WriteLine( "<script>conInfo('Control CN_POWERMETER_IGL found.');</script>" );
isKnownControl = true;
sLastControlName = CN_POWERMETER_IGL;
Call("/esp/controls/powermeter.fn::CreatePowermeterIGLControl()");
}
!# POWERMETER_PSM
bIsControl = ( sControlName.Find(CN_POWERMETER_PSM) > -1 );
if( bIsControl && (sLastControlName != CN_POWERMETER_PSM) )
{
WriteLine( "<script>conInfo('Control CN_POWERMETER_PSM found.');</script>" );
string chnAddress = ch.Address();
integer chnNumber = chnAddress.StrValueByIndex(":",1).ToInteger();
string chn1Address = chnAddress.StrValueByIndex(":",0) # ":1";
isKnownControl = true;
sLastControlName = CN_POWERMETER_PSM;
if (ch.Label() != "HmIP-ESI") {
Call("/esp/controls/powermeter.fn::CreatePowermeterPSMControl()");
} else {
string esiSensor;
string sensorState = "SENSOR_UNKNOWN,SENSOR_ES_GAS,SENSOR_ES_LED,SENSOR_ES_IEC,SENSOR_ES_IEC_SML,SENSOR_ES_IEC_SML_WH,SENSOR_ES_IEC_D0_A,SENSOR_ES_IEC_D0_B,SENSOR_ES_IEC_D0_C,SENSOR_ES_IEC_D0_D";
object oDevice = dom.GetObject(cObj.Device());
object oChnOne = dom.GetObject(oDevice.Channels().GetAt(1));
object oChannelOpMode = oChnOne.DPByControl("POWERMETER_PSM.CHANNEL_OPERATION_MODE");
if (oChannelOpMode) {
integer sensorIndex = oChannelOpMode.Value().ToInteger();
esiSensor = sensorState.StrValueByIndex(',',sensorIndex);
} else {
esiSensor = sensorState.StrValueByIndex(',',0);
}
WriteLine( "<script>conInfo('HmIP-ESI - sensor: "#esiSensor#"');</script>" );
if (chnNumber == 1) {
Call("/esp/controls/powermeter.fn::CreatePowermeterESIControl_CurConsumption()");
} else {
string _esiSensor = esiSensor;
if ((esiSensor == "SENSOR_UNKNOWN") || (esiSensor == "SENSOR_ES_IEC")) {
string style = "style='margin-left:8px;'";
Call("/esp/datapointconfigurator.fn::CreateNoFunction()");
} else {
if (esiSensor.Substr(0,13) != "SENSOR_ES_IEC") {
if (chnNumber == 2) {
! Create GAS or LED Control
Call("/esp/controls/powermeter.fn::CreatePowermeterESIControl_TotalConsumption()");
} else {
! Wenn kein IEC, Kanal 3 und 4 = noParam
string style = "style='margin-left:8px;'";
Call("/esp/datapointconfigurator.fn::CreateNoFunction()");
}
} else {
! Create IEC Control
Call("/esp/controls/powermeter.fn::CreatePowermeterESIControl_ESI_IEC()");
}
}
}
}
}
!# RAIN_DETECTION_TRANSMITTER - HmIP
bIsControl = ( sControlName.Find(CN_RAIN_DETECTION_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName != CN_RAIN_DETECTION_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_RAIN_DETECTION_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_RAIN_DETECTION_TRANSMITTER;
Call("/esp/controls/raindetector_transmitter.fn::CreateRainDetectorTransmitter()");
}
!# RC19_DISPLAY
bIsControl = ( sControlName.Find(CN_RC19_DISPLAY) > -1 );
if( bIsControl && (sLastControlName!=CN_RC19_DISPLAY) )
{
WriteLine( "<script>conInfo('Control RC19_DISPLAY found.');</script>" );
isKnownControl = true;
sLastControlName = CN_RC19_DISPLAY;
Call("/esp/controls/rc19_display.fn::CreateDisplay()");
}
!# CN_RGBW_AUTOMATIC
bIsControl = ( sControlName.Find(CN_RGBW_AUTOMATIC) > -1 );
if( bIsControl && (sLastControlName != CN_RGBW_AUTOMATIC) )
{
WriteLine( "<script>conInfo('Control CN_RGBW_AUTOMATIC found.');</script>" );
isKnownControl = true;
sLastControlName = CN_RGBW_AUTOMATIC;
Call("/esp/controls/rgbw.fn::CreateRGBWAutomaticControl()");
}
!# CN_RGBW_COLOR
bIsControl = ( sControlName.Find(CN_RGBW_COLOR) > -1 );
if( bIsControl && (sLastControlName != CN_RGBW_COLOR) )
{
WriteLine( "<script>conInfo('Control CN_RGBW_COLOR found.');</script>" );
isKnownControl = true;
sLastControlName = CN_RGBW_COLOR;
if (ch.Label().Substr(0,7) == "VIR-LG-") {
string chLabel = ch.Label();
if((chLabel.Find("RGBW") > -1) || (chLabel.Find("GROUP") > -1)) {
Call("/esp/controls/rgbw.fn::CreateVIR-LGRGBWColorControl()");
}
} else {
Call("/esp/controls/rgbw.fn::CreateRGBWColorControl()");
}
}
!# CN_RGB_COLOR
bIsControl = ( sControlName.Find(CN_RGB_COLOR) > -1 );
if( bIsControl && (sLastControlName != CN_RGB_COLOR) )
{
WriteLine( "<script>conInfo('Control CN_RGB_COLOR found.');</script>" );
isKnownControl = true;
sLastControlName = CN_RGB_COLOR;
if (ch.Label().Substr(0,7) == "VIR-LG-") {
string chLabel = ch.Label();
if(chLabel.Find("RGB") > -1) {
Call("/esp/controls/rgbw.fn::CreateVIR-LGRGBColorControl()");
}
}
}
!# RHS (Rotary Handle Sensor - Fensterdrehgriffkontakt)
bIsControl = ( sControlName.Find(CN_RHS) > -1 );
if( bIsControl && (sLastControlName!=CN_RHS) )
{
WriteLine( "<script>conInfo('Control RHS found.');</script>" );
isKnownControl = true;
sLastControlName = CN_RHS;
Call("/esp/controls/rhs.fn::CreateWndRotSensor()");
}
!# CN_SERVO_TRANSMITTER (e. g. WSC - Servo Steuerung)
bIsControl = ( sControlName.Find(CN_SERVO_TRANSMITTER) > -1 );
if( bIsControl && (sLastControlName!=CN_SERVO_TRANSMITTER) )
{
WriteLine( "<script>conInfo('Control CN_SERVO_TRANSMITTER found.');</script>" );
isKnownControl = true;
sLastControlName = CN_SERVO_TRANSMITTER;
Call("/esp/controls/servo.fn::CreateServoTransmitter()");
}
!# CN_SERVO_VIRTUAL_RECEIVER (e. g. WSC - Servo Steuerung)
bIsControl = ( sControlName.Find(CN_SERVO_VIRTUAL_RECEIVER) > -1 );
if( bIsControl && (sLastControlName!=CN_SERVO_VIRTUAL_RECEIVER) )
{
WriteLine( "<script>conInfo('Control CN_SERVO_VIRTUAL_RECEIVER found.');</script>" );