@ncd-io/node-red-enterprise-sensors 0.1.20 → 0.1.22

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,76,78,79,80,81,82,84,88,89,90,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,535,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,76,78,79,80,81,82,84,88,89,90,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,535,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) {
@@ -912,6 +912,13 @@ module.exports = class WirelessSensor{
912
912
  packet.push(...cal_val);
913
913
  return this.config_send(sensor_mac, packet);
914
914
  }
915
+ config_set_sensor_forced_calibration_535(sensor_mac){
916
+ console.log('config_set_sensor_forced_calibration_535');
917
+ // convert before processing
918
+ var packet = [244, 32, 0, 0, 0];
919
+ console.log(packet);
920
+ return this.config_send(sensor_mac, packet);
921
+ }
915
922
  config_set_sensor_temperature_offset_44(sensor_mac, value){
916
923
  console.log('config_set_sensor_temperature_offset_44');
917
924
  // convert before processing
@@ -1140,6 +1147,32 @@ module.exports = class WirelessSensor{
1140
1147
  console.log(packet);
1141
1148
  return this.config_send(sensor_mac, packet);
1142
1149
  }
1150
+
1151
+ config_set_accelerometer_threshold_108(sensor_mac, value){
1152
+ console.log('config_set_accelerometer_threshold_108');
1153
+ var packet = [244, 32, 0, 0, 0, 1, value];
1154
+ console.log(packet);
1155
+ return this.config_send(sensor_mac, packet);
1156
+ }
1157
+ config_set_debounce_time_108(sensor_mac, value){
1158
+ console.log('config_set_debounce_time_108');
1159
+ var packet = [244, 39, 0, 0, 0, 64, value];
1160
+ console.log(packet);
1161
+ return this.config_send(sensor_mac, packet);
1162
+ }
1163
+ config_clear_timers_108(sensor_mac){
1164
+ console.log('config_clear_timers_108');
1165
+ var packet = [244, 36, 0, 0, 0, 7];
1166
+ console.log(packet);
1167
+ return this.config_send(sensor_mac, packet);
1168
+ }
1169
+ config_set_accelerometer_state_108(sensor_mac, value){
1170
+ console.log('config_set_accelerometer_state_108');
1171
+ var packet = [244, 37, 0, 0, 0, 7, value];
1172
+ console.log(packet);
1173
+ return this.config_send(sensor_mac, packet);
1174
+ }
1175
+
1143
1176
  config_set_sensor_boot_time_420ma(sensor_mac, value){
1144
1177
  console.log('sensor_boot_time_420ma');
1145
1178
  var packet = [244, 68, 0, 0, 45, value];
@@ -5329,6 +5362,29 @@ function sensor_types(parent){
5329
5362
  };
5330
5363
  }
5331
5364
  },
5365
+ '108': {
5366
+ name: 'Machine Uptime Monitoring Sensor',
5367
+ parse: (d, payload) => {
5368
+ if(payload[7] & 2 != 0){
5369
+ console.log('Error found');
5370
+ // parsed.data = {error: 'Error found, Acclerometer Probe may be unattached'};
5371
+ let error = {error: 'Error found, Acclerometer Probe may be unattached'};
5372
+ return error;
5373
+ }
5374
+ return {
5375
+ digital_input_1_counter: d.slice(0, 4).reduce(msbLsb),
5376
+ digital_input_1_uptime: d.slice(4, 8).reduce(msbLsb),
5377
+ digital_input_2_counter: d.slice(8, 12).reduce(msbLsb),
5378
+ digital_input_2_uptime: d.slice(12, 16).reduce(msbLsb),
5379
+ digital_input_3_counter: d.slice(16, 20).reduce(msbLsb),
5380
+ digital_input_3_uptime: d.slice(20, 24).reduce(msbLsb),
5381
+ accelerometer_counter: d.slice(24, 28).reduce(msbLsb),
5382
+ accelerometer_uptime: d.slice(28, 32).reduce(msbLsb),
5383
+ magnetometer_counter: d.slice(32, 36).reduce(msbLsb),
5384
+ magnetometer_uptime: d.slice(36, 40).reduce(msbLsb)
5385
+ };
5386
+ }
5387
+ },
5332
5388
  '200': {
5333
5389
  name: '4-20mA Pass Through',
5334
5390
  parse: (d) => {
@@ -6295,6 +6351,16 @@ function sensor_types(parent){
6295
6351
  }
6296
6352
  }
6297
6353
  },
6354
+ '535': {
6355
+ name: 'Custom Wireless CO2 Gas Sensor',
6356
+ parse: (d) => {
6357
+ return {
6358
+ humidity: msbLsb(d[0], d[1])/100,
6359
+ temperature: signInt((msbLsb(d[2], d[3])), 16)/100,
6360
+ co2: msbLsb(d[4], d[5])
6361
+ };
6362
+ }
6363
+ },
6298
6364
  '537': {
6299
6365
  name: 'Type 537 - Custom Standalone Smart Vibration Sensor',
6300
6366
  parse: (payload, parsed, mac) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncd-io/node-red-enterprise-sensors",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wireless.html CHANGED
@@ -226,6 +226,8 @@
226
226
  force_calibration_co2_auto_config: {value: ""},
227
227
  force_calibration_co2: {value: 400, validate: NCD_validators.number_range(400, 2000)},
228
228
 
229
+ force_calibration_co2_535_active: {value: ""},
230
+
229
231
  temperature_offset_44_active: {value: ""},
230
232
  temperature_offset_44: {value: 4, validate: NCD_validators.number_range(0, 25)},
231
233
 
@@ -340,6 +342,14 @@
340
342
  pitch_angle_threshold_47:{value:0, validate: NCD_validators.number_range(0, 255)},
341
343
  pitch_angle_threshold_47_active:{value:""},
342
344
 
345
+ accelerometer_state_108:{value:0},
346
+ accelerometer_state_108_active:{value:""},
347
+ clear_all_counters_108:{value:0},
348
+ accelerometer_threshold_108:{value:10, validate: NCD_validators.number_range(0, 255)},
349
+ accelerometer_threshold_108_active:{value:""},
350
+ debounce_time_108:{value:10, validate: NCD_validators.number_range(0, 255)},
351
+ debounce_time_108_active:{value:""},
352
+
343
353
  counter_threshold_35:{value:50, validate: NCD_validators.number_range(0, 65534)},
344
354
  counter_threshold_35_active:{value:""},
345
355
 
@@ -450,6 +460,7 @@
450
460
  "101": "101 - Pro Vibration",
451
461
  "102": "102 - Strain Gauge",
452
462
  "107": "107 - 4 Channel 4-20mA Receiver",
463
+ "108": "108 - Machine Uptime Monitoring Sensor",
453
464
  "200": "200 - 4-20mA Pass Through",
454
465
  "202": "202 - Weather Station",
455
466
  "502": "502 - C_50-27",
@@ -463,6 +474,7 @@
463
474
  "521": "521 - Custom 3 Channel Light Sensor",
464
475
  "524": "524 - SDI Multi Soil Probe",
465
476
  "531": "531 - Custom Noise Sensor",
477
+ "535": "535 - Custom CO2 Sensor",
466
478
  "537": "537 - Custom Standalone Smart Vibration Sensor",
467
479
  "10000": "10000 - 4-Channel Relay",
468
480
  "10006": "10006 - 4-Channel 4-20 mA Input",
@@ -702,6 +714,7 @@
702
714
  <option value="101">101 - Pro Vibration</option>
703
715
  <option value="102">102 - Strain Gauge</option>
704
716
  <option value="107">107 - 4 Channel 4-20mA Receiver</option>
717
+ <option value="108">108 - Machine Uptime Monitoring Sensor</option>
705
718
  <option value="200">200 - 4-20mA Pass Through</option>
706
719
  <option value="202">202 - Weather Station</option>
707
720
  <option value="502">502 - C_50-27</option>
@@ -715,6 +728,7 @@
715
728
  <option value="521">521 - Custom 3 Channel Light Sensor</option>
716
729
  <option value="524">524 - SDI Multi Soil Probe</option>
717
730
  <option value="531">531 - Custom Noise Sensor</option>
731
+ <option value="535">535 - Custom CO2 Sensor</option>
718
732
  <option value="537">537 - Custom Standalone Smart Vibration Sensor</option>
719
733
  <option value="10000">10000 - 4-Channel Relay</option>
720
734
  <option value="10006">10006 - 4-Channel 4-20 mA Input</option>
@@ -729,7 +743,7 @@
729
743
  <label for="node-input-auto_config"><i class="icon-tag"></i> Auto Config</label>
730
744
  <input class="section-control" type="checkbox" id="node-input-auto_config" value="1">
731
745
  </div>
732
- <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-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-537>
746
+ <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-535 data-sensor-537>
733
747
  <hr>
734
748
  <label for="node-input-on_the_fly_enable"><i class="icon-tag"></i> OTF Config*</label>
735
749
  <input type="checkbox" id="node-input-on_the_fly_enable" value="1">
@@ -1045,30 +1059,47 @@
1045
1059
  </div>
1046
1060
  <div class="ncd-dependent" data-sensor-44>
1047
1061
  <hr>
1048
- <div class="form-row">
1049
- <p><strong>Advanced: Set Sensor Forced Calibration</strong></p>
1050
- <p>This command will take 3 minutes to execute as the sensor calibrates. Do not reboot the sensor during this time. The configuration completed command through the UI is referring to the receipt and acknowledgement of the configuration packet.</p>
1051
- </div>
1052
- <div class="form-row">
1053
- <label for="node-input-force_calibration_co2_auto_config"><i class="icon-tag"></i> Auto Config</label>
1054
- <input type="checkbox" id="node-input-force_calibration_co2_auto_config" class="ncd-config-toggle" data-target-id="node-input-force_calibration_co2" value="1">
1055
- </div>
1056
- <div class="form-row">
1057
- <label for="node-input-force_calibration_co2"><i class="icon-tag"></i> Value</label>
1058
- <input type="text" id="node-input-force_calibration_co2" placeholder="455" value="455">
1062
+ <div class="form-row ncd-active-check">
1063
+ <div class="form-row">
1064
+ <p><strong>Advanced: Set Sensor Forced Calibration</strong></p>
1065
+ <p>This command will take 3 minutes to execute as the sensor calibrates. Do not reboot the sensor during this time. The configuration completed command through the UI is referring to the receipt and acknowledgement of the configuration packet.</p>
1066
+ </div>
1067
+ <div class="form-row">
1068
+ <label for="node-input-force_calibration_co2_auto_config"><i class="icon-tag"></i> Auto Config</label>
1069
+ <input type="checkbox" id="node-input-force_calibration_co2_auto_config" class="ncd-config-toggle" data-target-id="node-input-force_calibration_co2" value="1">
1070
+ </div>
1071
+ <div class="form-row">
1072
+ <label for="node-input-force_calibration_co2"><i class="icon-tag"></i> Value</label>
1073
+ <input type="text" id="node-input-force_calibration_co2" placeholder="455" value="455">
1074
+ </div>
1059
1075
  </div>
1060
1076
  </div>
1061
- <div class="form-row ncd-active-check">
1062
- <div>
1063
- <strong>Temperature Offset</strong>
1064
- </div>
1065
- <div>
1066
- <label for="node-input-temperature_offset_44_active"><i class="icon-tag"></i> Auto Config</label>
1067
- <input type="checkbox" id="node-input-temperature_offset_44_active" class="ncd-config-toggle" data-target-id="node-input-temperature_offset_44" value="1">
1077
+ <div class="ncd-dependent" data-sensor-535>
1078
+ <hr>
1079
+ <div class="form-row ncd-active-check">
1080
+ <div class="form-row">
1081
+ <p><strong>Advanced: Set Sensor Forced Calibration</strong></p>
1082
+ <p>This command will take 10 minutes to execute as the sensor calibrates. Do not reboot the sensor during this time. The configuration completed command through the UI is referring to the receipt and acknowledgement of the configuration packet.</p>
1083
+ </div>
1084
+ <div class="form-row">
1085
+ <label for="node-input-force_calibration_co2_535_active"><i class="icon-tag"></i>Enable</label>
1086
+ <input type="checkbox" id="node-input-force_calibration_co2_535_active" class="ncd-config-toggle" value="1">
1087
+ </div>
1068
1088
  </div>
1069
- <div>
1070
- <label for="node-input-temperature_offset_44"><i class="icon-tag"></i> Value</label>
1071
- <input type="text" id="node-input-temperature_offset_44" placeholder="4" value="4">
1089
+ </div>
1090
+ <div class="ncd-dependent" data-sensor-44 data-sensor-535>
1091
+ <div class="form-row ncd-active-check">
1092
+ <div>
1093
+ <strong>Temperature Offset</strong>
1094
+ </div>
1095
+ <div>
1096
+ <label for="node-input-temperature_offset_44_active"><i class="icon-tag"></i> Auto Config</label>
1097
+ <input type="checkbox" id="node-input-temperature_offset_44_active" class="ncd-config-toggle" data-target-id="node-input-temperature_offset_44" value="1">
1098
+ </div>
1099
+ <div>
1100
+ <label for="node-input-temperature_offset_44"><i class="icon-tag"></i> Value</label>
1101
+ <input type="text" id="node-input-temperature_offset_44" placeholder="4" value="4">
1102
+ </div>
1072
1103
  </div>
1073
1104
  </div>
1074
1105
  <div class="ncd-dependent" data-sensor-84 data-sensor-519 data-sensor-537>
@@ -1755,6 +1786,59 @@
1755
1786
  </div>
1756
1787
  </div>
1757
1788
  </div>
1789
+
1790
+ <div class="ncd-dependent" data-sensor-108>
1791
+ <div class="form-row ncd-active-check">
1792
+ <strong>Enable Accelerometer Error Reporting</strong>
1793
+ <p class="caption">
1794
+ Enables error reporting for the accelerometer probe. If this option is enabled errors will be reported when the accelerometer probe is non-functional.
1795
+ </p>
1796
+ <div>
1797
+ <label for="node-input-accelerometer_state_108_active">Active:</label>
1798
+ <input type="checkbox" id="node-input-accelerometer_state_108_active" class="ncd-config-toggle" data-target-id="node-input-accelerometer_state_108" value="1">
1799
+ </div>
1800
+ <div>
1801
+ <label for="node-input-accelerometer_state_108"><i class="icon-tag"></i>Value:</label>
1802
+ <select id="node-input-accelerometer_state_108">
1803
+ <option value="0" selected>Disabled</option>
1804
+ <option value="1">Enabled</option>
1805
+ </select>
1806
+ </div>
1807
+ </div>
1808
+ <div class="form-row">
1809
+ <label for="node-input-clear_all_counters_108"><i class="icon-tag"></i>Clear All Counters</label>
1810
+ <input type="checkbox" id="node-input-clear_all_counters_108" value="1">
1811
+ </div>
1812
+ <div class="form-row ncd-active-check">
1813
+ <strong>Set Accelerometer Threshold</strong>
1814
+ <p class="caption">
1815
+ 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.
1816
+ </p>
1817
+ <div>
1818
+ <label for="node-input-accelerometer_threshold_108_active">Active:</label>
1819
+ <input type="checkbox" id="node-input-accelerometer_threshold_108_active" class="ncd-config-toggle" data-target-id="node-input-accelerometer_threshold_108" value="1">
1820
+ </div>
1821
+ <div>
1822
+ <label for="node-input-accelerometer_threshold_108"><i class="icon-tag"></i>Value:</label>
1823
+ <input type="text" id="node-input-accelerometer_threshold_108" placeholder="10" value="10">
1824
+ </div>
1825
+ </div>
1826
+ <div class="form-row ncd-active-check">
1827
+ <strong>Set Input Debounce Time</strong>
1828
+ <p class="caption">
1829
+ 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.
1830
+ </p>
1831
+ <div>
1832
+ <label for="node-input-debounce_time_108_active">Active:</label>
1833
+ <input type="checkbox" id="node-input-debounce_time_108_active" class="ncd-config-toggle" data-target-id="node-input-debounce_time_108" value="1">
1834
+ </div>
1835
+ <div>
1836
+ <label for="node-input-debounce_time_108"><i class="icon-tag"></i>Value:</label>
1837
+ <input type="text" id="node-input-debounce_time_108" placeholder="10" value="10">
1838
+ </div>
1839
+ </div>
1840
+ </div>
1841
+
1758
1842
  <div class="ncd-dependent" data-sensor-35 data-sensor-36>
1759
1843
  <hr>
1760
1844
  <div class="form-row ncd-active-check">
package/wireless.js CHANGED
@@ -887,6 +887,20 @@ module.exports = function(RED) {
887
887
  promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
888
888
  }
889
889
  break;
890
+ case 108:
891
+ if(config.accelerometer_state_108_active){
892
+ promises.accelerometer_state_108 = node.config_gateway.config_set_accelerometer_state_108(mac, parseInt(config.accelerometer_state_108));
893
+ }
894
+ if(config.clear_all_counters_108){
895
+ promises.clear_all_counters_108 = node.config_gateway.config_clear_timers_108(mac);
896
+ }
897
+ if(config.accelerometer_threshold_108_active){
898
+ promises.accelerometer_threshold_108 = node.config_gateway.config_set_accelerometer_threshold_108(mac, parseInt(config.accelerometer_threshold_108));
899
+ }
900
+ if(config.debounce_time_108_active){
901
+ promises.debounce_time_108 = node.config_gateway.config_set_debounce_time_108(mac, parseInt(config.debounce_time_108));
902
+ }
903
+ break;
890
904
  case 200:
891
905
  if(config.low_calibration_420ma_active){
892
906
  promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
@@ -970,6 +984,14 @@ module.exports = function(RED) {
970
984
  promises.set_rtc_101 = node.config_gateway.config_set_rtc_101(mac);
971
985
  }
972
986
  break;
987
+ case 535:
988
+ if(config.force_calibration_co2_535_active){
989
+ promises.force_calibration_co2_535 = node.config_gateway.config_set_sensor_forced_calibration_535(mac);
990
+ }
991
+ if(config.temperature_offset_44_active){
992
+ promises.temperature_offset_44 = node.config_gateway.config_set_sensor_temperature_offset_44(mac, parseInt(config.temperature_offset_44));
993
+ }
994
+ break;
973
995
  case 537:
974
996
  if(config.output_data_rate_101_active){
975
997
  promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));