@bitpoolos/edge-bacnet 1.1.2 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bacnet_client.js CHANGED
@@ -335,8 +335,8 @@ class BacnetClient extends EventEmitter {
335
335
  if(!bacnetResults[deviceName]) bacnetResults[deviceName] = {};
336
336
  if(deviceObject) {
337
337
  for(const pointName in readConfig.pointsToRead[key]) {
338
- let bac_obj = that.getObjectType(readConfig.pointsToRead[key][pointName].objectID.type);
339
- let objectId = pointName + "_" + bac_obj + '_' + readConfig.pointsToRead[key][pointName].objectID.instance;
338
+ let bac_obj = that.getObjectType(readConfig.pointsToRead[key][pointName].meta.objectId.type);
339
+ let objectId = pointName + "_" + bac_obj + '_' + readConfig.pointsToRead[key][pointName].meta.objectId.instance;
340
340
  let point = deviceObject[objectId];
341
341
  bacnetResults[deviceName][pointName] = point;
342
342
  }
@@ -361,108 +361,6 @@ class BacnetClient extends EventEmitter {
361
361
  }
362
362
  }
363
363
 
364
- readDeviceAndEmitJSON(readPromiseArray, device, outputType, propertiesToRead, objectPropertyType, msgId) {
365
- let that = this;
366
- let deviceName = device.getDeviceName();
367
-
368
- let bacnetResults = {
369
- [deviceName]: []
370
- };
371
-
372
- try{
373
- Promise.all(readPromiseArray).then((result) => {
374
- let values = {};
375
-
376
- // remove errors and map to result element
377
- let successfulResults = result.filter(element => !element.error).map(element => element.value);
378
- successfulResults.forEach(element => {
379
- try {
380
- element.values.forEach(function(point){
381
- point.values.forEach(function(object) {
382
- let toReadProperty = propertiesToRead.findIndex(ele => ele.id == object.id);
383
- let objectName = that._findValueById(point.values, baEnum.PropertyIdentifier.OBJECT_NAME);
384
- //checks for error code json structure, returned for invalid bacnet requests
385
- if(!object.value.value && toReadProperty !== -1 && objectName !== "") {
386
- let objectId = objectName;
387
-
388
- //init json object
389
- if(!values[objectId]) values[objectId] = {};
390
-
391
- switch(object.id) {
392
- case baEnum.PropertyIdentifier.PRESENT_VALUE:
393
- if(object.value[0] &&
394
- object.value[0].value !== "undefined" &&
395
- object.value[0].value !== null &&
396
- typeof object.value[0].value == "number") {
397
- values[objectId].presentValue = roundDecimalPlaces(object.value[0].value, that.roundDecimal);
398
- } else if(object.value[0] &&
399
- object.value[0].value !== "undefined" &&
400
- object.value[0].value !== null &&
401
- typeof object.value[0].value == "string") {
402
- values[objectId].presentValue = object.value[0].value;
403
- }
404
- break;
405
- case baEnum.PropertyIdentifier.DESCRIPTION:
406
- if(object.value[0]) values[objectId].description = object.value[0].value;
407
- break;
408
- case baEnum.PropertyIdentifier.STATUS_FLAGS:
409
- if(object.value[0] && object.value[0].value) values[objectId].statusFlags = that.getStatusFlags(object);
410
- break;
411
- case baEnum.PropertyIdentifier.RELIABILITY:
412
- if(object.value[0]) values[objectId].reliability = that.getPROP_RELIABILITY(object.value[0].value);
413
- break;
414
- case baEnum.PropertyIdentifier.OUT_OF_SERVICE:
415
- if(object.value[0]) values[objectId].outOfService = object.value[0].value;
416
- break;
417
- case baEnum.PropertyIdentifier.UNITS:
418
- if(object.value[0] && object.value[0].value) values[objectId].units = getUnit(object.value[0].value);
419
- break;
420
- case baEnum.PropertyIdentifier.OBJECT_NAME:
421
- if(object.value[0] && object.value[0].value) values[objectId].objectName = object.value[0].value;
422
- break;
423
- case baEnum.PropertyIdentifier.SYSTEM_STATUS:
424
- if(object.value[0]){
425
- values[objectId].systemStatus = that.getPROP_SYSTEM_STATUS(object.value[0].value);
426
- }
427
- break;
428
- case baEnum.PropertyIdentifier.MODIFICATION_DATE:
429
- if(object.value[0]) {
430
- values[objectId].modificationDate = object.value[0].value;
431
- }
432
- break;
433
- case baEnum.PropertyIdentifier.PROGRAM_STATE:
434
- if(object.value[0]){
435
- values[objectId].programState = that.getPROP_PROGRAM_STATE(object.value[0].value);
436
- }
437
- break;
438
- case baEnum.PropertyIdentifier.RECORD_COUNT:
439
- if(object.value[0] ) {
440
- values[objectId].recordCount = object.value[0].value;
441
- }
442
- break;
443
- }
444
- }
445
- });
446
- });
447
- bacnetResults[deviceName] = values;
448
-
449
- } catch(e) {
450
- that.logOut("issue resolving bacnet payload, see error: ", e);
451
- }
452
- });
453
- if(Object.keys(bacnetResults[deviceName]).length !== 0) {
454
- that.emit('values', bacnetResults, outputType, objectPropertyType);
455
- }
456
-
457
- }).catch(function (error) {
458
- logger.log('error', `Error while fetching values: ${error}`);
459
- });
460
-
461
- } catch(e){
462
- that.logOut("Issue reading from device, see error: ", e);
463
- }
464
- }
465
-
466
364
  _getDeviceName(address, deviceId) {
467
365
  let that = this;
468
366
  return new Promise((resolve, reject) => {
@@ -1079,92 +977,91 @@ class BacnetClient extends EventEmitter {
1079
977
  let objectName = that._findValueById(pointProperty.values, baEnum.PropertyIdentifier.OBJECT_NAME);
1080
978
  let objectType = that._findValueById(pointProperty.values, baEnum.PropertyIdentifier.OBJECT_TYPE);
1081
979
  let objectId;
1082
- if(objectName !== null) {
980
+ if(objectName !== null && typeof objectName == "string") {
1083
981
  objectId = objectName + "_" + bac_obj + '_' + pointProperty.objectId.instance;
1084
- } else {
1085
- objectId = bac_obj + '_' + pointProperty.objectId.instance;
1086
- }
1087
- try {
1088
- pointProperty.values.forEach(function(object, objectIndex) {
1089
- //checks for error code json structure, returned for invalid bacnet requests
1090
- if(object && object.value && !object.value.errorClass) {
1091
-
1092
- if(!values[objectId]) values[objectId] = {};
1093
- values[objectId].meta = {
1094
- objectId: pointProperty.objectId
1095
- };
1096
-
1097
- switch(object.id) {
1098
- case baEnum.PropertyIdentifier.PRESENT_VALUE:
1099
- if(object.value[0] && object.value[0].value !== "undefined" && object.value[0].value !== null) {
1100
- //check for binary object type
1101
- if(objectType == 3 || objectType == 4 || objectType == 5) {
1102
- if(object.value[0].value == 0) {
1103
- values[objectId].presentValue = false;
1104
- } else if(object.value[0].value == 1) {
1105
- values[objectId].presentValue = true;
982
+
983
+ try {
984
+ pointProperty.values.forEach(function(object, objectIndex) {
985
+ //checks for error code json structure, returned for invalid bacnet requests
986
+ if(object && object.value && !object.value.errorClass) {
987
+
988
+ if(!values[objectId]) values[objectId] = {};
989
+ values[objectId].meta = {
990
+ objectId: pointProperty.objectId
991
+ };
992
+
993
+ switch(object.id) {
994
+ case baEnum.PropertyIdentifier.PRESENT_VALUE:
995
+ if(object.value[0] && object.value[0].value !== "undefined" && object.value[0].value !== null) {
996
+ //check for binary object type
997
+ if(objectType == 3 || objectType == 4 || objectType == 5) {
998
+ if(object.value[0].value == 0) {
999
+ values[objectId].presentValue = false;
1000
+ } else if(object.value[0].value == 1) {
1001
+ values[objectId].presentValue = true;
1002
+ }
1003
+ } else if(objectType == 40) {
1004
+ //character string
1005
+ values[objectId].presentValue = object.value[0].value;
1006
+ } else {
1007
+ values[objectId].presentValue = roundDecimalPlaces(object.value[0].value, 2);
1106
1008
  }
1107
- } else if(objectType == 40) {
1108
- //character string
1109
- values[objectId].presentValue = object.value[0].value;
1110
- } else {
1111
- values[objectId].presentValue = roundDecimalPlaces(object.value[0].value, 2);
1009
+ }
1010
+ values[objectId].meta.arrayIndex = object.index;
1011
+ break;
1012
+ case baEnum.PropertyIdentifier.DESCRIPTION:
1013
+ if(object.value[0]) values[objectId].description = object.value[0].value;
1014
+ break;
1015
+ case baEnum.PropertyIdentifier.UNITS:
1016
+ if(object.value[0] && object.value[0].value) values[objectId].units = getUnit(object.value[0].value);
1017
+ break;
1018
+ case baEnum.PropertyIdentifier.OBJECT_NAME:
1019
+ if(object.value[0] && object.value[0].value) values[objectId].objectName = object.value[0].value;
1020
+ break;
1021
+ case baEnum.PropertyIdentifier.OBJECT_TYPE:
1022
+ if(object.value[0] && object.value[0].value) values[objectId].objectType = object.value[0].value;
1023
+ break;
1024
+ case baEnum.PropertyIdentifier.OBJECT_IDENTIFIER:
1025
+ if(object.value[0] && object.value[0].value) values[objectId].objectID = object.value[0].value;
1026
+ break;
1027
+ case baEnum.PropertyIdentifier.PROPERTY_LIST:
1028
+ if(object.value) values[objectId].propertyList = that.mapPropsToArray(object.value);
1029
+ break;
1030
+
1031
+ case baEnum.PropertyIdentifier.SYSTEM_STATUS:
1032
+ if(object.value[0]){
1033
+ values[objectId].systemStatus = that.getPROP_SYSTEM_STATUS(object.value[0].value);
1034
+ }
1035
+ break;
1036
+
1037
+ case baEnum.PropertyIdentifier.MODIFICATION_DATE:
1038
+ if(object.value[0]) {
1039
+ values[objectId].modificationDate = object.value[0].value;
1112
1040
  }
1113
- }
1114
- values[objectId].meta.arrayIndex = object.index;
1115
- break;
1116
- case baEnum.PropertyIdentifier.DESCRIPTION:
1117
- if(object.value[0]) values[objectId].description = object.value[0].value;
1118
- break;
1119
- case baEnum.PropertyIdentifier.UNITS:
1120
- if(object.value[0] && object.value[0].value) values[objectId].units = getUnit(object.value[0].value);
1121
- break;
1122
- case baEnum.PropertyIdentifier.OBJECT_NAME:
1123
- if(object.value[0] && object.value[0].value) values[objectId].objectName = object.value[0].value;
1124
- break;
1125
- case baEnum.PropertyIdentifier.OBJECT_TYPE:
1126
- if(object.value[0] && object.value[0].value) values[objectId].objectType = object.value[0].value;
1127
- break;
1128
- case baEnum.PropertyIdentifier.OBJECT_IDENTIFIER:
1129
- if(object.value[0] && object.value[0].value) values[objectId].objectID = object.value[0].value;
1130
- break;
1131
- case baEnum.PropertyIdentifier.PROPERTY_LIST:
1132
- if(object.value) values[objectId].propertyList = that.mapPropsToArray(object.value);
1133
- break;
1041
+ break;
1134
1042
 
1135
- case baEnum.PropertyIdentifier.SYSTEM_STATUS:
1136
- if(object.value[0]){
1137
- values[objectId].systemStatus = that.getPROP_SYSTEM_STATUS(object.value[0].value);
1138
- }
1139
- break;
1140
-
1141
- case baEnum.PropertyIdentifier.MODIFICATION_DATE:
1142
- if(object.value[0]) {
1143
- values[objectId].modificationDate = object.value[0].value;
1144
- }
1145
- break;
1146
-
1147
- case baEnum.PropertyIdentifier.PROGRAM_STATE:
1148
- if(object.value[0]){
1149
- values[objectId].programState = that.getPROP_PROGRAM_STATE(object.value[0].value);
1150
- }
1151
- break;
1152
-
1153
- case baEnum.PropertyIdentifier.RECORD_COUNT:
1154
- if(object.value[0] ) {
1155
- values[objectId].recordCount = object.value[0].value;
1156
- }
1157
- break;
1043
+ case baEnum.PropertyIdentifier.PROGRAM_STATE:
1044
+ if(object.value[0]){
1045
+ values[objectId].programState = that.getPROP_PROGRAM_STATE(object.value[0].value);
1046
+ }
1047
+ break;
1048
+
1049
+ case baEnum.PropertyIdentifier.RECORD_COUNT:
1050
+ if(object.value[0] ) {
1051
+ values[objectId].recordCount = object.value[0].value;
1052
+ }
1053
+ break;
1054
+ }
1158
1055
  }
1159
- }
1160
- if(pointPropertyIndex == successfulResult.values.length - 1 && objectIndex == pointProperty.values.length - 1 && i == fullObjects.length - 1) {
1161
- that.networkTree[deviceKey] = values;
1162
- resolve(that.networkTree);
1163
- }
1164
- });
1165
- } catch(e) {
1166
- that.logOut("issue resolving bacnet payload, see error: ", e);
1167
- reject(e);
1056
+ if(pointPropertyIndex == successfulResult.values.length - 1 && objectIndex == pointProperty.values.length - 1 && i == fullObjects.length - 1) {
1057
+ that.networkTree[deviceKey] = values;
1058
+ resolve(that.networkTree);
1059
+ }
1060
+ });
1061
+ } catch(e) {
1062
+ that.logOut("issue resolving bacnet payload, see error: ", e);
1063
+ reject(e);
1064
+ }
1168
1065
  }
1169
1066
  });
1170
1067
  } else {
@@ -474,10 +474,13 @@
474
474
 
475
475
  <h3><strong>Examples</strong></h3>
476
476
  <p>For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu on top right -> Import -> Examples -> @bitpoolos/edge-bacnet</p>
477
- <p>To find screen shot examples of settings and flows, please go to our wiki <a href="https://wiki.bitpool.com/en/edge/apps/bitpool-edge/nr-bacnet">here</a></p>
477
+ <p>To find captured examples of settings and flows, please go to our wiki <a href="https://wiki.bitpool.com/en/edge/apps/bitpool-edge/nr-bacnet">here</a></p>
478
478
 
479
479
 
480
480
  <h3>Resources:</h3>
481
+
482
+ <p><a href="https://youtu.be/4K7mVxfvfbc">Video Walk-through </a></p>
483
+
481
484
  <h4><strong>Online Docs:</strong></h4>
482
485
  <ul type="1">
483
486
  <li><a href="https://www.bitpool.com/">bitpool.com</a> - check us out here.</li>
package/bacnet_gateway.js CHANGED
@@ -304,23 +304,26 @@ module.exports = function (RED) {
304
304
  if(device !== "_msgid") {
305
305
  let points = values[device];
306
306
  for(var point in points) {
307
- let pointProps = Object.keys(points[point]);
308
- pointProps.forEach(function(prop) {
309
- let msg = {};
310
- if(prop == "presentValue") {
311
- if(node.nodeName !== "gateway" &&
312
- node.nodeName !== "" &&
313
- node.nodeName !== "null" &&
314
- node.nodeName !== "undefined" &&
315
- typeof node.nodeName == "string") {
316
- msg.topic = `${node.nodeName}/${device}/${point}`;
317
- } else {
318
- msg.topic = `BITPOOL_BACNET_GATEWAY/${device}/${point}`;
307
+ if(points[point]){
308
+ let pointProps = Object.keys(points[point]);
309
+ pointProps.forEach(function(prop) {
310
+ let msg = {};
311
+ if(prop == "presentValue") {
312
+ if(node.nodeName !== "gateway" &&
313
+ node.nodeName !== "" &&
314
+ node.nodeName !== "null" &&
315
+ node.nodeName !== "undefined" &&
316
+ typeof node.nodeName == "string") {
317
+ msg.topic = `${node.nodeName}/${device}/${point}`;
318
+ } else {
319
+ msg.topic = `BITPOOL_BACNET_GATEWAY/${device}/${point}`;
320
+ }
321
+ msg.payload = points[point][prop];
322
+ node.send(msg);
319
323
  }
320
- msg.payload = points[point][prop];
321
- node.send(msg);
322
- }
323
- });
324
+ });
325
+
326
+ }
324
327
  }
325
328
  }
326
329
  });
@@ -333,23 +336,25 @@ module.exports = function (RED) {
333
336
  if(device !== "_msgid") {
334
337
  let points = values[device];
335
338
  for(var point in points) {
336
- let pointProps = Object.keys(points[point]);
337
- pointProps.forEach(function(prop) {
338
- let msg = {};
339
- if(prop !== "objectName") {
340
- if(node.nodeName !== "gateway" &&
341
- node.nodeName !== "" &&
342
- node.nodeName !== "null" &&
343
- node.nodeName !== "undefined" &&
344
- typeof node.nodeName == "string") {
345
- msg.topic = `${node.nodeName}/${device}/${point}/${prop}`;
346
- } else {
347
- msg.topic = `BITPOOL_BACNET_GATEWAY/${device}/${point}/${prop}`;
339
+ if(points[point]){
340
+ let pointProps = Object.keys(points[point]);
341
+ pointProps.forEach(function(prop) {
342
+ let msg = {};
343
+ if(prop !== "objectName") {
344
+ if(node.nodeName !== "gateway" &&
345
+ node.nodeName !== "" &&
346
+ node.nodeName !== "null" &&
347
+ node.nodeName !== "undefined" &&
348
+ typeof node.nodeName == "string") {
349
+ msg.topic = `${node.nodeName}/${device}/${point}/${prop}`;
350
+ } else {
351
+ msg.topic = `BITPOOL_BACNET_GATEWAY/${device}/${point}/${prop}`;
352
+ }
353
+ msg.payload = points[point][prop];
354
+ node.send(msg);
348
355
  }
349
- msg.payload = points[point][prop];
350
- node.send(msg);
351
- }
352
- });
356
+ });
357
+ }
353
358
  }
354
359
  }
355
360
  });
@@ -358,22 +363,37 @@ module.exports = function (RED) {
358
363
  sendSimpleJson = function(values) {
359
364
  let devices = Object.keys(values);
360
365
  devices.forEach(function(device) {
366
+ let msgg = {};
361
367
  if(device !== "_msgid") {
362
368
  let value = {
363
369
  [device]: {}
364
370
  };
365
371
  let points = values[device];
372
+
366
373
  for(var point in points) {
367
- let pointProps = Object.keys(points[point]);
368
- pointProps.forEach(function(prop) {
369
- if(prop == "presentValue") {
370
- value[device][point] = {
371
- "presentValue": points[point][prop]
372
- };
373
- }
374
- });
374
+ if(points[point]){
375
+ let pointProps = Object.keys(points[point]);
376
+ pointProps.forEach(function(prop) {
377
+ if(prop == "presentValue") {
378
+ value[device][point] = {
379
+ "presentValue": points[point][prop]
380
+ };
381
+ }
382
+ });
383
+ }
384
+
385
+ }
386
+ if(node.nodeName !== "gateway" &&
387
+ node.nodeName !== "" &&
388
+ node.nodeName !== "null" &&
389
+ node.nodeName !== "undefined" &&
390
+ typeof node.nodeName == "string") {
391
+ msgg.topic = `${node.nodeName}/${device}`;
392
+ } else {
393
+ msgg.topic = `BITPOOL_BACNET_GATEWAY/${device}`;
375
394
  }
376
- node.send(value);
395
+ msgg.payload = value[device];
396
+ node.send(msgg);
377
397
  }
378
398
  });
379
399
  };
package/bacnet_read.html CHANGED
@@ -849,7 +849,17 @@
849
849
 
850
850
  </ol>
851
851
 
852
+ <h3><strong>Examples</strong></h3>
853
+ <p>For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu on top right -> Import -> Examples -> @bitpoolos/edge-bacnet</p>
854
+ <p>To find captured examples of settings and flows, please go to our wiki <a href="https://wiki.bitpool.com/en/edge/apps/bitpool-edge/nr-bacnet">here</a></p>
855
+
856
+
857
+
858
+
852
859
  <h3>Resources:</h3>
860
+
861
+ <p><a href="https://youtu.be/4K7mVxfvfbc">Video Walk-through </a></p>
862
+
853
863
  <h4><strong>Online Docs:</strong></h4>
854
864
  <ul type="1">
855
865
  <li><a href="https://www.bitpool.com/">bitpool.com</a> - check us out here.</li>
package/bacnet_write.html CHANGED
@@ -634,7 +634,13 @@
634
634
 
635
635
  </ol>
636
636
 
637
+ <h3><strong>Examples</strong></h3>
638
+ <p>For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu on top right -> Import -> Examples -> @bitpoolos/edge-bacnet</p>
639
+ <p>To find captured examples of settings and flows, please go to our wiki <a href="https://wiki.bitpool.com/en/edge/apps/bitpool-edge/nr-bacnet">here</a></p>
640
+
641
+
637
642
  <h3>Resources:</h3>
643
+ <p><a href="https://youtu.be/4K7mVxfvfbc">Video Walk-through </a></p>
638
644
  <h4><strong>Online Docs:</strong></h4>
639
645
  <ul type="1">
640
646
  <li><a href="https://www.bitpool.com/">bitpool.com</a> - check us out here.</li>
@@ -792,7 +792,13 @@
792
792
 
793
793
  </ol>
794
794
 
795
+ <h3><strong>Examples</strong></h3>
796
+ <p>For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu on top right -> Import -> Examples -> @bitpoolos/edge-bacnet</p>
797
+ <p>To find captured examples of settings and flows, please go to our wiki <a href="https://wiki.bitpool.com/en/edge/apps/bitpool-edge/nr-bacnet">here</a></p>
798
+
799
+
795
800
  <h3>Resources:</h3>
801
+ <p><a href="https://youtu.be/4K7mVxfvfbc">Video Walk-through </a></p>
796
802
  <h4><strong>Online Docs:</strong></h4>
797
803
  <ul type="1">
798
804
  <li><a href="https://www.bitpool.com/">bitpool.com</a> - check us out here.</li>
@@ -1 +1 @@
1
- [{"id":"b3017f8f9fc73f8c","type":"tab","label":"1-Discover-Read","disabled":false,"info":"","env":[]},{"id":"697c8ed4b294882c","type":"Bacnet-Gateway","z":"b3017f8f9fc73f8c","name":"","local_device_address":"","apduTimeout":6000,"roundDecimal":2,"local_device_port":47808,"apduSize":"5","maxSegments":"0x50","broadCastAddr":"255.255.255.255","toLogIam":true,"discover_polling_schedule":"60","discover_polling_schedule_value":"1","discover_polling_schedule_options":"Minutes","x":540,"y":300,"wires":[["d78c0f4d2fb9befa"]]},{"id":"e6c39865833d0dcd","type":"Bacnet-Discovery","z":"b3017f8f9fc73f8c","name":"","events":true,"json":true,"mqtt":false,"hiddenDeployToggle":false,"prevHiddenToggleState":false,"roundDecimal":2,"pointsToRead":{},"readDevices":[],"object_property_presentVal":true,"object_property_objDescription":false,"object_property_statusFlag":false,"object_property_reliability":false,"object_property_outOfService":false,"object_property_units":false,"x":370,"y":240,"wires":[["697c8ed4b294882c"]]},{"id":"d129d123e7eedbca","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Discover","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":false,"doDiscover":true,"x":360,"y":300,"wires":[["697c8ed4b294882c"]]},{"id":"2dc599ab69789b27","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":true,"doDiscover":false,"x":190,"y":240,"wires":[["e6c39865833d0dcd"]]},{"id":"d78c0f4d2fb9befa","type":"debug","z":"b3017f8f9fc73f8c","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":300,"wires":[]}]
1
+ [{"id":"29e22a8fbd476c06","type":"tab","label":"Discover-Read","disabled":false,"info":"","env":[]},{"id":"697c8ed4b294882c","type":"Bacnet-Gateway","z":"29e22a8fbd476c06","name":"","local_device_address":"","apduTimeout":6000,"roundDecimal":2,"local_device_port":47808,"apduSize":"5","maxSegments":"0x50","broadCastAddr":"255.255.255.255","toLogIam":true,"discover_polling_schedule":"60","discover_polling_schedule_value":"1","discover_polling_schedule_options":"Minutes","device_id_range_enabled":false,"device_id_range_start":"","device_id_range_end":"","deviceId":"817001","manual_instance_range_enabled":false,"manual_instance_range_start":"","manual_instance_range_end":"","logErrorToConsole":false,"serverEnabled":false,"bacnetServerRebuildSchedule":"604800","bacnetServerRebuildSchedule_value":"7","bacnetServerRebuildSchedule_options":"Days","x":640,"y":380,"wires":[["d78c0f4d2fb9befa"]]},{"id":"d129d123e7eedbca","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Discover","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":false,"doDiscover":true,"x":460,"y":380,"wires":[["697c8ed4b294882c"]]},{"id":"2dc599ab69789b27","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":true,"doDiscover":false,"x":290,"y":320,"wires":[["282edf29720defca"]]},{"id":"d78c0f4d2fb9befa","type":"debug","z":"29e22a8fbd476c06","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":820,"y":380,"wires":[]},{"id":"282edf29720defca","type":"Bacnet-Discovery","z":"29e22a8fbd476c06","name":"","events":true,"json":false,"mqtt":true,"hiddenDeployToggle":false,"prevHiddenToggleState":false,"roundDecimal":2,"pointsToRead":{},"readDevices":[],"object_property_simplePayload":true,"object_property_fullObject":false,"x":470,"y":320,"wires":[["697c8ed4b294882c"]]}]
@@ -1 +1 @@
1
- [{"id":"b3017f8f9fc73f8c","type":"tab","label":"2-Discover-Write","disabled":false,"info":"","env":[]},{"id":"697c8ed4b294882c","type":"Bacnet-Gateway","z":"b3017f8f9fc73f8c","name":"","local_device_address":"","apduTimeout":6000,"roundDecimal":2,"local_device_port":47808,"apduSize":"5","maxSegments":"0x50","broadCastAddr":"255.255.255.255","toLogIam":true,"discover_polling_schedule":"60","discover_polling_schedule_value":"1","discover_polling_schedule_options":"Minutes","x":540,"y":300,"wires":[["d78c0f4d2fb9befa"]]},{"id":"d129d123e7eedbca","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Discover","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":false,"doDiscover":true,"x":360,"y":300,"wires":[["697c8ed4b294882c"]]},{"id":"2dc599ab69789b27","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","doPoll":true,"doDiscover":false,"x":210,"y":380,"wires":[["ddd7b312831cf439"]]},{"id":"d78c0f4d2fb9befa","type":"debug","z":"b3017f8f9fc73f8c","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":300,"wires":[]},{"id":"ddd7b312831cf439","type":"Bacnet-Write","z":"b3017f8f9fc73f8c","name":"","applicationTag":"4","priority":"16","pointsToWrite":[],"writeDevices":[],"hiddenDeployToggle":false,"prevHiddenToggleState":false,"x":370,"y":380,"wires":[["697c8ed4b294882c"]]}]
1
+ [{"id":"29e22a8fbd476c06","type":"tab","label":"Discover-Write","disabled":false,"info":"","env":[]},{"id":"e478e80571442399","type":"Bacnet-Gateway","z":"29e22a8fbd476c06","name":"","local_device_address":"","apduTimeout":6000,"roundDecimal":2,"local_device_port":47808,"apduSize":"5","maxSegments":"0x50","broadCastAddr":"255.255.255.255","toLogIam":true,"discover_polling_schedule":"60","discover_polling_schedule_value":"1","discover_polling_schedule_options":"Minutes","device_id_range_enabled":false,"device_id_range_start":"","device_id_range_end":"","deviceId":"817001","manual_instance_range_enabled":false,"manual_instance_range_start":"","manual_instance_range_end":"","logErrorToConsole":false,"serverEnabled":false,"bacnetServerRebuildSchedule":"604800","bacnetServerRebuildSchedule_value":"7","bacnetServerRebuildSchedule_options":"Days","x":620,"y":320,"wires":[["0313b7ee1cfa6b42"]]},{"id":"c2e012301c4a6af4","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Discover","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":false,"doDiscover":true,"x":440,"y":320,"wires":[["e478e80571442399"]]},{"id":"8172620e7be7b505","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","doPoll":true,"doDiscover":false,"x":290,"y":400,"wires":[["b3293195b7c5bd9d"]]},{"id":"0313b7ee1cfa6b42","type":"debug","z":"29e22a8fbd476c06","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":800,"y":320,"wires":[]},{"id":"b3293195b7c5bd9d","type":"Bacnet-Write","z":"29e22a8fbd476c06","name":"","applicationTag":"4","priority":"16","pointsToWrite":[],"writeDevices":[],"hiddenDeployToggle":false,"prevHiddenToggleState":false,"x":450,"y":400,"wires":[["e478e80571442399"]]}]
@@ -1 +1 @@
1
- [{"id":"b3017f8f9fc73f8c","type":"tab","label":"3-Discover-Read-Write","disabled":false,"info":"","env":[]},{"id":"697c8ed4b294882c","type":"Bacnet-Gateway","z":"b3017f8f9fc73f8c","name":"","local_device_address":"","apduTimeout":6000,"roundDecimal":2,"local_device_port":47808,"apduSize":"5","maxSegments":"0x50","broadCastAddr":"255.255.255.255","toLogIam":true,"discover_polling_schedule":"60","discover_polling_schedule_value":"1","discover_polling_schedule_options":"Minutes","x":540,"y":300,"wires":[["d78c0f4d2fb9befa"]]},{"id":"d129d123e7eedbca","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Discover","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":false,"doDiscover":true,"x":360,"y":300,"wires":[["697c8ed4b294882c"]]},{"id":"2dc599ab69789b27","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","doPoll":true,"doDiscover":false,"x":210,"y":380,"wires":[["ddd7b312831cf439"]]},{"id":"d78c0f4d2fb9befa","type":"debug","z":"b3017f8f9fc73f8c","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":300,"wires":[]},{"id":"ddd7b312831cf439","type":"Bacnet-Write","z":"b3017f8f9fc73f8c","name":"","applicationTag":"4","priority":"16","pointsToWrite":[],"writeDevices":[],"hiddenDeployToggle":false,"prevHiddenToggleState":false,"x":370,"y":380,"wires":[["697c8ed4b294882c"]]},{"id":"e7ae4def79edb9b3","type":"Bacnet-Discovery","z":"b3017f8f9fc73f8c","name":"","events":true,"json":true,"mqtt":false,"hiddenDeployToggle":false,"prevHiddenToggleState":false,"roundDecimal":2,"pointsToRead":{},"readDevices":[],"object_property_presentVal":true,"object_property_objDescription":false,"object_property_statusFlag":false,"object_property_reliability":false,"object_property_outOfService":false,"object_property_units":false,"x":370,"y":240,"wires":[["697c8ed4b294882c"]]},{"id":"9f62e732434757e0","type":"Bitpool-Inject","z":"b3017f8f9fc73f8c","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":true,"doDiscover":false,"x":210,"y":240,"wires":[["e7ae4def79edb9b3"]]}]
1
+ [{"id":"29e22a8fbd476c06","type":"tab","label":"Discover-Read-Write","disabled":false,"info":"","env":[]},{"id":"e6ef82c5497d2d12","type":"Bacnet-Gateway","z":"29e22a8fbd476c06","name":"","local_device_address":"","apduTimeout":6000,"roundDecimal":2,"local_device_port":47808,"apduSize":"5","maxSegments":"0x50","broadCastAddr":"255.255.255.255","toLogIam":true,"discover_polling_schedule":"60","discover_polling_schedule_value":"1","discover_polling_schedule_options":"Minutes","device_id_range_enabled":false,"device_id_range_start":"","device_id_range_end":"","deviceId":"817001","manual_instance_range_enabled":false,"manual_instance_range_start":"","manual_instance_range_end":"","logErrorToConsole":false,"serverEnabled":false,"bacnetServerRebuildSchedule":"604800","bacnetServerRebuildSchedule_value":"7","bacnetServerRebuildSchedule_options":"Days","x":660,"y":360,"wires":[["13c868a66ecd17df"]]},{"id":"4df39409775f724e","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Discover","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":false,"doDiscover":true,"x":480,"y":360,"wires":[["e6ef82c5497d2d12"]]},{"id":"67e4f714757a028e","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","doPoll":true,"doDiscover":false,"x":330,"y":440,"wires":[["b8931cb1a1c69ffb"]]},{"id":"13c868a66ecd17df","type":"debug","z":"29e22a8fbd476c06","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":840,"y":360,"wires":[]},{"id":"b8931cb1a1c69ffb","type":"Bacnet-Write","z":"29e22a8fbd476c06","name":"","applicationTag":"4","priority":"16","pointsToWrite":[],"writeDevices":[],"hiddenDeployToggle":false,"prevHiddenToggleState":false,"x":490,"y":440,"wires":[["e6ef82c5497d2d12"]]},{"id":"a95e261a4cc2662b","type":"Bitpool-Inject","z":"29e22a8fbd476c06","name":"Poll","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","doPoll":true,"doDiscover":false,"x":330,"y":300,"wires":[["08df19608ade8576"]]},{"id":"08df19608ade8576","type":"Bacnet-Discovery","z":"29e22a8fbd476c06","name":"","events":true,"json":false,"mqtt":true,"hiddenDeployToggle":false,"prevHiddenToggleState":false,"roundDecimal":2,"pointsToRead":{},"readDevices":[],"object_property_simplePayload":true,"object_property_fullObject":false,"x":490,"y":300,"wires":[["e6ef82c5497d2d12"]]}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitpoolos/edge-bacnet",
3
- "version": "1.1.2",
3
+ "version": "1.1.5",
4
4
  "description": "A bacnet gateway for node-red",
5
5
  "dependencies": {
6
6
  "async-mutex": "^0.4.0",
@@ -18,8 +18,6 @@
18
18
  "Bacnet-Gateway": "bacnet_gateway.js",
19
19
  "Bacnet-Discovery": "bacnet_read.js",
20
20
  "Bacnet-Write": "bacnet_write.js",
21
- "Bitpool-Bacnet-Device": "bacnet_device.js",
22
- "Bitpool-Bacnet-Object": "bacnet_object.js",
23
21
  "Bitpool-Inject": "bitpool_inject.js"
24
22
  }
25
23
  },
@@ -1,131 +0,0 @@
1
- <!--
2
- MIT License Copyright 2021, 2022 - Bitpool Pty Ltd
3
- -->
4
-
5
- <script type="text/javascript">
6
- RED.nodes.registerType('Bitpool-Bacnet-Object',{
7
- category: 'config',
8
- color: '#00aeef',
9
- defaults: {
10
- name: {value:""},
11
- object_type_ai: {value: true},
12
- object_type_ao: {value: false},
13
- object_type_av: {value: false},
14
- object_type_bi: {value: false},
15
- object_type_bo: {value: false},
16
- object_type_bv: {value: false},
17
- object_type_mi: {value: false},
18
- object_type_mo: {value: false},
19
- object_type_mv: {value: false},
20
- object_property_presentVal: {value: true},
21
- object_property_objDescription: {value: false},
22
- object_property_statusFlag: {value: false},
23
- object_property_reliability: {value: false},
24
- object_property_outOfService: {value: false},
25
- object_property_units: {value: false},
26
- instance_start: {value: "", required: true},
27
- instance_end: {value: "", required: true}
28
- },
29
- inputs:1,
30
- outputs:1,
31
- icon: "icon.png",
32
- label: function() {
33
- return this.name||"Bitpool-Bacnet-Object";
34
- },
35
- oneditprepare: function() {
36
- }
37
- });
38
-
39
- </script>
40
-
41
- <script type="text/html" data-template-name="Bitpool-Bacnet-Object">
42
- <div class="form-row">
43
- <label for="node-config-input-name"><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.name"></span> Name</label>
44
- <input type="text" id="node-config-input-name" placeholder="Config Name" style="margin-left: 45px; width: 350px;">
45
- </div>
46
-
47
- <div class="form-row" style="display: inline-flex; width: fit-content; align-items: center;">
48
- <label for="node-config-input-instance" ><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.instance"></span>Instance Range</label>
49
- <div id="node-config-input-instance">
50
- <label for="node-config-input-instance_start" style="flex-basis: content; width: 75px; padding-left: 45px;"> Start</label>
51
- <input type="text" id="node-config-input-instance_start" placeholder="101" style="width: 55px;">
52
-
53
- <label for="node-config-input-instance_end" style="flex-basis: content; width: 30px;"> End</label>
54
- <input type="text" id="node-config-input-instance_end" placeholder="102" style="width: 55px;">
55
-
56
- </div>
57
-
58
- </div>
59
-
60
- <br>
61
-
62
- <div class="form-row" style="display: inline-flex; width: fit-content; flex-wrap: nowrap;">
63
- <label for="node-config-input-object_type_group"><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.object_type_group"></span> Object Type</label>
64
- <div id="node-config-input-object_type_group" style="display: flex; padding-left: 45px;">
65
- <label for="node-config-input-object_type_ai" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_ai"></span>AI
66
- <input type="checkbox" id="node-config-input-object_type_ai">
67
- </label>
68
-
69
- <label for="node-config-input-object_type_ao" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_ao"></span>AO
70
- <input type="checkbox" id="node-config-input-object_type_ao">
71
- </label>
72
-
73
- <label for="node-config-input-object_type_av" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_av"></span>AV
74
- <input type="checkbox" id="node-config-input-object_type_av">
75
- </label>
76
-
77
- <label for="node-config-input-object_type_bi" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_bi"></span>BI
78
- <input type="checkbox" id="node-config-input-object_type_bi">
79
- </label>
80
-
81
- <label for="node-config-input-object_type_bo" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_bo"></span>BO
82
- <input type="checkbox" id="node-config-input-object_type_bo">
83
- </label>
84
-
85
- <label for="node-config-input-object_type_bv" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_bv"></span>BV
86
- <input type="checkbox" id="node-config-input-object_type_bv">
87
- </label>
88
-
89
- <label for="node-config-input-object_type_mi" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_mi"></span>MI
90
- <input type="checkbox" id="node-config-input-object_type_mi">
91
- </label>
92
- <label for="node-config-input-object_type_mo" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_mo"></span>MO
93
- <input type="checkbox" id="node-config-input-object_type_mo">
94
- </label>
95
- <label for="node-config-input-object_type_mv" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_type_mv"></span>MV
96
- <input type="checkbox" id="node-config-input-object_type_mv">
97
- </label>
98
- </div>
99
- </div>
100
-
101
- <br>
102
-
103
- <div class="form-row" style="display: inline-flex; width: fit-content; flex-wrap: nowrap;">
104
- <label for="node-config-input-object_properties_group"><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.object_properties_group"></span> Object Properties</label>
105
- <div id="node-config-input-object_properties_group" style="display: flex; padding-left: 45px;">
106
- <label for="node-config-input-object_property_presentVal" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_presentVal"></span>Present Value
107
- <input type="checkbox" id="node-config-input-object_property_presentVal">
108
- </label>
109
-
110
- <label for="node-config-input-object_property_objDescription" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_objDescription"></span>Description
111
- <input type="checkbox" id="node-config-input-object_property_objDescription">
112
- </label>
113
-
114
- <label for="node-config-input-object_property_statusFlag" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_statusFlag"></span>Status Flags
115
- <input type="checkbox" id="node-config-input-object_property_statusFlag">
116
- </label>
117
-
118
- <label for="node-config-input-object_property_reliability" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_reliability"></span>Reliability
119
- <input type="checkbox" id="node-config-input-object_property_reliability">
120
- </label>
121
-
122
- <label for="node-config-input-object_property_outOfService" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_outOfService"></span>Out of Service
123
- <input type="checkbox" id="node-config-input-object_property_outOfService">
124
- </label>
125
-
126
- <label for="node-config-input-object_property_units" style="flex-basis: content; padding-right: 20px;"><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_units"></span>Units
127
- <input type="checkbox" id="node-config-input-object_property_units">
128
- </label>
129
- </div>
130
- </div>
131
- </script>
package/bacnet_object.js DELETED
@@ -1,121 +0,0 @@
1
- /*
2
- MIT License Copyright 2021, 2022 - Bitpool Pty Ltd
3
- */
4
-
5
- module.exports = function (RED) {
6
- const baEnum = require('./resources/node-bacnet/index.js').enum;
7
- function BitpoolBacnetObject (config) {
8
- RED.nodes.createNode(this, config)
9
-
10
- this.object_type_ai = config.object_type_ai;
11
- this.object_type_ao = config.object_type_ao;
12
- this.object_type_av = config.object_type_av;
13
- this.object_type_bi = config.object_type_bi;
14
- this.object_type_bo = config.object_type_bo;
15
- this.object_type_bv = config.object_type_bv;
16
-
17
- this.object_type_mi = config.object_type_mi;
18
- this.object_type_mo = config.object_type_mo;
19
- this.object_type_mv = config.object_type_mv;
20
-
21
- this.object_type = getObjectTypes(this);
22
-
23
- this.object_property_presentVal = config.object_property_presentVal;
24
- this.object_property_objDescription = config.object_property_objDescription;
25
- this.object_property_statusFlag = config.object_property_statusFlag;
26
- this.object_property_reliability = config.object_property_reliability;
27
- this.object_property_outOfService = config.object_property_outOfService;
28
- this.object_property_units = config.object_property_units;
29
- this.object_props = getObjectProps(this);
30
-
31
- this.instance_start = config.instance_start;
32
- this.instance_end = config.instance_end;
33
-
34
- this.instance = getInstanceRange(this);
35
-
36
- function getObjectTypes(node) {
37
- var typeArr = [];
38
- if(node.object_type_ai == true){
39
- typeArr.push("0");
40
- }
41
- if(node.object_type_ao == true){
42
- typeArr.push("1");
43
- }
44
- if(node.object_type_av == true){
45
- typeArr.push("2");
46
- }
47
- if(node.object_type_bi == true){
48
- typeArr.push("3");
49
- }
50
- if(node.object_type_bo == true){
51
- typeArr.push("4");
52
- }
53
- if(node.object_type_bv == true){
54
- typeArr.push("5");
55
- }
56
- if(node.object_type_mi == true){
57
- typeArr.push("13");
58
- }
59
- if(node.object_type_mo == true){
60
- typeArr.push("14");
61
- }
62
- if(node.object_type_mv == true){
63
- typeArr.push("19");
64
- }
65
-
66
- return typeArr.join();
67
- };
68
-
69
- function getObjectProps(node){
70
- var propArr = [];
71
- if(node.object_property_presentVal == true){
72
- propArr.push({ id: baEnum.PropertyIds.PROP_PRESENT_VALUE });
73
- }
74
- if(node.object_property_objDescription == true){
75
- propArr.push({ id: baEnum.PropertyIds.PROP_DESCRIPTION });
76
- }
77
- if(node.object_property_statusFlag == true){
78
- propArr.push({ id: baEnum.PropertyIds.PROP_STATUS_FLAGS });
79
- }
80
- if(node.object_property_reliability == true){
81
- propArr.push({ id: baEnum.PropertyIds.PROP_RELIABILITY });
82
- }
83
- if(node.object_property_outOfService == true){
84
- propArr.push({ id: baEnum.PropertyIds.PROP_OUT_OF_SERVICE });
85
- }
86
- if(node.object_property_units == true) {
87
- propArr.push({ id: baEnum.PropertyIds.PROP_UNITS });
88
- }
89
-
90
- //add object name for every request as its used in formatting
91
- propArr.push({ id: baEnum.PropertyIds.PROP_OBJECT_NAME});
92
-
93
- return propArr;
94
- };
95
-
96
- function getInstanceRange(node){
97
- let start = node.instance_start;
98
- let end = node.instance_end;
99
-
100
- if(start == end) {
101
- return start;
102
- }
103
-
104
- if(start !== end && start < end) {
105
- return start + " - " + end;
106
- }
107
-
108
- if(start && !end) {
109
- return start;
110
- }
111
-
112
- if(start > end){
113
- return end + " - " + start;
114
- }
115
- };
116
-
117
- };
118
-
119
-
120
- RED.nodes.registerType('Bitpool-Bacnet-Object', BitpoolBacnetObject)
121
- }