@ncd-io/node-red-enterprise-sensors 1.0.3 → 1.0.4
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
CHANGED
|
@@ -142,7 +142,7 @@ module.exports = class WirelessSensor{
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
// #OTF
|
|
145
|
-
var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540];
|
|
145
|
+
var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
146
146
|
var device_type = msbLsb(frame.data[6], frame.data[7]);
|
|
147
147
|
// var device_type = frame.data[7];
|
|
148
148
|
|
|
@@ -294,7 +294,7 @@ module.exports = class WirelessSensor{
|
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// #OTF
|
|
297
|
-
var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540];
|
|
297
|
+
var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
298
298
|
if(otf_devices.includes(parsed.sensor_type)){
|
|
299
299
|
// If the message says FLY and there is not FLY timer in progress.
|
|
300
300
|
if(payload[8] == 70 && payload[9] == 76 && payload[10] == 89) {
|
package/package.json
CHANGED
package/wireless.html
CHANGED
|
@@ -196,6 +196,7 @@
|
|
|
196
196
|
pan_id_active: {value: ""},
|
|
197
197
|
pan_id: {value: '7FFF', validate: NCD_validators.number_range(0, 0x7FFF, 16)},//(0 - 0x7FFF)
|
|
198
198
|
|
|
199
|
+
change_detection_t3_active: {value: ""},
|
|
199
200
|
change_enabled: {value: ""},
|
|
200
201
|
change_pr: {value: "0", validate: NCD_validators.number_range(0, 255)},
|
|
201
202
|
change_interval: {value: "0", validate: NCD_validators.number_range(0, 16712198)},
|
|
@@ -562,6 +563,8 @@
|
|
|
562
563
|
"538": "538 - Custom One Channel Vibration Plus",
|
|
563
564
|
"539": "539 - RS-485 Modbus Wireless Converter",
|
|
564
565
|
"540": "540 - Wireless Ultrasonic Flow Meter FD-Q32C",
|
|
566
|
+
"1010": "1010 - RS-232 Wireless Converter 1010",
|
|
567
|
+
"1011": "1011 - RS-485 Wireless Converter 1011",
|
|
565
568
|
"10000": "10000 - 4-Channel Relay",
|
|
566
569
|
"10006": "10006 - 4-Channel 4-20 mA Input",
|
|
567
570
|
"10007": "10007 - 4-Channel Current Monitor",
|
|
@@ -850,6 +853,8 @@
|
|
|
850
853
|
<option value="538">538 - Custom One Channel Vibration Plus</option>
|
|
851
854
|
<option value="539">539 - RS-485 Modbus Wireless Converter</option>
|
|
852
855
|
<option value="540">540 - Wireless Ultrasonic Flow Meter FD-Q32C</option>
|
|
856
|
+
<option value="1010">1010 - RS-232 Wireless Converter 1010</option>
|
|
857
|
+
<option value="1011">1011 - RS-485 Wireless Converter 1011</option>
|
|
853
858
|
<option value="10000">10000 - 4-Channel Relay</option>
|
|
854
859
|
<option value="10006">10006 - 4-Channel 4-20 mA Input</option>
|
|
855
860
|
<option value="10007">10007 - 4-Channel Current Monitor</option>
|
|
@@ -863,7 +868,7 @@
|
|
|
863
868
|
<label for="node-input-auto_config"><i class="icon-tag"></i> Auto Config</label>
|
|
864
869
|
<input class="section-control" type="checkbox" id="node-input-auto_config" value="1">
|
|
865
870
|
</div>
|
|
866
|
-
<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-105 data-sensor-106 data-sensor-107 data-sensor-108 data-sensor-110 data-sensor-111 data-sensor-112 data-sensor-114 data-sensor-180 data-sensor-181 data-sensor-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-535 data-sensor-537 data-sensor-538 data-sensor-540>
|
|
871
|
+
<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-105 data-sensor-106 data-sensor-107 data-sensor-108 data-sensor-110 data-sensor-111 data-sensor-112 data-sensor-114 data-sensor-180 data-sensor-181 data-sensor-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-535 data-sensor-537 data-sensor-538 data-sensor-539 data-sensor-540 data-sensor-1010 data-sensor-1011>
|
|
867
872
|
<hr>
|
|
868
873
|
<label for="node-input-on_the_fly_enable"><i class="icon-tag"></i> OTF Config*</label>
|
|
869
874
|
<input type="checkbox" id="node-input-on_the_fly_enable" value="1">
|
|
@@ -957,18 +962,25 @@
|
|
|
957
962
|
<input type="text" id="node-input-retries">
|
|
958
963
|
</div>
|
|
959
964
|
</div>
|
|
960
|
-
<div class="ncd-dependent" data-sensor-
|
|
961
|
-
<div class="form-row">
|
|
962
|
-
<
|
|
963
|
-
<
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
<
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
<
|
|
965
|
+
<div class="ncd-dependent" data-sensor-3 data-sensor-10 data-sensor-13>
|
|
966
|
+
<div class="form-row ncd-active-check">
|
|
967
|
+
<strong>Percentage Change Detection</strong>
|
|
968
|
+
<div>
|
|
969
|
+
<label for="node-input-change_detection_t3_active">Active:</label>
|
|
970
|
+
<input type="checkbox" id="node-input-change_detection_t3_active" class="ncd-config-toggle" data-target-class="change_detection_t3" value="1">
|
|
971
|
+
</div>
|
|
972
|
+
<div class="form-row">
|
|
973
|
+
<label for="node-input-change_enabled"><i class="icon-tag"></i>Enable:</label>
|
|
974
|
+
<input type="checkbox" id="node-input-change_enabled" class="change_detection_t3" value="1">
|
|
975
|
+
</div>
|
|
976
|
+
<div class="form-row">
|
|
977
|
+
<label for="node-input-change_pr"><i class="icon-tag"></i>Percentage Change Threshold (0-255)</label>
|
|
978
|
+
<input type="text" id="node-input-change_pr" class="change_detection_t3">
|
|
979
|
+
</div>
|
|
980
|
+
<div class="form-row">
|
|
981
|
+
<label for="node-input-change_interval"><i class="icon-tag"></i>Percentage Change Interval (seconds)</label>
|
|
982
|
+
<input type="text" id="node-input-change_interval" class="change_detection_t3">
|
|
983
|
+
</div>
|
|
972
984
|
</div>
|
|
973
985
|
</div>
|
|
974
986
|
<!-- Current Monitor Options -->
|
|
@@ -2167,7 +2179,7 @@
|
|
|
2167
2179
|
</div>
|
|
2168
2180
|
</div>
|
|
2169
2181
|
</div>
|
|
2170
|
-
<div class="ncd-dependent" data-sensor-539>
|
|
2182
|
+
<div class="ncd-dependent" data-sensor-539 data-sensor-1010 data-sensor-1011>
|
|
2171
2183
|
<div class="form-row ncd-active-check">
|
|
2172
2184
|
<strong>Set Stay On Mode</strong>
|
|
2173
2185
|
<div>
|
|
@@ -2210,6 +2222,8 @@
|
|
|
2210
2222
|
<input type="text" id="node-input-rx_timeout_539" placeholder="10" value="10">
|
|
2211
2223
|
</div>
|
|
2212
2224
|
</div>
|
|
2225
|
+
</div>
|
|
2226
|
+
<div class="ncd-dependent" data-sensor-539>
|
|
2213
2227
|
<div class="form-row ncd-active-check">
|
|
2214
2228
|
<strong>Set Bootup Time</strong>
|
|
2215
2229
|
<div>
|
|
@@ -2334,45 +2348,6 @@
|
|
|
2334
2348
|
</div>
|
|
2335
2349
|
</div>
|
|
2336
2350
|
|
|
2337
|
-
<div class="ncd-dependent" data-sensor-110 data-sensor-111 data-sensor-112 data-sensor-114>
|
|
2338
|
-
<div class="form-row ncd-active-check">
|
|
2339
|
-
<strong>Set Auto Raw Interval</strong>
|
|
2340
|
-
<div>
|
|
2341
|
-
<label for="node-input-auto_raw_interval_110_active">Active:</label>
|
|
2342
|
-
<input type="checkbox" id="node-input-auto_raw_interval_110_active" class="ncd-config-toggle" data-target-id="node-input-auto_raw_interval_110" value="1">
|
|
2343
|
-
</div>
|
|
2344
|
-
<div>
|
|
2345
|
-
<label for="node-input-auto_raw_interval_110"><i class="icon-tag"></i>Address:</label>
|
|
2346
|
-
<input type="text" id="node-input-auto_raw_interval_110" value="0">
|
|
2347
|
-
</div>
|
|
2348
|
-
</div>
|
|
2349
|
-
<div class="form-row ncd-active-check">
|
|
2350
|
-
<strong>Set Auto Raw Destination Address</strong>
|
|
2351
|
-
<div>
|
|
2352
|
-
<label for="node-input-auto_raw_destination_110_active">Active:</label>
|
|
2353
|
-
<input type="checkbox" id="node-input-auto_raw_destination_110_active" class="ncd-config-toggle" data-target-id="node-input-auto_raw_destination_110" value="1">
|
|
2354
|
-
</div>
|
|
2355
|
-
<div>
|
|
2356
|
-
<label for="node-input-auto_raw_destination_110"><i class="icon-tag"></i>Address:</label>
|
|
2357
|
-
<input type="text" id="node-input-auto_raw_destination_110" value="0000FFFF">
|
|
2358
|
-
</div>
|
|
2359
|
-
<p class="caption">
|
|
2360
|
-
Default value: 0000FFFF for Broadcast Mode<br>
|
|
2361
|
-
Example of targeted address: 41D5EC37
|
|
2362
|
-
</p>
|
|
2363
|
-
</div>
|
|
2364
|
-
<div class="form-row ncd-active-check">
|
|
2365
|
-
<strong>Set Smart Mode Threshold</strong>
|
|
2366
|
-
<div>
|
|
2367
|
-
<label for="node-input-smart_threshold_110_active">Active:</label>
|
|
2368
|
-
<input type="checkbox" id="node-input-smart_threshold_110_active" class="ncd-config-toggle" data-target-id="node-input-smart_threshold_110" value="1">
|
|
2369
|
-
</div>
|
|
2370
|
-
<div>
|
|
2371
|
-
<label for="node-input-smart_threshold_110"><i class="icon-tag"></i>Value:</label>
|
|
2372
|
-
<input type="text" id="node-input-smart_threshold_110" value="1">
|
|
2373
|
-
</div>
|
|
2374
|
-
</div>
|
|
2375
|
-
</div>
|
|
2376
2351
|
<div class="ncd-dependent" data-sensor-114>
|
|
2377
2352
|
<div class="form-row ncd-active-check">
|
|
2378
2353
|
<strong>Clear Probe Uptimers</strong>
|
package/wireless.js
CHANGED
|
@@ -806,10 +806,7 @@ module.exports = function(RED) {
|
|
|
806
806
|
if(config.retries_active){
|
|
807
807
|
promises.retries = node.config_gateway.config_set_retries(mac, parseInt(config.retries));
|
|
808
808
|
}
|
|
809
|
-
|
|
810
|
-
if(change_detection.indexOf(sensor.type) > -1){
|
|
811
|
-
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
812
|
-
}
|
|
809
|
+
|
|
813
810
|
switch(sensor.type){
|
|
814
811
|
case 2:
|
|
815
812
|
if(config.debounce_time_2_active){
|
|
@@ -826,6 +823,9 @@ module.exports = function(RED) {
|
|
|
826
823
|
if(config.high_calibration_420ma_active){
|
|
827
824
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
828
825
|
}
|
|
826
|
+
if(config.change_detection_t3_active){
|
|
827
|
+
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
828
|
+
}
|
|
829
829
|
break;
|
|
830
830
|
case 5:
|
|
831
831
|
promises.acceleration_range = node.config_gateway.config_set_amgt_accel(mac, parseInt(config.amgt_accel));
|
|
@@ -856,6 +856,11 @@ module.exports = function(RED) {
|
|
|
856
856
|
// promises.impact_threshold = node.config_gateway.config_set_impact_threshold(mac, parseInt(config.impact_threshold));
|
|
857
857
|
// promises.impact_duration = node.config_gateway.config_set_impact_duration(mac, parseInt(config.impact_duration));
|
|
858
858
|
break;
|
|
859
|
+
case 10:
|
|
860
|
+
if(config.change_detection_t3_active){
|
|
861
|
+
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
862
|
+
}
|
|
863
|
+
break;
|
|
859
864
|
case 13:
|
|
860
865
|
if(config.current_calibration_13_active){
|
|
861
866
|
var cali = parseInt(config.current_calibration_13);
|
|
@@ -863,6 +868,9 @@ module.exports = function(RED) {
|
|
|
863
868
|
promises.current_calibration_13 = node.config_gateway.config_set_current_calibration_13(mac, cali);
|
|
864
869
|
}
|
|
865
870
|
}
|
|
871
|
+
if(config.change_detection_t3_active){
|
|
872
|
+
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
873
|
+
}
|
|
866
874
|
break;
|
|
867
875
|
case 14:
|
|
868
876
|
if(config.sensor_boot_time_420ma_active){
|
|
@@ -2035,6 +2043,28 @@ module.exports = function(RED) {
|
|
|
2035
2043
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
2036
2044
|
}
|
|
2037
2045
|
break;
|
|
2046
|
+
case 1010:
|
|
2047
|
+
if(config.stay_on_mode_539_active){
|
|
2048
|
+
promises.stay_on_mode_539 = node.config_gateway.config_set_stay_on_mode_539(mac, parseInt(config.stay_on_mode_539));
|
|
2049
|
+
}
|
|
2050
|
+
if(config.baudrate_539_active){
|
|
2051
|
+
promises.baudrate_539 = node.config_gateway.config_set_baudrate_539(mac, parseInt(config.baudrate_539));
|
|
2052
|
+
}
|
|
2053
|
+
if(config.rx_timeout_539_active){
|
|
2054
|
+
promises.rx_timeout_539 = node.config_gateway.config_set_rx_timeout_539(mac, parseInt(config.rx_timeout_539));
|
|
2055
|
+
}
|
|
2056
|
+
break;
|
|
2057
|
+
case 1011:
|
|
2058
|
+
if(config.stay_on_mode_539_active){
|
|
2059
|
+
promises.stay_on_mode_539 = node.config_gateway.config_set_stay_on_mode_539(mac, parseInt(config.stay_on_mode_539));
|
|
2060
|
+
}
|
|
2061
|
+
if(config.baudrate_539_active){
|
|
2062
|
+
promises.baudrate_539 = node.config_gateway.config_set_baudrate_539(mac, parseInt(config.baudrate_539));
|
|
2063
|
+
}
|
|
2064
|
+
if(config.rx_timeout_539_active){
|
|
2065
|
+
promises.rx_timeout_539 = node.config_gateway.config_set_rx_timeout_539(mac, parseInt(config.rx_timeout_539));
|
|
2066
|
+
}
|
|
2067
|
+
break;
|
|
2038
2068
|
}
|
|
2039
2069
|
}
|
|
2040
2070
|
// These sensors listed in original_otf_devices use a different OTF code.
|
|
@@ -2252,9 +2282,14 @@ module.exports = function(RED) {
|
|
|
2252
2282
|
// _send_otn_request(sensor);
|
|
2253
2283
|
// Sensors having issues seeing OTN request sent too quickly
|
|
2254
2284
|
// Added timeout to fix issue
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
}
|
|
2285
|
+
if(config.sensor_type == 1010 || config.sensor_type == 1011){
|
|
2286
|
+
_config(sensor, true);
|
|
2287
|
+
}else{
|
|
2288
|
+
var tout = setTimeout(() => {
|
|
2289
|
+
_send_otn_request(sensor);
|
|
2290
|
+
}, 100);
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2258
2293
|
}else if(config.auto_config && config.on_the_fly_enable && sensor.mode == "OTN"){
|
|
2259
2294
|
if(config.sensor_type == 101 || config.sensor_type == 102){
|
|
2260
2295
|
if(this.gateway.hasOwnProperty('fly_101_in_progress') && this.gateway.fly_101_in_progress == false || !this.gateway.hasOwnProperty('fly_101_in_progress')){
|