@ncd-io/node-red-enterprise-sensors 1.2.0 → 1.2.2
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/lib/WirelessGateway.js +37 -11
- package/package.json +1 -1
- package/wireless.html +73 -1
- package/wireless.js +14 -0
package/lib/WirelessGateway.js
CHANGED
|
@@ -1233,13 +1233,13 @@ module.exports = class WirelessSensor{
|
|
|
1233
1233
|
}
|
|
1234
1234
|
config_set_accelerometer_threshold_108(sensor_mac, value){
|
|
1235
1235
|
console.log('config_set_accelerometer_threshold_108');
|
|
1236
|
-
var packet = [244, 32, 0, 0, 0,
|
|
1236
|
+
var packet = [244, 32, 0, 0, 0, value];
|
|
1237
1237
|
console.log(packet);
|
|
1238
1238
|
return this.config_send(sensor_mac, packet);
|
|
1239
1239
|
}
|
|
1240
1240
|
config_set_debounce_time_108(sensor_mac, value){
|
|
1241
1241
|
console.log('config_set_debounce_time_108');
|
|
1242
|
-
var packet = [244, 39, 0, 0, 0,
|
|
1242
|
+
var packet = [244, 39, 0, 0, 0, value];
|
|
1243
1243
|
console.log(packet);
|
|
1244
1244
|
return this.config_send(sensor_mac, packet);
|
|
1245
1245
|
}
|
|
@@ -1294,7 +1294,7 @@ module.exports = class WirelessSensor{
|
|
|
1294
1294
|
return this.config_send(sensor_mac, packet);
|
|
1295
1295
|
}
|
|
1296
1296
|
config_set_reset_timeout_108(sensor_mac, value){
|
|
1297
|
-
console.log('
|
|
1297
|
+
console.log('config_set_reset_timeout_108');
|
|
1298
1298
|
var packet = [244, 49, 0, 0, 0];
|
|
1299
1299
|
let timeout = int2Bytes((value), 2);
|
|
1300
1300
|
packet.push(...timeout);
|
|
@@ -1309,7 +1309,7 @@ module.exports = class WirelessSensor{
|
|
|
1309
1309
|
}
|
|
1310
1310
|
config_set_quality_of_service_108(sensor_mac, value){
|
|
1311
1311
|
console.log('config_set_quality_of_service_108');
|
|
1312
|
-
var packet = [244, 52, 0, 0, 0, value]
|
|
1312
|
+
var packet = [244, 52, 0, 0, 0, value];
|
|
1313
1313
|
console.log(packet);
|
|
1314
1314
|
return this.config_send(sensor_mac, packet);
|
|
1315
1315
|
}
|
|
@@ -1328,28 +1328,40 @@ module.exports = class WirelessSensor{
|
|
|
1328
1328
|
}
|
|
1329
1329
|
config_set_shift_one_108(sensor_mac, hours, minutes){
|
|
1330
1330
|
console.log('config_set_shift_one_108');
|
|
1331
|
-
var packet = [244, 47, 0, 0, 0, 0, hours, minutes]
|
|
1331
|
+
var packet = [244, 47, 0, 0, 0, 0, hours, minutes];
|
|
1332
1332
|
console.log(packet);
|
|
1333
1333
|
return this.config_send(sensor_mac, packet);
|
|
1334
1334
|
}
|
|
1335
1335
|
config_set_shift_two_108(sensor_mac, hours, minutes){
|
|
1336
1336
|
console.log('config_set_shift_two_108');
|
|
1337
|
-
var packet = [244, 47, 0, 0, 0, 1, hours, minutes]
|
|
1337
|
+
var packet = [244, 47, 0, 0, 0, 1, hours, minutes];
|
|
1338
1338
|
console.log(packet);
|
|
1339
1339
|
return this.config_send(sensor_mac, packet);
|
|
1340
1340
|
}
|
|
1341
1341
|
config_set_shift_three_108(sensor_mac, hours, minutes){
|
|
1342
1342
|
console.log('config_set_shift_three_108');
|
|
1343
|
-
var packet = [244, 47, 0, 0, 0, 2, hours, minutes]
|
|
1343
|
+
var packet = [244, 47, 0, 0, 0, 2, hours, minutes];
|
|
1344
1344
|
console.log(packet);
|
|
1345
1345
|
return this.config_send(sensor_mac, packet);
|
|
1346
1346
|
}
|
|
1347
1347
|
config_set_shift_four_108(sensor_mac, hours, minutes){
|
|
1348
1348
|
console.log('config_set_shift_four_108');
|
|
1349
|
-
var packet = [244, 47, 0, 0, 0, 3, hours, minutes]
|
|
1350
|
-
console.log(packet);
|
|
1351
|
-
return this.config_send(sensor_mac, packet);
|
|
1352
|
-
}
|
|
1349
|
+
var packet = [244, 47, 0, 0, 0, 3, hours, minutes];
|
|
1350
|
+
console.log(packet);
|
|
1351
|
+
return this.config_send(sensor_mac, packet);
|
|
1352
|
+
}
|
|
1353
|
+
config_set_fly_interval_108(sensor_mac, value){
|
|
1354
|
+
console.log('config_set_fly_interval_108');
|
|
1355
|
+
var packet = [247, 56, 0, 0, 0, 0, value];
|
|
1356
|
+
console.log(packet);
|
|
1357
|
+
return this.config_send(sensor_mac, packet);
|
|
1358
|
+
}
|
|
1359
|
+
config_set_sample_rate_108(sensor_mac, value){
|
|
1360
|
+
console.log('config_set_sample_rate_108');
|
|
1361
|
+
var packet = [244, 57, 0, 0, 0, value];
|
|
1362
|
+
console.log(packet);
|
|
1363
|
+
return this.config_send(sensor_mac, packet, {}, 6000);
|
|
1364
|
+
}
|
|
1353
1365
|
config_set_sensor_boot_time_420ma(sensor_mac, value){
|
|
1354
1366
|
console.log('sensor_boot_time_420ma');
|
|
1355
1367
|
var packet = [244, 68, 0, 0, 45, value];
|
|
@@ -1985,6 +1997,20 @@ module.exports = class WirelessSensor{
|
|
|
1985
1997
|
console.log(packet);
|
|
1986
1998
|
return this.config_send(sensor_mac, packet);
|
|
1987
1999
|
}
|
|
2000
|
+
config_set_tare_the_scale_217(sensor_mac){
|
|
2001
|
+
console.log('config_set_tare_the_scale_217');
|
|
2002
|
+
var packet = [244, 32, 0, 0, 26];
|
|
2003
|
+
console.log(packet);
|
|
2004
|
+
return this.config_send(sensor_mac, packet);
|
|
2005
|
+
}
|
|
2006
|
+
config_set_weight_calib_217(sensor_mac, value){
|
|
2007
|
+
console.log('config_set_weight_calib_217');
|
|
2008
|
+
var packet = [244, 33, 0, 0, 26];
|
|
2009
|
+
let value_ = int2Bytes((value*100), 4);
|
|
2010
|
+
packet.push(...value_);
|
|
2011
|
+
console.log(packet);
|
|
2012
|
+
return this.config_send(sensor_mac, packet);
|
|
2013
|
+
}
|
|
1988
2014
|
config_get_delay(sensor_mac){
|
|
1989
2015
|
return new Promise((fulfill, reject) => {
|
|
1990
2016
|
this.config_send(sensor_mac, [247, 21, 0, 0, 0]).then((res) => {
|
package/package.json
CHANGED
package/wireless.html
CHANGED
|
@@ -686,7 +686,17 @@
|
|
|
686
686
|
sensor_reset_120: {value:0},
|
|
687
687
|
sensor_calib_120: {value:0},
|
|
688
688
|
alert_threshold_120_active: {value: ""},
|
|
689
|
-
alert_threshold_120: {value: 0, validate: NCD_validators.number_range(0, 40)}
|
|
689
|
+
alert_threshold_120: {value: 0, validate: NCD_validators.number_range(0, 40)},
|
|
690
|
+
|
|
691
|
+
tare_the_scale_217: {value:0},
|
|
692
|
+
weight_calib_217_active: {value: ""},
|
|
693
|
+
weight_calib_217: {value: 0},
|
|
694
|
+
|
|
695
|
+
fly_interval_108_active: {value: ""},
|
|
696
|
+
fly_interval_108: {value: 0},
|
|
697
|
+
|
|
698
|
+
sample_rate_108_active: {value: ""},
|
|
699
|
+
sample_rate_108: {value: 0}
|
|
690
700
|
},
|
|
691
701
|
inputs: 0,
|
|
692
702
|
outputs: 1,
|
|
@@ -2830,6 +2840,46 @@
|
|
|
2830
2840
|
<input type="checkbox" id="node-input-rtc_108" value="1">
|
|
2831
2841
|
</div>
|
|
2832
2842
|
</div>
|
|
2843
|
+
<div class="form-row ncd-active-check">
|
|
2844
|
+
<strong>Set FLY Interval</strong>
|
|
2845
|
+
<div>
|
|
2846
|
+
<label for="node-input-fly_interval_108_active">Active:</label>
|
|
2847
|
+
<input type="checkbox" id="node-input-fly_interval_108_active" class="ncd-config-toggle" data-target-id="node-input-fly_interval_108" value="1">
|
|
2848
|
+
</div>
|
|
2849
|
+
<div>
|
|
2850
|
+
<label for="node-input-fly_interval_108"><i class="icon-tag"></i>Value:</label>
|
|
2851
|
+
<select id="node-input-fly_interval_108">
|
|
2852
|
+
<option value="60">1 Hour</option>
|
|
2853
|
+
<option value="120">2 Hours</option>
|
|
2854
|
+
<option value="240">4 Hours</option>
|
|
2855
|
+
<option value="480">8 Hours</option>
|
|
2856
|
+
<option value="720">12 Hours</option>
|
|
2857
|
+
<option value="1080">18 Hours</option>
|
|
2858
|
+
<option value="1440">24 Hours</option>
|
|
2859
|
+
</select>
|
|
2860
|
+
</div>
|
|
2861
|
+
</div>
|
|
2862
|
+
<div class="form-row ncd-active-check">
|
|
2863
|
+
<strong>Set Sample Rate</strong>
|
|
2864
|
+
<p class="caption">
|
|
2865
|
+
Only applies to sensor with firmware version 8 and above.
|
|
2866
|
+
</p>
|
|
2867
|
+
<div>
|
|
2868
|
+
<label for="node-input-sample_rate_108_active">Active:</label>
|
|
2869
|
+
<input type="checkbox" id="node-input-sample_rate_108_active" class="ncd-config-toggle" data-target-id="node-input-sample_rate_108" value="1">
|
|
2870
|
+
</div>
|
|
2871
|
+
<div>
|
|
2872
|
+
<label for="node-input-sample_rate_108"><i class="icon-tag"></i>Value:</label>
|
|
2873
|
+
<select id="node-input-sample_rate_108">
|
|
2874
|
+
<option value="0">10 Hz</option>
|
|
2875
|
+
<option value="1">20 Hz</option>
|
|
2876
|
+
<option value="2">50 Hz</option>
|
|
2877
|
+
<option value="3">100 Hz</option>
|
|
2878
|
+
<option value="4">200 Hz</option>
|
|
2879
|
+
<option value="5">400 Hz</option>
|
|
2880
|
+
</select>
|
|
2881
|
+
</div>
|
|
2882
|
+
</div>
|
|
2833
2883
|
</div>
|
|
2834
2884
|
<div class="ncd-dependent" data-sensor-35 data-sensor-36>
|
|
2835
2885
|
<hr>
|
|
@@ -4326,6 +4376,28 @@
|
|
|
4326
4376
|
</div>
|
|
4327
4377
|
</div>
|
|
4328
4378
|
</div>
|
|
4379
|
+
<div class="ncd-dependent" data-sensor-217>
|
|
4380
|
+
<div class="form-row ncd-active-check">
|
|
4381
|
+
<strong>Tare The Scale</strong>
|
|
4382
|
+
<div>
|
|
4383
|
+
<label for="node-input-tare_the_scale_217"><i class="icon-tag"></i>Active:</label>
|
|
4384
|
+
<input type="checkbox" id="node-input-tare_the_scale_217" value="1">
|
|
4385
|
+
</div>
|
|
4386
|
+
</div>
|
|
4387
|
+
<div class="form-row ncd-active-check">
|
|
4388
|
+
<div>
|
|
4389
|
+
<strong>Set Weight Calibration</strong>
|
|
4390
|
+
</div>
|
|
4391
|
+
<div>
|
|
4392
|
+
<label for="node-input-weight_calib_217_active"><i class="icon-tag"></i>Active:</label>
|
|
4393
|
+
<input type="checkbox" id="node-input-weight_calib_217_active" class="ncd-config-toggle" data-target-id="node-input-weight_calib_217" value="1">
|
|
4394
|
+
</div>
|
|
4395
|
+
<div>
|
|
4396
|
+
<label for="node-input-weight_calib_217"><i class="icon-tag"></i> Value</label>
|
|
4397
|
+
<input type="text" id="node-input-weight_calib_217" placeholder="0" value="0">
|
|
4398
|
+
</div>
|
|
4399
|
+
</div>
|
|
4400
|
+
</div>
|
|
4329
4401
|
</div>
|
|
4330
4402
|
</div>
|
|
4331
4403
|
</script>
|
package/wireless.js
CHANGED
|
@@ -1959,6 +1959,12 @@ module.exports = function(RED) {
|
|
|
1959
1959
|
if(config.quality_of_service_108_active){
|
|
1960
1960
|
promises.quality_of_service_108 = node.config_gateway.config_set_quality_of_service_108(mac, parseInt(config.quality_of_service_108));
|
|
1961
1961
|
}
|
|
1962
|
+
if(config.fly_interval_108_active){
|
|
1963
|
+
promises.fly_interval_108 = node.config_gateway.config_set_fly_interval_108(mac, parseInt(config.fly_interval_108));
|
|
1964
|
+
}
|
|
1965
|
+
if(config.sample_rate_108_active){
|
|
1966
|
+
promises.sample_rate_108 = node.config_gateway.config_set_sample_rate_108(mac, parseInt(config.sample_rate_108));
|
|
1967
|
+
}
|
|
1962
1968
|
break;
|
|
1963
1969
|
case 110:
|
|
1964
1970
|
if(config.odr_p1_110_active){
|
|
@@ -2439,6 +2445,14 @@ module.exports = function(RED) {
|
|
|
2439
2445
|
promises.probe_boot_time_202 = node.config_gateway.config_set_probe_boot_time_202(mac, parseInt(config.probe_boot_time_202));
|
|
2440
2446
|
}
|
|
2441
2447
|
break;
|
|
2448
|
+
case 217:
|
|
2449
|
+
if(config.tare_the_scale_217){
|
|
2450
|
+
promises.tare_the_scale_217 = node.config_gateway.config_set_tare_the_scale_217(mac);
|
|
2451
|
+
}
|
|
2452
|
+
if(config.weight_calib_217_active){
|
|
2453
|
+
promises.weight_calib_217 = node.config_gateway.config_set_weight_calib_217(mac, parseInt(config.weight_calib_217));
|
|
2454
|
+
}
|
|
2455
|
+
break;
|
|
2442
2456
|
case 505:
|
|
2443
2457
|
if(config.current_calibration_c1_80_active){
|
|
2444
2458
|
promises.current_calibration_c1_80_active = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|