@ncd-io/node-red-enterprise-sensors 0.1.21 → 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,108,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,108,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
@@ -1159,6 +1166,12 @@ module.exports = class WirelessSensor{
1159
1166
  console.log(packet);
1160
1167
  return this.config_send(sensor_mac, packet);
1161
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
+ }
1162
1175
 
1163
1176
  config_set_sensor_boot_time_420ma(sensor_mac, value){
1164
1177
  console.log('sensor_boot_time_420ma');
@@ -5351,7 +5364,13 @@ function sensor_types(parent){
5351
5364
  },
5352
5365
  '108': {
5353
5366
  name: 'Machine Uptime Monitoring Sensor',
5354
- parse: (d) => {
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
+ }
5355
5374
  return {
5356
5375
  digital_input_1_counter: d.slice(0, 4).reduce(msbLsb),
5357
5376
  digital_input_1_uptime: d.slice(4, 8).reduce(msbLsb),
@@ -6332,6 +6351,16 @@ function sensor_types(parent){
6332
6351
  }
6333
6352
  }
6334
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
+ },
6335
6364
  '537': {
6336
6365
  name: 'Type 537 - Custom Standalone Smart Vibration Sensor',
6337
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.21",
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,8 @@
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:""},
343
347
  clear_all_counters_108:{value:0},
344
348
  accelerometer_threshold_108:{value:10, validate: NCD_validators.number_range(0, 255)},
345
349
  accelerometer_threshold_108_active:{value:""},
@@ -470,6 +474,7 @@
470
474
  "521": "521 - Custom 3 Channel Light Sensor",
471
475
  "524": "524 - SDI Multi Soil Probe",
472
476
  "531": "531 - Custom Noise Sensor",
477
+ "535": "535 - Custom CO2 Sensor",
473
478
  "537": "537 - Custom Standalone Smart Vibration Sensor",
474
479
  "10000": "10000 - 4-Channel Relay",
475
480
  "10006": "10006 - 4-Channel 4-20 mA Input",
@@ -723,6 +728,7 @@
723
728
  <option value="521">521 - Custom 3 Channel Light Sensor</option>
724
729
  <option value="524">524 - SDI Multi Soil Probe</option>
725
730
  <option value="531">531 - Custom Noise Sensor</option>
731
+ <option value="535">535 - Custom CO2 Sensor</option>
726
732
  <option value="537">537 - Custom Standalone Smart Vibration Sensor</option>
727
733
  <option value="10000">10000 - 4-Channel Relay</option>
728
734
  <option value="10006">10006 - 4-Channel 4-20 mA Input</option>
@@ -737,7 +743,7 @@
737
743
  <label for="node-input-auto_config"><i class="icon-tag"></i> Auto Config</label>
738
744
  <input class="section-control" type="checkbox" id="node-input-auto_config" value="1">
739
745
  </div>
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>
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>
741
747
  <hr>
742
748
  <label for="node-input-on_the_fly_enable"><i class="icon-tag"></i> OTF Config*</label>
743
749
  <input type="checkbox" id="node-input-on_the_fly_enable" value="1">
@@ -1053,18 +1059,35 @@
1053
1059
  </div>
1054
1060
  <div class="ncd-dependent" data-sensor-44>
1055
1061
  <hr>
1056
- <div class="form-row">
1057
- <p><strong>Advanced: Set Sensor Forced Calibration</strong></p>
1058
- <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>
1059
- </div>
1060
- <div class="form-row">
1061
- <label for="node-input-force_calibration_co2_auto_config"><i class="icon-tag"></i> Auto Config</label>
1062
- <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">
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>
1063
1075
  </div>
1064
- <div class="form-row">
1065
- <label for="node-input-force_calibration_co2"><i class="icon-tag"></i> Value</label>
1066
- <input type="text" id="node-input-force_calibration_co2" placeholder="455" value="455">
1076
+ </div>
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>
1067
1088
  </div>
1089
+ </div>
1090
+ <div class="ncd-dependent" data-sensor-44 data-sensor-535>
1068
1091
  <div class="form-row ncd-active-check">
1069
1092
  <div>
1070
1093
  <strong>Temperature Offset</strong>
@@ -1765,6 +1788,23 @@
1765
1788
  </div>
1766
1789
 
1767
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>
1768
1808
  <div class="form-row">
1769
1809
  <label for="node-input-clear_all_counters_108"><i class="icon-tag"></i>Clear All Counters</label>
1770
1810
  <input type="checkbox" id="node-input-clear_all_counters_108" value="1">
package/wireless.js CHANGED
@@ -888,6 +888,9 @@ module.exports = function(RED) {
888
888
  }
889
889
  break;
890
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
+ }
891
894
  if(config.clear_all_counters_108){
892
895
  promises.clear_all_counters_108 = node.config_gateway.config_clear_timers_108(mac);
893
896
  }
@@ -981,6 +984,14 @@ module.exports = function(RED) {
981
984
  promises.set_rtc_101 = node.config_gateway.config_set_rtc_101(mac);
982
985
  }
983
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;
984
995
  case 537:
985
996
  if(config.output_data_rate_101_active){
986
997
  promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));