@ncd-io/node-red-enterprise-sensors 0.1.19 → 0.1.21

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.
@@ -137,7 +137,7 @@ module.exports = class WirelessSensor{
137
137
  var new_mode = is_new;
138
138
  var mode = (type == 'power_up') ? data.mode : ((type == 'sensor_data') ? 'RUN' : ((type == 'config_ack') ? 'ACK' : 'PGM'));
139
139
  // #OTF
140
- var otf_devices = [23,26,39,45,48,52,78,79,80,81,82,84,88,89,91,101,102,107,519,520,521,531,537];
140
+ var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,107,108,519,520,521,531,537];
141
141
  var device_type = msbLsb(frame.data[6], frame.data[7]);
142
142
  // var device_type = frame.data[7];
143
143
 
@@ -289,7 +289,7 @@ module.exports = class WirelessSensor{
289
289
  };
290
290
 
291
291
  // #OTF
292
- var otf_devices = [23,26,39,45,48,52,78,79,80,81,82,84,88,89,91,101,102,107,519,520,521,531,537];
292
+ var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,107,108,519,520,521,531,537];
293
293
  if(otf_devices.includes(parsed.sensor_type)){
294
294
  // If the message says FLY and there is not FLY timer in progress.
295
295
  if(payload[8] == 70 && payload[9] == 76 && payload[10] == 89) {
@@ -836,6 +836,35 @@ module.exports = class WirelessSensor{
836
836
  console.log(packet);
837
837
  return this.config_send(sensor_mac, packet);
838
838
  }
839
+ config_set_periodic_check_rate_76(sensor_mac, value){
840
+ console.log('config_set_periodic_check_rate');
841
+ let rate = int2Bytes((value), 2);
842
+ var packet = [244, 32, 0, 0, 0];
843
+ packet.push(...rate);
844
+ console.log(packet);
845
+ return this.config_send(sensor_mac, packet);
846
+ }
847
+ config_set_ppm_threshold_76(sensor_mac, value){
848
+ console.log('config_set_ppm_threshold_76');
849
+ let rate = int2Bytes((value), 2);
850
+ var packet = [244, 36, 0, 0, 0];
851
+ // packet.push(...rate);
852
+ console.log(packet);
853
+ return this.config_send(sensor_mac, packet);
854
+ }
855
+ config_set_alert_duration_76(sensor_mac, value){
856
+ console.log('config_set_alert_duration_76');
857
+ var packet = [244, 38, 0, 0, value];
858
+ // packet.push(...rate);
859
+ console.log(packet);
860
+ return this.config_send(sensor_mac, packet);
861
+ }
862
+ config_set_sensor_boot_time_76(sensor_mac, value){
863
+ console.log('config_set_sensor_boot_time_76');
864
+ var packet = [244, 36, 0, 0, 0, value];
865
+ console.log(packet);
866
+ return this.config_send(sensor_mac, packet);
867
+ }
839
868
  config_set_data_rate_24(sensor_mac, value){
840
869
  console.log('config_set_data_rate_24');
841
870
  var packet = [244, 2, 0, 0, 0, value];
@@ -1111,6 +1140,26 @@ module.exports = class WirelessSensor{
1111
1140
  console.log(packet);
1112
1141
  return this.config_send(sensor_mac, packet);
1113
1142
  }
1143
+
1144
+ config_set_accelerometer_threshold_108(sensor_mac, value){
1145
+ console.log('config_set_accelerometer_threshold_108');
1146
+ var packet = [244, 32, 0, 0, 0, 1, value];
1147
+ console.log(packet);
1148
+ return this.config_send(sensor_mac, packet);
1149
+ }
1150
+ config_set_debounce_time_108(sensor_mac, value){
1151
+ console.log('config_set_debounce_time_108');
1152
+ var packet = [244, 39, 0, 0, 0, 64, value];
1153
+ console.log(packet);
1154
+ return this.config_send(sensor_mac, packet);
1155
+ }
1156
+ config_clear_timers_108(sensor_mac){
1157
+ console.log('config_clear_timers_108');
1158
+ var packet = [244, 36, 0, 0, 0, 7];
1159
+ console.log(packet);
1160
+ return this.config_send(sensor_mac, packet);
1161
+ }
1162
+
1114
1163
  config_set_sensor_boot_time_420ma(sensor_mac, value){
1115
1164
  console.log('sensor_boot_time_420ma');
1116
1165
  var packet = [244, 68, 0, 0, 45, value];
@@ -5226,6 +5275,15 @@ function sensor_types(parent){
5226
5275
  };
5227
5276
  }
5228
5277
  },
5278
+ '90': {
5279
+ name: 'DC Current Sensor',
5280
+ parse: (d) => {
5281
+ return {
5282
+ raw_adc: d.slice(0, 2).reduce(msbLsb),
5283
+ amps: d.slice(2, 6).reduce(msbLsb) / 10,
5284
+ };
5285
+ }
5286
+ },
5229
5287
  '91': {
5230
5288
  name: 'Wireless Air Velocity Sensor HVAC',
5231
5289
  parse: (d) => {
@@ -5291,6 +5349,23 @@ function sensor_types(parent){
5291
5349
  };
5292
5350
  }
5293
5351
  },
5352
+ '108': {
5353
+ name: 'Machine Uptime Monitoring Sensor',
5354
+ parse: (d) => {
5355
+ return {
5356
+ digital_input_1_counter: d.slice(0, 4).reduce(msbLsb),
5357
+ digital_input_1_uptime: d.slice(4, 8).reduce(msbLsb),
5358
+ digital_input_2_counter: d.slice(8, 12).reduce(msbLsb),
5359
+ digital_input_2_uptime: d.slice(12, 16).reduce(msbLsb),
5360
+ digital_input_3_counter: d.slice(16, 20).reduce(msbLsb),
5361
+ digital_input_3_uptime: d.slice(20, 24).reduce(msbLsb),
5362
+ accelerometer_counter: d.slice(24, 28).reduce(msbLsb),
5363
+ accelerometer_uptime: d.slice(28, 32).reduce(msbLsb),
5364
+ magnetometer_counter: d.slice(32, 36).reduce(msbLsb),
5365
+ magnetometer_uptime: d.slice(36, 40).reduce(msbLsb)
5366
+ };
5367
+ }
5368
+ },
5294
5369
  '200': {
5295
5370
  name: '4-20mA Pass Through',
5296
5371
  parse: (d) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncd-io/node-red-enterprise-sensors",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wireless.html CHANGED
@@ -237,6 +237,21 @@
237
237
  mode_80_active: {value: ""},
238
238
  mode_80: {value: 0},
239
239
 
240
+ periodic_check_rate_76_active: {value: ""},
241
+ periodic_check_rate_76: {value: 60, validate: NCD_validators.number_range(60, 255)},
242
+
243
+ ppm_threshold_76_active: {value: ""},
244
+ ppm_threshold_76: {value: 100, validate: NCD_validators.number_range(0, 1000)},
245
+
246
+ alert_duration_76_active: {value: ""},
247
+ alert_duration_76: {value: 0, validate: NCD_validators.number_range(0, 255)},
248
+
249
+ ppm_threshold_76_active: {value: ""},
250
+ ppm_threshold_76: {value: 100, validate: NCD_validators.number_range(0, 1000)},
251
+
252
+ sensor_boot_time_76_active: {value: ""},
253
+ sensor_boot_time_76: {value: 30, validate: NCD_validators.number_range(0, 255)},
254
+
240
255
  measurement_mode_80_active: {value: ""},
241
256
  measurement_mode_80: {value: 0},
242
257
 
@@ -325,6 +340,12 @@
325
340
  pitch_angle_threshold_47:{value:0, validate: NCD_validators.number_range(0, 255)},
326
341
  pitch_angle_threshold_47_active:{value:""},
327
342
 
343
+ clear_all_counters_108:{value:0},
344
+ accelerometer_threshold_108:{value:10, validate: NCD_validators.number_range(0, 255)},
345
+ accelerometer_threshold_108_active:{value:""},
346
+ debounce_time_108:{value:10, validate: NCD_validators.number_range(0, 255)},
347
+ debounce_time_108_active:{value:""},
348
+
328
349
  counter_threshold_35:{value:50, validate: NCD_validators.number_range(0, 65534)},
329
350
  counter_threshold_35_active:{value:""},
330
351
 
@@ -427,6 +448,7 @@
427
448
  "84": "84 - Standalone Smart Vibration Sensor",
428
449
  "88": "88 - 1 Channel Ultrasound Vibration Sensor",
429
450
  "89": "89 - 2 Channel Ultrasound Vibration Sensor",
451
+ "90": "90 - DC Current Sensor",
430
452
  "91": "91 - Wireless Air Velocity Sensor HVAC",
431
453
  "92": "92 - Sound Sensor",
432
454
  "95": "95 - 16-Bit 1-Channel 0-24VDC Receiver",
@@ -434,6 +456,7 @@
434
456
  "101": "101 - Pro Vibration",
435
457
  "102": "102 - Strain Gauge",
436
458
  "107": "107 - 4 Channel 4-20mA Receiver",
459
+ "108": "108 - Machine Uptime Monitoring Sensor",
437
460
  "200": "200 - 4-20mA Pass Through",
438
461
  "202": "202 - Weather Station",
439
462
  "502": "502 - C_50-27",
@@ -678,6 +701,7 @@
678
701
  <option value="84">84 - Standalone Smart Vibration Sensor</option>
679
702
  <option value="88">88 - 1 Channel Ultrasound Vibration Sensor</option>
680
703
  <option value="89">89 - 2 Channel Ultrasound Vibration Sensor</option>
704
+ <option value="90">90 - DC Current Sensor</option>
681
705
  <option value="91">91 - Wireless Air Velocity Sensor HVAC</option>
682
706
  <option value="92">92 - Sound Sensor</option>
683
707
  <option value="95">95 - 16-Bit 1-Channel 0-24VDC Receiver</option>
@@ -685,6 +709,7 @@
685
709
  <option value="101">101 - Pro Vibration</option>
686
710
  <option value="102">102 - Strain Gauge</option>
687
711
  <option value="107">107 - 4 Channel 4-20mA Receiver</option>
712
+ <option value="108">108 - Machine Uptime Monitoring Sensor</option>
688
713
  <option value="200">200 - 4-20mA Pass Through</option>
689
714
  <option value="202">202 - Weather Station</option>
690
715
  <option value="502">502 - C_50-27</option>
@@ -712,7 +737,7 @@
712
737
  <label for="node-input-auto_config"><i class="icon-tag"></i> Auto Config</label>
713
738
  <input class="section-control" type="checkbox" id="node-input-auto_config" value="1">
714
739
  </div>
715
- <div class="form-row ncd-dependent" data-sensor-23 data-sensor-26 data-sensor-39 data-sensor-45 data-sensor-48 data-sensor-52 data-sensor-78 data-sensor-79 data-sensor-80 data-sensor-81 data-sensor-82 data-sensor-84 data-sensor-88 data-sensor-89 data-sensor-91 data-sensor-101 data-sensor-102 data-sensor-107 data-sensor-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-537>
740
+ <div class="form-row ncd-dependent" data-sensor-23 data-sensor-26 data-sensor-39 data-sensor-45 data-sensor-48 data-sensor-52 data-sensor-76 data-sensor-78 data-sensor-79 data-sensor-80 data-sensor-81 data-sensor-82 data-sensor-84 data-sensor-88 data-sensor-89 data-sensor-90 data-sensor-91 data-sensor-101 data-sensor-102 data-sensor-107 data-sensor-108 data-sensor-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-537>
716
741
  <hr>
717
742
  <label for="node-input-on_the_fly_enable"><i class="icon-tag"></i> OTF Config*</label>
718
743
  <input type="checkbox" id="node-input-on_the_fly_enable" value="1">
@@ -1040,18 +1065,18 @@
1040
1065
  <label for="node-input-force_calibration_co2"><i class="icon-tag"></i> Value</label>
1041
1066
  <input type="text" id="node-input-force_calibration_co2" placeholder="455" value="455">
1042
1067
  </div>
1043
- </div>
1044
- <div class="form-row ncd-active-check">
1045
- <div>
1046
- <strong>Temperature Offset</strong>
1047
- </div>
1048
- <div>
1049
- <label for="node-input-temperature_offset_44_active"><i class="icon-tag"></i> Auto Config</label>
1050
- <input type="checkbox" id="node-input-temperature_offset_44_active" class="ncd-config-toggle" data-target-id="node-input-temperature_offset_44" value="1">
1051
- </div>
1052
- <div>
1053
- <label for="node-input-temperature_offset_44"><i class="icon-tag"></i> Value</label>
1054
- <input type="text" id="node-input-temperature_offset_44" placeholder="4" value="4">
1068
+ <div class="form-row ncd-active-check">
1069
+ <div>
1070
+ <strong>Temperature Offset</strong>
1071
+ </div>
1072
+ <div>
1073
+ <label for="node-input-temperature_offset_44_active"><i class="icon-tag"></i> Auto Config</label>
1074
+ <input type="checkbox" id="node-input-temperature_offset_44_active" class="ncd-config-toggle" data-target-id="node-input-temperature_offset_44" value="1">
1075
+ </div>
1076
+ <div>
1077
+ <label for="node-input-temperature_offset_44"><i class="icon-tag"></i> Value</label>
1078
+ <input type="text" id="node-input-temperature_offset_44" placeholder="4" value="4">
1079
+ </div>
1055
1080
  </div>
1056
1081
  </div>
1057
1082
  <div class="ncd-dependent" data-sensor-84 data-sensor-519 data-sensor-537>
@@ -1328,6 +1353,52 @@
1328
1353
  </div>
1329
1354
  </div>
1330
1355
  </div>
1356
+ <div class="ncd-dependent" data-sensor-76>
1357
+ <div class="form-row ncd-active-check">
1358
+ <strong>Periodic Check Rate</strong>
1359
+ <div>
1360
+ <label for="node-input-periodic_check_rate_76_active"><i class="icon-tag"></i>Active:</label>
1361
+ <input type="checkbox" id="node-input-periodic_check_rate_76_active" class="ncd-config-toggle" data-target-id="node-input-periodic_check_rate_76" value="1">
1362
+ </div>
1363
+ <div>
1364
+ <label for="node-input-periodic_check_rate_76"><i class="icon-tag"></i>Value:</label>
1365
+ <input type="text" id="node-input-periodic_check_rate_76" value="60">
1366
+ </div>
1367
+ </div>
1368
+ <div class="form-row ncd-active-check">
1369
+ <strong>PPM Threshold</strong>
1370
+ <div>
1371
+ <label for="node-input-ppm_threshold_76_active"><i class="icon-tag"></i>Active:</label>
1372
+ <input type="checkbox" id="node-input-ppm_threshold_76_active" class="ncd-config-toggle" data-target-id="node-input-ppm_threshold_76" value="1">
1373
+ </div>
1374
+ <div>
1375
+ <label for="node-input-ppm_threshold_76"><i class="icon-tag"></i>Value:</label>
1376
+ <input type="text" id="node-input-ppm_threshold_76" placeholder="100">
1377
+ </div>
1378
+ </div>
1379
+ <div class="form-row ncd-active-check">
1380
+ <strong>Set Alert Duration</strong>
1381
+ <div>
1382
+ <label for="node-input-alert_duration_76_active"><i class="icon-tag"></i>Active:</label>
1383
+ <input type="checkbox" id="node-input-alert_duration_76_active" class="ncd-config-toggle" data-target-id="node-input-alert_duration_76" value="1">
1384
+ </div>
1385
+ <div>
1386
+ <label for="node-input-alert_duration_76"><i class="icon-tag"></i>Value:</label>
1387
+ <input type="text" id="node-input-alert_duration_76" placeholder="0">
1388
+ </div>
1389
+ </div>
1390
+ <div class="form-row ncd-active-check">
1391
+ <strong>Sensor Boot Time</strong>
1392
+ <div>
1393
+ <label for="node-input-sensor_boot_time_76_active"><i class="icon-tag"></i>Active:</label>
1394
+ <input type="checkbox" id="node-input-sensor_boot_time_76_active" class="ncd-config-toggle" data-target-id="node-input-sensor_boot_time_76" value="1">
1395
+ </div>
1396
+ <div>
1397
+ <label for="node-input-sensor_boot_time_76"><i class="icon-tag"></i>Value:</label>
1398
+ <input type="text" id="node-input-sensor_boot_time_76" value="30">
1399
+ </div>
1400
+ </div>
1401
+ </div>
1331
1402
  <div class="ncd-dependent" data-sensor-80 data-sensor-81 data-sensor-82 data-sensor-84 data-sensor-519 data-sensor-537>
1332
1403
  <div class="form-row ncd-active-check">
1333
1404
  <strong>Set Filtering</strong>
@@ -1692,6 +1763,42 @@
1692
1763
  </div>
1693
1764
  </div>
1694
1765
  </div>
1766
+
1767
+ <div class="ncd-dependent" data-sensor-108>
1768
+ <div class="form-row">
1769
+ <label for="node-input-clear_all_counters_108"><i class="icon-tag"></i>Clear All Counters</label>
1770
+ <input type="checkbox" id="node-input-clear_all_counters_108" value="1">
1771
+ </div>
1772
+ <div class="form-row ncd-active-check">
1773
+ <strong>Set Accelerometer Threshold</strong>
1774
+ <p class="caption">
1775
+ Sets the threshold in multiples of 32mg in which an uptime will be detected. A value of 1 = 32mg, a value of 2 = 64mg etc.
1776
+ </p>
1777
+ <div>
1778
+ <label for="node-input-accelerometer_threshold_108_active">Active:</label>
1779
+ <input type="checkbox" id="node-input-accelerometer_threshold_108_active" class="ncd-config-toggle" data-target-id="node-input-accelerometer_threshold_108" value="1">
1780
+ </div>
1781
+ <div>
1782
+ <label for="node-input-accelerometer_threshold_108"><i class="icon-tag"></i>Value:</label>
1783
+ <input type="text" id="node-input-accelerometer_threshold_108" placeholder="10" value="10">
1784
+ </div>
1785
+ </div>
1786
+ <div class="form-row ncd-active-check">
1787
+ <strong>Set Input Debounce Time</strong>
1788
+ <p class="caption">
1789
+ Sets the debounce time in milliseconds on inputs. State changes to the input during this debounce time will be ignored. Generally recommended for mechanically triggered state changes such as button or relay/contactor outputs.
1790
+ </p>
1791
+ <div>
1792
+ <label for="node-input-debounce_time_108_active">Active:</label>
1793
+ <input type="checkbox" id="node-input-debounce_time_108_active" class="ncd-config-toggle" data-target-id="node-input-debounce_time_108" value="1">
1794
+ </div>
1795
+ <div>
1796
+ <label for="node-input-debounce_time_108"><i class="icon-tag"></i>Value:</label>
1797
+ <input type="text" id="node-input-debounce_time_108" placeholder="10" value="10">
1798
+ </div>
1799
+ </div>
1800
+ </div>
1801
+
1695
1802
  <div class="ncd-dependent" data-sensor-35 data-sensor-36>
1696
1803
  <hr>
1697
1804
  <div class="form-row ncd-active-check">
package/wireless.js CHANGED
@@ -572,6 +572,19 @@ module.exports = function(RED) {
572
572
  promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
573
573
  }
574
574
  break;
575
+ case 76:
576
+ if(config.periodic_check_rate_76_active){
577
+ promises.periodic_check_rate_76 = node.config_gateway.config_set_periodic_check_rate_76(mac, parseInt(config.periodic_check_rate_76));
578
+ }
579
+ if(config.sensor_boot_time_76_active){
580
+ promises.sensor_boot_time_76 = node.config_gateway.config_set_sensor_boot_time_76(mac, parseInt(config.sensor_boot_time_76));
581
+ }
582
+ if(config.ppm_threshold_76_active){
583
+ promises.ppm_threshold_76 = node.config_gateway.config_set_ppm_threshold_76(mac, parseInt(config.ppm_threshold_76));
584
+ }
585
+ if(config.alert_duration_76_active){
586
+ promises.alert_duration_76 = node.config_gateway.config_set_alert_duration_76(mac, parseInt(config.alert_duration_76));
587
+ }
575
588
  case 78:
576
589
  if(config.sensor_boot_time_78_active){
577
590
  promises.sensor_boot_time_78 = node.config_gateway.config_set_sensor_boot_time_78(mac, parseInt(config.sensor_boot_time_78));
@@ -874,6 +887,17 @@ module.exports = function(RED) {
874
887
  promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
875
888
  }
876
889
  break;
890
+ case 108:
891
+ if(config.clear_all_counters_108){
892
+ promises.clear_all_counters_108 = node.config_gateway.config_clear_timers_108(mac);
893
+ }
894
+ if(config.accelerometer_threshold_108_active){
895
+ promises.accelerometer_threshold_108 = node.config_gateway.config_set_accelerometer_threshold_108(mac, parseInt(config.accelerometer_threshold_108));
896
+ }
897
+ if(config.debounce_time_108_active){
898
+ promises.debounce_time_108 = node.config_gateway.config_set_debounce_time_108(mac, parseInt(config.debounce_time_108));
899
+ }
900
+ break;
877
901
  case 200:
878
902
  if(config.low_calibration_420ma_active){
879
903
  promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));