forked from dopry/node-red-contrib-bacnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbacnet.html
1326 lines (1275 loc) · 50.6 KB
/
bacnet.html
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
<script type="text/javascript">
var bacnetEnumProperties = {
propertyTypes: {
'Acked transitions': 0,
'Ack required': 1,
'Action': 2,
'Action text': 3,
'Active text': 4,
'Active vt sessions': 5,
'Alarm value': 6,
'Alarm values': 7,
'All': 8,
'All writes successful': 9,
'Apdu segment timeout': 10,
'Apdu timeout': 11,
'Application software version': 12,
'Archive': 13,
'Bias': 14,
'Change of state count': 15,
'Change of state time': 16,
'Notification class': 17,
'Controlled variable reference': 19,
'Controlled variable units': 20,
'Controlled variable value': 21,
'Cov increment': 22,
'Date list': 23,
'Daylight savings status': 24,
'Deadband': 25,
'Derivative constant': 26,
'Derivative constant units': 27,
'Description': 28,
'Description of halt': 29,
'Device address binding': 30,
'Device type': 31,
'Effective period': 32,
'Elapsed active time': 33,
'Error limit': 34,
'Event enable': 35,
'Event state': 36,
'Event type': 37,
'Exception schedule': 38,
'Fault values': 39,
'Feedback value': 40,
'File access method': 41,
'File size': 42,
'File type': 43,
'Firmware revision': 44,
'High limit': 45,
'Inactive text': 46,
'In process': 47,
'Instance of': 48,
'Integral constant': 49,
'Integral constant units': 50,
'Issue confirmed notifications': 51,
'Limit enable': 52,
'List of group members': 53,
'List of object property references': 54,
'List of session keys': 55,
'Local date': 56,
'Local time': 57,
'Location': 58,
'Low limit': 59,
'Manipulated variable reference': 60,
'Maximum output': 61,
'Max apdu length accepted': 62,
'Max info frames': 63,
'Max master': 64,
'Max pres value': 65,
'Minimum off time': 66,
'Minimum on time': 67,
'Minimum output': 68,
'Min pres value': 69,
'Model name': 70,
'Modification date': 71,
'Notify type': 72,
'Number of apdu retries': 73,
'Number of states': 74,
'Object identifier': 75,
'Object list': 76,
'Object name': 77,
'Object property reference': 78,
'Object type': 79,
'Optional': 80,
'Out of service': 81,
'Output units': 82,
'Event parameters': 83,
'Polarity': 84,
'Present value': 85,
'Priority': 86,
'Priority array': 87,
'Priority for writing': 88,
'Process identifier': 89,
'Program change': 90,
'Program location': 91,
'Program state': 92,
'Proportional constant': 93,
'Proportional constant units': 94,
'Protocol conformance class': 95,
'Protocol object types supported': 96,
'Protocol services supported': 97,
'Protocol version': 98,
'Read only': 99,
'Reason for halt': 100,
'Recipient': 101,
'Recipient list': 102,
'Reliability': 103,
'Relinquish default': 104,
'Required': 105,
'Resolution': 106,
'Segmentation supported': 107,
'Setpoint': 108,
'Setpoint reference': 109,
'State text': 110,
'Status flags': 111,
'System status': 112,
'Time delay': 113,
'Time of active time reset': 114,
'Time of state count reset': 115,
'Time synchronization recipients': 116,
'Units': 117,
'Update interval': 118,
'Utc offset': 119,
'Vendor identifier': 120,
'Vendor name': 121,
'Vt classes supported': 122,
'Weekly schedule': 123,
'Attempted samples': 124,
'Average value': 125,
'Buffer size': 126,
'Client cov increment': 127,
'Cov resubscription interval': 128,
'Current notify time': 129,
'Event time stamps': 130,
'Log buffer': 131,
'Log device object property': 132,
'Enable': 133,
'Log interval': 134,
'Maximum value': 135,
'Minimum value': 136,
'Notification threshold': 137,
'Previous notify time': 138,
'Protocol revision': 139,
'Records since notification': 140,
'Record count': 141,
'Start time': 142,
'Stop time': 143,
'Stop when full': 144,
'Total record count': 145,
'Valid samples': 146,
'Window interval': 147,
'Window samples': 148,
'Maximum value timestamp': 149,
'Minimum value timestamp': 150,
'Variance value': 151,
'Active cov subscriptions': 152,
'Backup failure timeout': 153,
'Configuration files': 154,
'Database revision': 155,
'Direct reading': 156,
'Last restore time,': 157,
'Maintenance required': 158,
'Member of': 159,
'Mode': 160,
'Operation expected': 161,
'Setting': 162,
'Silenced': 163,
'Tracking value': 164,
'Zone members': 165,
'Life safety alarm values': 166,
'Max segments accepted': 167,
'Profile name': 168,
'Auto slave discovery': 169,
'Manual slave address binding': 170,
'Slave address binding': 171,
'Slave proxy enable': 172,
'Last notify record': 173,
'Schedule default': 174,
'Accepted modes': 175,
'Adjust value': 176,
'Count': 177,
'Count before change': 178,
'Count change time': 179,
'Cov period': 180,
'Input reference': 181,
'Limit monitoring interval': 182,
'Logging object': 183,
'Logging record': 184,
'Prescale': 185,
'Pulse rate': 186,
'Scale': 187,
'Scale factor': 188,
'Update time': 189,
'Value before change': 190,
'Value set': 191,
'Value change time': 192,
'Align intervals': 193,
'Interval offset': 195,
'Last restart reason': 196,
'Logging type': 197,
'Restart notification recipients': 202,
'Time of device restart': 203,
'Time synchronization interval': 204,
'Trigger': 205,
'Utc time synchronization recipients': 206,
'Node subtype': 207,
'Node type': 208,
'Structured object list': 209,
'Subordinate annotations': 210,
'Subordinate list': 211,
'Actual shed level': 212,
'Duty window': 213,
'Expected shed level': 214,
'Full duty baseline': 215,
'Requested shed level': 218,
'Shed duration': 219,
'Shed level descriptions': 220,
'Shed levels': 221,
'State description': 222,
'Door alarm state': 226,
'Door extended pulse time': 227,
'Door members': 228,
'Door open too long time': 229,
'Door pulse time': 230,
'Door status': 231,
'Door unlock delay time': 232,
'Lock status': 233,
'Masked alarm values': 234,
'Secured status': 235,
'Absentee limit': 244,
'Access alarm events': 245,
'Access doors': 246,
'Access event': 247,
'Access event authentication factor': 248,
'Access event credential': 249,
'Access event time': 250,
'Access transaction events': 251,
'Accompaniment': 252,
'Accompaniment time': 253,
'Activation time': 254,
'Active authentication policy': 255,
'Assigned access rights': 256,
'Authentication factors': 257,
'Authentication policy list': 258,
'Authentication policy names': 259,
'Authentication status': 260,
'Authorization mode': 261,
'Belongs to': 262,
'Credential disable': 263,
'Credential status': 264,
'Credentials': 265,
'Credentials in zone': 266,
'Days remaining': 267,
'Entry points': 268,
'Exit points': 269,
'Expiration time': 270,
'Extended time enable': 271,
'Failed attempt events': 272,
'Failed attempts': 273,
'Failed attempts time': 274,
'Last access event': 275,
'Last access point': 276,
'Last credential added': 277,
'Last credential added time': 278,
'Last credential removed': 279,
'Last credential removed time': 280,
'Last use time': 281,
'Lockout': 282,
'Lockout relinquish time': 283,
'Master exemption': 284,
'Max failed attempts': 285,
'Members': 286,
'Muster point': 287,
'Negative access rules': 288,
'Number of authentication policies': 289,
'Occupancy count': 290,
'Occupancy count adjust': 291,
'Occupancy count enable': 292,
'Occupancy exemption': 293,
'Occupancy lower limit': 294,
'Occupancy lower limit enforced': 295,
'Occupancy state': 296,
'Occupancy upper limit': 297,
'Occupancy upper limit enforced': 298,
'Passback exemption': 299,
'Passback mode': 300,
'Passback timeout': 301,
'Positive access rules': 302,
'Reason for disable': 303,
'Supported formats': 304,
'Supported format classes': 305,
'Threat authority': 306,
'Threat level': 307,
'Trace flag': 308,
'Transaction notification class': 309,
'User external identifier': 310,
'User information reference': 311,
'User name': 317,
'User type': 318,
'Uses remaining': 319,
'Zone from': 320,
'Zone to': 321,
'Access event tag': 322,
'Global identifier': 323,
'Verification time': 326,
'Base device security policy': 327,
'Distribution key revision': 328,
'Do not hide': 329,
'Key sets': 330,
'Last key server': 331,
'Network access security policies': 332,
'Packet reorder time': 333,
'Security pdu timeout': 334,
'Security time window': 335,
'Supported security algorithms': 336,
'Update key set timeout': 337,
'Backup and restore state': 338,
'Backup preparation time': 339,
'Restore completion time': 340,
'Restore preparation time': 341,
'Bit mask': 342,
'Bit text': 343,
'Is utc': 344,
'Group members': 345,
'Group member names': 346,
'Member status flags': 347,
'Requested update interval': 348,
'Covu period': 349,
'Covu recipients': 350,
'Event message texts': 351,
'Event message texts config': 352,
'Event detection enable': 353,
'Event algorithm inhibit': 354,
'Event algorithm inhibit ref': 355,
'Time delay normal': 356,
'Reliability evaluation inhibit': 357,
'Fault parameters': 358,
'Fault type': 359,
'Local forwarding only': 360,
'Process identifier filter': 361,
'Subscribed recipients': 362,
'Port filter': 363,
'Authorization exemptions': 364,
'Allow group delay inhibit': 365,
'Channel number': 366,
'Control groups': 367,
'Execution delay': 368,
'Last priority': 369,
'Write status': 370,
'Property list': 371,
'Serial number': 372,
'Blink warn enable': 373,
'Default fade time': 374,
'Default ramp rate': 375,
'Default step increment': 376,
'Egress time': 377,
'In progress': 378,
'Instantaneous power': 379,
'Lighting command': 380,
'Lighting command default priority': 381,
'Max actual value': 382,
'Min actual value': 383,
'Power': 384,
'Transition': 385,
'Egress active': 386,
'Interface value': 387,
'Fault high limit': 388,
'Fault low limit': 389,
'Low diff limit': 390,
'Strike count': 391,
'Time of strike count reset': 392,
'Default timeout': 393,
'Initial timeout': 394,
'Last state change': 395,
'State change values': 396,
'Timer running': 397,
'Timer state': 398,
'Apdu length': 399,
'Ip address': 400,
'Ip default gateway': 401,
'Ip dhcp enable': 402,
'Ip dhcp lease time': 403,
'Ip dhcp lease time remaining': 404,
'Ip dhcp server': 405,
'Ip dns server': 406,
'Bacnet ip global address': 407,
'Bacnet ip mode': 408,
'Bacnet ip multicast address': 409,
'Bacnet ip nat traversal': 410,
'Ip subnet mask': 411,
'Bacnet ip udp port': 412,
'Bbmd accept fd registrations': 413,
'Bbmd broadcast distribution table': 414,
'Bbmd foreign device table': 415,
'Changes pending': 416,
'Command': 417,
'Fd bbmd address': 418,
'Fd subscription lifetime': 419,
'Link speed': 420,
'Link speeds': 421,
'Link speed autonegotiate': 422,
'Mac address': 423,
'Network interface name': 424,
'Network number': 425,
'Network number quality': 426,
'Network type': 427,
'Routing table': 428,
'Virtual mac address table': 429,
'Command time array': 430,
'Current command priority': 431,
'Last command time': 432,
'Value source': 433,
'Value source array': 434,
'Bacnet ipv6 mode': 435,
'Ipv6 address': 436,
'Ipv6 prefix length': 437,
'Bacnet ipv6 udp port': 438,
'Ipv6 default gateway': 439,
'Bacnet ipv6 multicast address': 440,
'Ipv6 dns server': 441,
'Ipv6 auto addressing enable': 442,
'Ipv6 dhcp lease time': 443,
'Ipv6 dhcp lease time remaining': 444,
'Ipv6 dhcp server': 445,
'Ipv6 zone index': 446,
'Assigned landing calls': 447,
'Car assigned direction': 448,
'Car door command': 449,
'Car door status': 450,
'Car door text': 451,
'Car door zone': 452,
'Car drive status': 453,
'Car load': 454,
'Car load units': 455,
'Car mode': 456,
'Car moving direction': 457,
'Car position': 458,
'Elevator group': 459,
'Energy meter': 460,
'Energy meter ref': 461,
'Escalator mode': 462,
'Fault signals': 463,
'Floor text': 464,
'Group id': 465,
'Group mode': 467,
'Higher deck': 468,
'Installation id': 469,
'Landing calls': 470,
'Landing call control': 471,
'Landing door status': 472,
'Lower deck': 473,
'Machine room id': 474,
'Making car call': 475,
'Next stopping floor': 476,
'Operation direction': 477,
'Passenger alarm': 478,
'Power mode': 479,
'Registered car call': 480,
'Active cov multiple subscriptions': 481,
'Protocol level': 482,
'Reference port': 483,
'Deployed profile location': 484,
'Profile location': 485,
'Tags': 486,
'Subordinate node types': 487,
'Subordinate tags': 488,
'Subordinate relationships': 489,
'Default subordinate relationship': 490,
'Represents': 491,
},
objectTypes: {
'Analog input': 0,
'Analog output': 1,
'Analog value': 2,
'Binary input': 3,
'Binary output': 4,
'Binary value': 5,
'Calendar': 6,
'Command': 7,
'Device': 8,
'Event enrollment': 9,
'File': 10,
'Group': 11,
'Loop': 12,
'Multi state input': 13,
'Multi state output': 14,
'Notification class': 15,
'Program': 16,
'Schedule': 17,
'Averaging': 18,
'Multi state value': 19,
'Trend log': 20,
'Life safety point': 21,
'Life safety zone': 22,
'Accumulator': 23,
'Pulse converter': 24,
'Event log': 25,
'Global group': 26,
'Trend log multiple': 27,
'Load control': 28,
'Structured view': 29,
'Access door': 30,
'Timer': 31,
'Access credential': 32,
'Access point': 33,
'Access rights': 34,
'Access user': 35,
'Access zone': 36,
'Credential data input': 37,
'Network security': 38,
'Bitstring value': 39,
'Characterstring value': 40,
'Datepattern value': 41,
'Date value': 42,
'Datetimepattern value': 43,
'Datetime value': 44,
'Integer value': 45,
'Large analog value': 46,
'Octetstring value': 47,
'Positive integer value': 48,
'Timepattern value': 49,
'Time value': 50,
'Notification forwarder': 51,
'Alert enrollment': 52,
'Channel': 53,
'Lighting output': 54,
'Binary lighting output': 55,
'Network port': 56,
'Elevator group': 57,
'Escalator': 58,
'Lift': 59,
}
}
</script>
<script type="text/x-red" data-template-name="bacnet-server">
<div class="form-row">
<label for="node-config-input-interface"><i class="icon-bookmark"></i> Interface</label>
<input type="text" id="node-config-input-interface">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="icon-bookmark"></i> Port</label>
<input type="text" id="node-config-input-port">
</div>
<div class="form-row">
<label for="node-config-input-broadcastAddress"><i class="icon-bookmark"></i> Broadcast Address</label>
<input type="text" id="node-config-input-broadcastAddress">
</div>
<div class="form-row1">
<label for="node-config-input-adpuTimeout"><i class="fa fa-clock-o"></i> Connection Timeout (s)</label>
<input type="text" id="node-config-input-adpuTimeout">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-server">
<p>To be able to communicate to BACNET devices, you have to initialize a new client instance.</p>
<ul>
<li><code>interface</code> <em>[string]</em> - Specific BACNET communication interface if different from primary one. <em>Optional</em>.</li>
<li><code>port</code> <em>[number]</em> - BACNET communication port for listening and sending. Default is <code>47808</code>. <em>Optional</em>.</li>
<li><code>broadcastAddress</code> <em>[string]</em> - The address used for broadcast messages. Default is <code>255.255.255.255</code>. <em>Optional</em>.</li>
<li><code>adpuTimeout</code> <em>[number]</em> - The timeout in milliseconds until a transaction should be interpreted as error. Default is <code>3000</code>. <em>Optional</em>.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-server', {
category: 'config',
defaults: {
interface: {
value: '', required: false
},
port: {
value: 47808,
required: false,
validate: RED.validators.number()
},
broadcastAddress: {
value: '255.255.255.255',
required: false
},
timeout: {
value: 3000,
required: false,
validate: RED.validators.number()
}
},
label: function() {
return 'bacnet@' + this.interface + ':' + this.port;
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-discovery">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-lowLimit"><i class="icon-tag"></i> Low limit</label>
<input type="text" id="node-input-lowLimit" placeholder="Low limit">
</div>
<div class="form-row">
<label for="node-input-highLimit"><i class="icon-tag"></i> High limit</label>
<input type="text" id="node-input-highLimit" placeholder="High limit">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-tag"></i> Address</label>
<input type="text" id="node-input-address" placeholder="Address">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-discovery">
<p>The <code>whoIs</code> command discovers all BACNET devices in the network.</p>
<ul>
<li><code>lowLimit</code> <em>[number]</em> - Minimal device instance number to search for. <em>Optional</em>.</li>
<li><code>highLimit</code> <em>[number]</em> - Maximal device instance number to search for. <em>Optional</em>.</li>
<li><code>address</code> <em>[string]</em> - Unicast address if command should device directly. <em>Optional</em>.</li>
</ul>
<h3>Output <code>message.payload</code></h3>
<dl class="message-properties">
<dt>address <span class="property-type">string</span></dt>
<dd>IP address of the detected device.</dd>
<dt>deviceId <span class="property-type">number</span></dt>
<dd>Bacnet device id.</dd>
<dt>maxAdpu <span class="property-type">number</span></dt>
<dd>Max ADPU size the device is supporting.</dd>
<dt>segmentation <span class="property-type">number</span></dt>
<dd>Type of segmentation the device is supporting.</dd>
<dt>vendorId <span class="property-type">number</span></dt>
<dd>Bacnet vendor id.</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-discovery', {
category: 'BACnet',
color: '#E9967A',
defaults: {
name: {
value: ''
},
address: {
value: '',
required: false
},
lowLimit: {
value: '',
required: false,
validate: RED.validators.number()
},
highLimit: {
value: '',
required: false,
validate: RED.validators.number()
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 0,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'Who-Is',
label: function() {
return (this.name || 'BACnet Who-Is');
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-read">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="">
</div>
<div class="form-row">
<label for="node-input-objectType"><i class="icon-bookmark"></i> Object Type</label>
<select id="node-input-objectType" placeholder=""></select>
</div>
<div class="form-row">
<label for="node-input-objectInstance"><i class="icon-bookmark"></i> Object Instance</label>
<input type="text" id="node-input-objectInstance" placeholder="">
</div>
<div class="form-row">
<label for="node-input-propertyId"><i class="icon-bookmark"></i> Property ID</label>
<select id="node-input-propertyId" placeholder=""></select>
</div>
<div class="form-row">
<label for="node-input-arrayIndex"><i class="icon-bookmark"></i> Array Index</label>
<input type="text" id="node-input-arrayIndex" placeholder="">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-read">
<p>The <code>readProperty</code> command reads a single property of an object from a device. It accepts an input whose device property will override the properties set here.</p>
<ul>
<li><code>address</code> <em>[string]</em> - IP address of the target device.</li>
<li><code>objectType</code> <em>[number]</em> - The BACNET object type to read.</li>
<li><code>objectInstance</code> <em>[number]</em> - The BACNET object instance to read.</li>
<li><code>propertyId</code> <em>[number]</em> - The BACNET property id in the specified object to read.</li>
<li><code>arrayIndex</code> <em>[number]</em> - The array index of the property to be read.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-read', {
category: 'BACnet',
color: '#E9967A',
defaults: {
name: {
value: ''
},
address: {
value: '',
required: false
},
objectType: {
value: '',
required: false,
validate: RED.validators.number()
},
objectInstance: {
value: '',
required: false,
validate: RED.validators.number()
},
propertyId: {
value: '',
required: false,
validate: RED.validators.number()
},
arrayIndex: {
value: undefined
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'ReadProperty',
label: function() {
return (this.name || 'BACnet ReadProperty');
},
oneditprepare: function() {
var objectType = document.querySelector('select#node-input-objectType');
objectType.insertAdjacentHTML(
'afterbegin',
Object.keys(bacnetEnumProperties.objectTypes).map((key) =>
'<option value="' + bacnetEnumProperties.objectTypes[key] + '">' +
key + ' (' + bacnetEnumProperties.objectTypes[key] + ')' + '</option>'
).join('')
);
objectType.value = this.objectType;
var propertyId = document.querySelector('select#node-input-propertyId');
propertyId.insertAdjacentHTML(
'afterbegin',
Object.keys(bacnetEnumProperties.propertyTypes).map((key) =>
'<option value="' + bacnetEnumProperties.propertyTypes[key] + '">' +
key + ' (' + bacnetEnumProperties.propertyTypes[key] + ')' + '</option>'
).join('')
);
propertyId.value = this.propertyId;
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-write">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="Address">
</div>
<div class="form-row">
<label for="node-input-objectType"><i class="icon-bookmark"></i>Object Type</label>
<select id="node-input-objectType" placeholder="Object Type"></select>
</div>
<div class="form-row">
<label for="node-input-objectInstance"><i class="icon-bookmark"></i>Object Instance</label>
<input type="text" id="node-input-objectInstance" placeholder="Object Instance">
</div>
<div class="form-row">
<label for="node-input-propertyId"><i class="icon-bookmark"></i> Property ID</label>
<select id="node-input-propertyId" placeholder="Property ID"></select>
</div>
<div class="form-row">
<label for="node-input-priority"><i class="icon-bookmark"></i> Priority</label>
<input type="text" id="node-input-priority" placeholder="Priority">
</div>
<div class="form-row">
<label for="node-input-applicationTag"><i class="fa fa-empire"></i> Value Type</label>
<select id="node-input-applicationTag">
<option value="" disabled selected>Select your option</option>
<option value="0">Null</option>
<option value="1">Boolean</option>
<option value="2">Unsigned Int</option>
<option value="3">Signed Int</option>
<option value="4">Real</option>
<option value="5">Double</option>
<option value="6">Octect String</option>
<option value="7">Character String</option>
<option value="8">Bit String</option>
<option value="9">Enumerated</option>
<option value="10">Date</option>
<option value="11">Time</option>
<option value="12">Object Id</option>
<option value="13">Reserve 1</option>
<option value="14">Reserve 2</option>
<option value="15">Reserve 3</option>
</select>
</div>
<div class="form-row">
<label for="node-config-input-value"><i class="fa fa-empire"></i> Value</label>
<input type="text" id="node-input-value" placeholder="Value">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-write">
<p>The <code>writeProperty</code> command writes a single property of an object to a device. It accepts an input whose payload will override the properties set here.</p>
<ul>
<li><code>address</code> <em>[string]</em> - IP address of the target device.</li>
<li><code>objectType</code> <em>[number]</em> - The BACNET object type to write.</li>
<li><code>objectInstance</code> <em>[number]</em> - IP address of the target device.</li>
<li><code>propertyId</code> <em>[number]</em> - The BACNET property id in the specified object to write.</li>
<li><code>priority</code> <em>[number]</em> - The priority to be used for writing to the property.</li>
<li><code>valueList</code> <em>[array]</em> - A list of values to be written to the speicifed property. The <code>Tag</code> value has to be a <code>BacnetApplicationTags</code> declaration as specified in <code>lib/bacnet-enum.js</code>.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-write', {
category: 'BACnet',
color: '#E9967A',
defaults: {
name: {
value: ''
},
address: {
value: '',
required: false
},
objectType: {
value: '',
required: false,
validate: RED.validators.number()
},
objectInstance: {
value: '',
required: false,
validate: RED.validators.number()
},
propertyId: {
value: '',
required: false,
validate: RED.validators.number()
},
priority: {
value: '',
validate: RED.validators.number()
},
applicationTag: {
value: ''
},
value: {
value: '',
required: false
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'WriteProperty',
label: function() {
return (this.name || 'BACnet WriteProperty');
},
oneditprepare: function() {
var objectType = document.querySelector('select#node-input-objectType');
objectType.insertAdjacentHTML(
'afterbegin',
Object.keys(bacnetEnumProperties.objectTypes).map((key) =>
'<option value="' + bacnetEnumProperties.objectTypes[key] + '">' +
key + ' (' + bacnetEnumProperties.objectTypes[key] + ')' + '</option>'
).join('')
);
objectType.value = this.objectType;
var propertyId = document.querySelector('select#node-input-propertyId');
propertyId.insertAdjacentHTML(
'afterbegin',
Object.keys(bacnetEnumProperties.propertyTypes).map((key) =>
'<option value="' + bacnetEnumProperties.propertyTypes[key] + '">' +
key + ' (' + bacnetEnumProperties.propertyTypes[key] + ')' + '</option>'
).join('')
);
propertyId.value = this.propertyId;
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-read-multiple">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-read-multiple">
<p>The <code>readPropertyMultiple</code> command reads multiple properties from multiple device objects. It accepts address which can be override by input.</p>
<p>This node expects input to provide <code>requestyArray</code> property with the target read fields.</p>
<h3><code>requestArray</code></h3>
<dl class="message-properties">
<dt>objectIdentifier <span class="property-type">object</span></dt>
<dd>
<span>Specific object to read.</span>
<dl class="message-properties">
<dt>type <span class="property-type">number</span></dt>
<dd>Bacnet object type to read</dd>
<dt>instance <span class="property-type">number</span></dt>
<dd>Bacnet object instance to read.</dd>
</dl>
</dd>
<dt>propertyReferences <span class="property-type">Array<object></span></dt>
<dd>
<span>List of properties to read.</span>
<dl class="message-properties">
<dt>propertyIdentifier <span class="property-type">number</span></dt>
<dd>Bacnet property id to read. Supports 8 for all properties.</dd>
</dl>
</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-read-multiple', {
category: 'BACnet',
color: '#E9967A',
defaults: {
address: {
value: '',
required: false
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,