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

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,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,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];
@@ -2478,11 +2507,12 @@ function sensor_types(parent){
2478
2507
  name: 'Wireless CO Sensor',
2479
2508
  parse: (d) => {
2480
2509
  return {
2481
- CO_ppm: signInt(d.slice(0, 2).reduce(msbLsb), 16) / 100
2510
+ humidity: msbLsb(d[0], d[1])/100,
2511
+ temperature: signInt((msbLsb(d[2], d[3])), 16)/100,
2512
+ co_ppm: msbLsb(d[4], d[5])
2482
2513
  };
2483
2514
  }
2484
2515
  },
2485
-
2486
2516
  '77': {
2487
2517
  name: '3 Channel SDI-12 Wireelss',
2488
2518
  parse: (d) => {
@@ -5225,6 +5255,15 @@ function sensor_types(parent){
5225
5255
  };
5226
5256
  }
5227
5257
  },
5258
+ '90': {
5259
+ name: 'DC Current Sensor',
5260
+ parse: (d) => {
5261
+ return {
5262
+ raw_adc: d.slice(0, 2).reduce(msbLsb),
5263
+ amps: d.slice(2, 6).reduce(msbLsb) / 10,
5264
+ };
5265
+ }
5266
+ },
5228
5267
  '91': {
5229
5268
  name: 'Wireless Air Velocity Sensor HVAC',
5230
5269
  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.18",
3
+ "version": "0.1.20",
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
 
@@ -427,6 +442,7 @@
427
442
  "84": "84 - Standalone Smart Vibration Sensor",
428
443
  "88": "88 - 1 Channel Ultrasound Vibration Sensor",
429
444
  "89": "89 - 2 Channel Ultrasound Vibration Sensor",
445
+ "90": "90 - DC Current Sensor",
430
446
  "91": "91 - Wireless Air Velocity Sensor HVAC",
431
447
  "92": "92 - Sound Sensor",
432
448
  "95": "95 - 16-Bit 1-Channel 0-24VDC Receiver",
@@ -678,6 +694,7 @@
678
694
  <option value="84">84 - Standalone Smart Vibration Sensor</option>
679
695
  <option value="88">88 - 1 Channel Ultrasound Vibration Sensor</option>
680
696
  <option value="89">89 - 2 Channel Ultrasound Vibration Sensor</option>
697
+ <option value="90">90 - DC Current Sensor</option>
681
698
  <option value="91">91 - Wireless Air Velocity Sensor HVAC</option>
682
699
  <option value="92">92 - Sound Sensor</option>
683
700
  <option value="95">95 - 16-Bit 1-Channel 0-24VDC Receiver</option>
@@ -712,7 +729,7 @@
712
729
  <label for="node-input-auto_config"><i class="icon-tag"></i> Auto Config</label>
713
730
  <input class="section-control" type="checkbox" id="node-input-auto_config" value="1">
714
731
  </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>
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>
716
733
  <hr>
717
734
  <label for="node-input-on_the_fly_enable"><i class="icon-tag"></i> OTF Config*</label>
718
735
  <input type="checkbox" id="node-input-on_the_fly_enable" value="1">
@@ -1120,6 +1137,7 @@
1120
1137
  <hr>
1121
1138
  <div class="form-row ncd-active-check">
1122
1139
  <strong>Mode</strong>
1140
+ <p>WARNING: If Mode is set to Raw it is recommended to also set the Destination Address configuration to the address of your Receiver/Gateway.</p>
1123
1141
  <div>
1124
1142
  <label for="node-input-mode_80_active"><i class="icon-tag"></i>Active:</label>
1125
1143
  <input type="checkbox" id="node-input-mode_80_active" class="ncd-config-toggle" data-target-id="node-input-mode_80" value="1">
@@ -1327,6 +1345,52 @@
1327
1345
  </div>
1328
1346
  </div>
1329
1347
  </div>
1348
+ <div class="ncd-dependent" data-sensor-76>
1349
+ <div class="form-row ncd-active-check">
1350
+ <strong>Periodic Check Rate</strong>
1351
+ <div>
1352
+ <label for="node-input-periodic_check_rate_76_active"><i class="icon-tag"></i>Active:</label>
1353
+ <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">
1354
+ </div>
1355
+ <div>
1356
+ <label for="node-input-periodic_check_rate_76"><i class="icon-tag"></i>Value:</label>
1357
+ <input type="text" id="node-input-periodic_check_rate_76" value="60">
1358
+ </div>
1359
+ </div>
1360
+ <div class="form-row ncd-active-check">
1361
+ <strong>PPM Threshold</strong>
1362
+ <div>
1363
+ <label for="node-input-ppm_threshold_76_active"><i class="icon-tag"></i>Active:</label>
1364
+ <input type="checkbox" id="node-input-ppm_threshold_76_active" class="ncd-config-toggle" data-target-id="node-input-ppm_threshold_76" value="1">
1365
+ </div>
1366
+ <div>
1367
+ <label for="node-input-ppm_threshold_76"><i class="icon-tag"></i>Value:</label>
1368
+ <input type="text" id="node-input-ppm_threshold_76" placeholder="100">
1369
+ </div>
1370
+ </div>
1371
+ <div class="form-row ncd-active-check">
1372
+ <strong>Set Alert Duration</strong>
1373
+ <div>
1374
+ <label for="node-input-alert_duration_76_active"><i class="icon-tag"></i>Active:</label>
1375
+ <input type="checkbox" id="node-input-alert_duration_76_active" class="ncd-config-toggle" data-target-id="node-input-alert_duration_76" value="1">
1376
+ </div>
1377
+ <div>
1378
+ <label for="node-input-alert_duration_76"><i class="icon-tag"></i>Value:</label>
1379
+ <input type="text" id="node-input-alert_duration_76" placeholder="0">
1380
+ </div>
1381
+ </div>
1382
+ <div class="form-row ncd-active-check">
1383
+ <strong>Sensor Boot Time</strong>
1384
+ <div>
1385
+ <label for="node-input-sensor_boot_time_76_active"><i class="icon-tag"></i>Active:</label>
1386
+ <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">
1387
+ </div>
1388
+ <div>
1389
+ <label for="node-input-sensor_boot_time_76"><i class="icon-tag"></i>Value:</label>
1390
+ <input type="text" id="node-input-sensor_boot_time_76" value="30">
1391
+ </div>
1392
+ </div>
1393
+ </div>
1330
1394
  <div class="ncd-dependent" data-sensor-80 data-sensor-81 data-sensor-82 data-sensor-84 data-sensor-519 data-sensor-537>
1331
1395
  <div class="form-row ncd-active-check">
1332
1396
  <strong>Set Filtering</strong>
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));