@ncd-io/node-red-enterprise-sensors 1.0.6 → 1.0.8
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 +179 -37
- package/package.json +1 -1
- package/wireless.html +610 -62
- package/wireless.js +152 -46
package/wireless.js
CHANGED
|
@@ -54,9 +54,17 @@ module.exports = function(RED) {
|
|
|
54
54
|
this.gateway.digi.report_rssi = config.rssi;
|
|
55
55
|
|
|
56
56
|
if(config.comm_type == 'serial'){
|
|
57
|
-
|
|
57
|
+
if(config.port !== ''){
|
|
58
|
+
setTimeout(()=>{node.gateway.digi.serial.setupSerial()}, 5000);
|
|
59
|
+
}else{
|
|
60
|
+
node.warn('No Port Selected for Serial Communications.')
|
|
61
|
+
}
|
|
58
62
|
}else{
|
|
59
|
-
|
|
63
|
+
if(config.tcp_port === '' || config.ip_address === ''){
|
|
64
|
+
node.warn('TCP Socket not configured for Network Communications. Please enter a Port and IP Address.');
|
|
65
|
+
}else{
|
|
66
|
+
setTimeout(()=>{node.gateway.digi.serial.setupClient()}, 5000);
|
|
67
|
+
}
|
|
60
68
|
}
|
|
61
69
|
node.gateway.digi.serial.on('ready', () => {
|
|
62
70
|
node.gateway.digi.send.at_command('SL').then((res) => {
|
|
@@ -671,7 +679,7 @@ module.exports = function(RED) {
|
|
|
671
679
|
|
|
672
680
|
var promises = {};
|
|
673
681
|
// This command is used for OTF on types 53, 80,81,82,83,84, 101, 102, 110, 111, 518, 519
|
|
674
|
-
let original_otf_devices = [53, 80, 81, 82, 83, 84, 101, 102, 180, 181, 518, 519, 520, 538];
|
|
682
|
+
let original_otf_devices = [53, 80, 81, 82, 83, 84, 101, 102, 110, 111, 112, 114, 180, 181, 518, 519, 520, 538];
|
|
675
683
|
if(original_otf_devices.includes(sensor.type)){
|
|
676
684
|
// This command is used for OTF on types 53, 80, 81, 82, 83, 84, 101, 102, 110, 111, 518, 519
|
|
677
685
|
promises.config_enter_otn_mode = node.config_gateway.config_enter_otn_mode(sensor.mac);
|
|
@@ -718,6 +726,7 @@ module.exports = function(RED) {
|
|
|
718
726
|
var promises = {};
|
|
719
727
|
|
|
720
728
|
promises.broadcast_rtc = node.config_gateway.config_set_rtc_101('00:00:00:00:00:00:FF:FF');
|
|
729
|
+
promises.broadcast_rtc_202 = node.config_gateway.config_set_rtc_202('00:00:00:00:00:00:FF:FF');
|
|
721
730
|
|
|
722
731
|
promises.finish = new Promise((fulfill, reject) => {
|
|
723
732
|
node.config_gateway.queue.add(() => {
|
|
@@ -868,6 +877,12 @@ module.exports = function(RED) {
|
|
|
868
877
|
promises.current_calibration_13 = node.config_gateway.config_set_current_calibration_13(mac, cali);
|
|
869
878
|
}
|
|
870
879
|
}
|
|
880
|
+
// if(config.current_calibration_13_dep_active){
|
|
881
|
+
// var cali = parseInt(config.current_calibration_13_dep);
|
|
882
|
+
// if(cali != 0){
|
|
883
|
+
// promises.current_calibration_13_dep = node.config_gateway.config_set_current_calibration_13_dep(mac, cali);
|
|
884
|
+
// }
|
|
885
|
+
// }
|
|
871
886
|
if(config.change_detection_t3_active){
|
|
872
887
|
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
888
|
}
|
|
@@ -899,6 +914,18 @@ module.exports = function(RED) {
|
|
|
899
914
|
promises.current_calibration_ch2_19 = node.config_gateway.config_set_current_calibration_ch2_19(mac, cali);
|
|
900
915
|
}
|
|
901
916
|
}
|
|
917
|
+
// if(config.current_calibration_13_dep_active){
|
|
918
|
+
// var cali = parseInt(config.current_calibration_13_dep);
|
|
919
|
+
// if(cali != 0){
|
|
920
|
+
// promises.current_calibration_13_dep = node.config_gateway.config_set_current_calibration_13_dep(mac, cali);
|
|
921
|
+
// }
|
|
922
|
+
// }
|
|
923
|
+
// if(config.current_calibration_ch2_19_dep_active){
|
|
924
|
+
// var cali = parseInt(config.current_calibration_ch2_19_dep);
|
|
925
|
+
// if(cali != 0){
|
|
926
|
+
// promises.current_calibration_ch2_19_dep = node.config_gateway.config_set_current_calibration_ch2_19_dep(mac, cali);
|
|
927
|
+
// }
|
|
928
|
+
// }
|
|
902
929
|
break;
|
|
903
930
|
case 23:
|
|
904
931
|
if(config.thermocouple_type_23_active){
|
|
@@ -953,7 +980,56 @@ module.exports = function(RED) {
|
|
|
953
980
|
promises.current_calibration_ch3_28 = node.config_gateway.config_set_current_calibration_ch3_28(mac, cali);
|
|
954
981
|
}
|
|
955
982
|
}
|
|
983
|
+
// if(config.current_calibration_13_dep_active){
|
|
984
|
+
// var cali = parseInt(config.current_calibration_13_dep);
|
|
985
|
+
// if(cali != 0){
|
|
986
|
+
// promises.current_calibration_13_dep = node.config_gateway.config_set_current_calibration_13_dep(mac, cali);
|
|
987
|
+
// }
|
|
988
|
+
// }
|
|
989
|
+
// if(config.current_calibration_ch2_19_dep_active){
|
|
990
|
+
// var cali = parseInt(config.current_calibration_ch2_19_dep);
|
|
991
|
+
// if(cali != 0){
|
|
992
|
+
// promises.current_calibration_ch2_19_dep = node.config_gateway.config_set_current_calibration_ch2_19_dep(mac, cali);
|
|
993
|
+
// }
|
|
994
|
+
// }
|
|
995
|
+
// if(config.current_calibration_ch3_28_dep_active){
|
|
996
|
+
// var cali = parseInt(config.current_calibration_ch3_28_dep);
|
|
997
|
+
// if(cali != 0){
|
|
998
|
+
// promises.current_calibration_ch3_28_dep = node.config_gateway.config_set_current_calibration_ch3_28_dep(mac, cali);
|
|
999
|
+
// }
|
|
1000
|
+
// }
|
|
1001
|
+
if(config.change_detection_t3_active){
|
|
1002
|
+
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
1003
|
+
}
|
|
1004
|
+
if(config.change_detection_ch2_active){
|
|
1005
|
+
promises.change_detection_ch2 = node.config_gateway.config_set_change_detection_ch2(mac, config.change_enabled_ch2 ? 1 : 0, parseInt(config.change_pr_ch2), parseInt(config.change_interval_ch2));
|
|
1006
|
+
}
|
|
1007
|
+
if(config.change_detection_ch3_active){
|
|
1008
|
+
promises.change_detection_ch3 = node.config_gateway.config_set_change_detection_ch3(mac, config.change_enabled_ch3 ? 1 : 0, parseInt(config.change_pr_ch3), parseInt(config.change_interval_ch3));
|
|
1009
|
+
}
|
|
1010
|
+
break;
|
|
1011
|
+
case 32:
|
|
1012
|
+
if(config.sps_skip_samples_32_active){
|
|
1013
|
+
promises.sps_skip_samples_32 = node.config_gateway.config_set_sps_skip_samples_32(mac, parseInt(config.sps_skip_samples_32));
|
|
1014
|
+
}
|
|
956
1015
|
break;
|
|
1016
|
+
case 33:
|
|
1017
|
+
if(config.clear_counter_33){
|
|
1018
|
+
promises.clear_counter_33 = node.config_gateway.config_set_clear_counter_33(mac);
|
|
1019
|
+
}
|
|
1020
|
+
if(config.input_two_108_active){
|
|
1021
|
+
promises.input_two_108 = node.config_gateway.config_set_input_two_108(mac, parseInt(config.input_two_108));
|
|
1022
|
+
}
|
|
1023
|
+
if(config.counter_threshold_108_active){
|
|
1024
|
+
promises.counter_threshold_108 = node.config_gateway.config_set_counter_threshold_108(mac, parseInt(config.counter_threshold_108));
|
|
1025
|
+
}
|
|
1026
|
+
if(config.debounce_time_108_active){
|
|
1027
|
+
promises.debounce_time_108 = node.config_gateway.config_set_debounce_time_108(mac, parseInt(config.debounce_time_108));
|
|
1028
|
+
}
|
|
1029
|
+
if(config.push_notification_33_active){
|
|
1030
|
+
promises.push_notification_33 = node.config_gateway.config_set_push_notification_33(mac, parseInt(config.push_notification_33));
|
|
1031
|
+
}
|
|
1032
|
+
break;
|
|
957
1033
|
case 35:
|
|
958
1034
|
if(config.counter_threshold_35_active){
|
|
959
1035
|
promises.config_set_counter_threshold_35 = node.config_gateway.config_set_counter_threshold_35(mac, parseInt(config.counter_threshold_35));
|
|
@@ -983,6 +1059,9 @@ module.exports = function(RED) {
|
|
|
983
1059
|
if(config.temperature_offset_44_active){
|
|
984
1060
|
promises.temperature_offset_44 = node.config_gateway.config_set_sensor_temperature_offset_44(mac, parseInt(config.temperature_offset_44));
|
|
985
1061
|
}
|
|
1062
|
+
if(config.scd_skip_samples_44_active){
|
|
1063
|
+
promises.scd_skip_samples_44 = node.config_gateway.config_set_scd_skip_samples_44(mac, parseInt(config.scd_skip_samples_44));
|
|
1064
|
+
}
|
|
986
1065
|
break;
|
|
987
1066
|
case 45:
|
|
988
1067
|
if(config.sensor_boot_time_420ma_active){
|
|
@@ -1039,11 +1118,27 @@ module.exports = function(RED) {
|
|
|
1039
1118
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1040
1119
|
}
|
|
1041
1120
|
break;
|
|
1121
|
+
case 53:
|
|
1122
|
+
if(config.scd_skip_samples_44_active){
|
|
1123
|
+
promises.scd_skip_samples_44 = node.config_gateway.config_set_scd_skip_samples_44(mac, parseInt(config.scd_skip_samples_44));
|
|
1124
|
+
}
|
|
1125
|
+
break;
|
|
1042
1126
|
case 56:
|
|
1043
1127
|
if(config.sensor_boot_time_420ma_active){
|
|
1044
1128
|
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1045
1129
|
}
|
|
1046
1130
|
break;
|
|
1131
|
+
case 58:
|
|
1132
|
+
if(config.calibration_58){
|
|
1133
|
+
promises.calibration_58 = node.config_gateway.config_set_calibration_58(mac);
|
|
1134
|
+
}
|
|
1135
|
+
if(config.factory_reset_tank_probe_58){
|
|
1136
|
+
promises.factory_reset_tank_probe_58 = node.config_gateway.config_set_factory_reset_tank_probe_58(mac);
|
|
1137
|
+
}
|
|
1138
|
+
if(config.set_max_range_58_active){
|
|
1139
|
+
promises.set_max_range_58 = node.config_gateway.config_set_max_range_58(mac, parseInt(config.set_max_range_58));
|
|
1140
|
+
}
|
|
1141
|
+
break;
|
|
1047
1142
|
case 76:
|
|
1048
1143
|
if(config.periodic_check_rate_76_active){
|
|
1049
1144
|
promises.periodic_check_rate_76 = node.config_gateway.config_set_periodic_check_rate_76(mac, parseInt(config.periodic_check_rate_76));
|
|
@@ -1066,9 +1161,6 @@ module.exports = function(RED) {
|
|
|
1066
1161
|
promises.sensor_boot_time_78 = node.config_gateway.config_set_sensor_boot_time_78(mac, parseInt(config.sensor_boot_time_78));
|
|
1067
1162
|
}
|
|
1068
1163
|
case 80:
|
|
1069
|
-
if(config.current_calibration_c1_80_active){
|
|
1070
|
-
promises.current_calibration_c1_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1071
|
-
}
|
|
1072
1164
|
if(config.output_data_rate_101_active){
|
|
1073
1165
|
promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));
|
|
1074
1166
|
}
|
|
@@ -1113,12 +1205,6 @@ module.exports = function(RED) {
|
|
|
1113
1205
|
}
|
|
1114
1206
|
break;
|
|
1115
1207
|
case 81:
|
|
1116
|
-
if(config.current_calibration_c1_80_active){
|
|
1117
|
-
promises.current_calibration_c1_80_active = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1118
|
-
}
|
|
1119
|
-
if(config.current_calibration_c2_80_active){
|
|
1120
|
-
promises.current_calibration_c2_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c2_80), 3);
|
|
1121
|
-
}
|
|
1122
1208
|
if(config.output_data_rate_p1_81_active){
|
|
1123
1209
|
promises.output_data_rate_p1_81 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_p1_81));
|
|
1124
1210
|
}
|
|
@@ -1412,11 +1498,11 @@ module.exports = function(RED) {
|
|
|
1412
1498
|
if(config.counter_threshold_108_active){
|
|
1413
1499
|
promises.counter_threshold_108 = node.config_gateway.config_set_counter_threshold_108(mac, parseInt(config.counter_threshold_108));
|
|
1414
1500
|
}
|
|
1501
|
+
if(config.push_notification_108_active){
|
|
1502
|
+
promises.push_notification_108 = node.config_gateway.config_set_push_notification_108(mac, parseInt(config.push_notification_108));
|
|
1503
|
+
}
|
|
1415
1504
|
break;
|
|
1416
1505
|
case 110:
|
|
1417
|
-
if(config.current_calibration_c1_80_active){
|
|
1418
|
-
promises.current_calibration_c1_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1419
|
-
}
|
|
1420
1506
|
if(config.output_data_rate_101_active){
|
|
1421
1507
|
promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));
|
|
1422
1508
|
}
|
|
@@ -1426,8 +1512,8 @@ module.exports = function(RED) {
|
|
|
1426
1512
|
if(config.x_axis_101 || config.y_axis_101 || config.z_axis_101){
|
|
1427
1513
|
promises.axis_enabled_101 = node.config_gateway.config_set_axis_enabled_101(mac, config.x_axis_101, config.y_axis_101, config.z_axis_101);
|
|
1428
1514
|
}
|
|
1429
|
-
if(config.
|
|
1430
|
-
promises.
|
|
1515
|
+
if(config.sampling_interval_110_active){
|
|
1516
|
+
promises.sampling_interval_110 = node.config_gateway.config_set_sampling_interval_101(mac, parseInt(config.sampling_interval_110));
|
|
1431
1517
|
}
|
|
1432
1518
|
if(config.full_scale_range_101_active){
|
|
1433
1519
|
promises.full_scale_range_101 = node.config_gateway.config_set_full_scale_range_101(mac, parseInt(config.full_scale_range_101));
|
|
@@ -1474,14 +1560,11 @@ module.exports = function(RED) {
|
|
|
1474
1560
|
if(config.smart_threshold_110_active){
|
|
1475
1561
|
promises.smart_threshold_110 = node.config_gateway.config_set_smart_threshold_110(mac, parseInt(config.smart_threshold_110));
|
|
1476
1562
|
}
|
|
1563
|
+
if(config.fly_interval_110_active){
|
|
1564
|
+
promises.fly_interval_110 = node.config_gateway.config_set_fly_interval_110(mac, parseInt(config.fly_interval_110));
|
|
1565
|
+
}
|
|
1477
1566
|
break;
|
|
1478
1567
|
case 111:
|
|
1479
|
-
if(config.current_calibration_c1_80_active){
|
|
1480
|
-
promises.current_calibration_c1_80_active = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1481
|
-
}
|
|
1482
|
-
if(config.current_calibration_c2_80_active){
|
|
1483
|
-
promises.current_calibration_c2_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c2_80), 3);
|
|
1484
|
-
}
|
|
1485
1568
|
if(config.output_data_rate_p1_81_active){
|
|
1486
1569
|
promises.output_data_rate_p1_81 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_p1_81));
|
|
1487
1570
|
}
|
|
@@ -1497,8 +1580,8 @@ module.exports = function(RED) {
|
|
|
1497
1580
|
if(config.x_axis_101 || config.y_axis_101 || config.z_axis_101){
|
|
1498
1581
|
promises.axis_enabled_101 = node.config_gateway.config_set_axis_enabled_101(mac, config.x_axis_101, config.y_axis_101, config.z_axis_101);
|
|
1499
1582
|
}
|
|
1500
|
-
if(config.
|
|
1501
|
-
promises.
|
|
1583
|
+
if(config.sampling_interval_110_active){
|
|
1584
|
+
promises.sampling_interval_110 = node.config_gateway.config_set_sampling_interval_101(mac, parseInt(config.sampling_interval_110));
|
|
1502
1585
|
}
|
|
1503
1586
|
if(config.full_scale_range_101_active){
|
|
1504
1587
|
promises.full_scale_range_101 = node.config_gateway.config_set_full_scale_range_101(mac, parseInt(config.full_scale_range_101));
|
|
@@ -1551,6 +1634,9 @@ module.exports = function(RED) {
|
|
|
1551
1634
|
if(config.smart_threshold_110_active){
|
|
1552
1635
|
promises.smart_threshold_110 = node.config_gateway.config_set_smart_threshold_110(mac, parseInt(config.smart_threshold_110));
|
|
1553
1636
|
}
|
|
1637
|
+
if(config.fly_interval_110_active){
|
|
1638
|
+
promises.fly_interval_110 = node.config_gateway.config_set_fly_interval_110(mac, parseInt(config.fly_interval_110));
|
|
1639
|
+
}
|
|
1554
1640
|
break;
|
|
1555
1641
|
case 112:
|
|
1556
1642
|
if(config.current_calibration_82_active){
|
|
@@ -1565,8 +1651,8 @@ module.exports = function(RED) {
|
|
|
1565
1651
|
if(config.x_axis_101 || config.y_axis_101 || config.z_axis_101){
|
|
1566
1652
|
promises.axis_enabled_101 = node.config_gateway.config_set_axis_enabled_101(mac, config.x_axis_101, config.y_axis_101, config.z_axis_101);
|
|
1567
1653
|
}
|
|
1568
|
-
if(config.
|
|
1569
|
-
promises.
|
|
1654
|
+
if(config.sampling_interval_110_active){
|
|
1655
|
+
promises.sampling_interval_110 = node.config_gateway.config_set_sampling_interval_101(mac, parseInt(config.sampling_interval_110));
|
|
1570
1656
|
}
|
|
1571
1657
|
if(config.full_scale_range_101_active){
|
|
1572
1658
|
promises.full_scale_range_101 = node.config_gateway.config_set_full_scale_range_101(mac, parseInt(config.full_scale_range_101));
|
|
@@ -1613,6 +1699,9 @@ module.exports = function(RED) {
|
|
|
1613
1699
|
if(config.smart_threshold_110_active){
|
|
1614
1700
|
promises.smart_threshold_110 = node.config_gateway.config_set_smart_threshold_110(mac, parseInt(config.smart_threshold_110));
|
|
1615
1701
|
}
|
|
1702
|
+
if(config.fly_interval_110_active){
|
|
1703
|
+
promises.fly_interval_110 = node.config_gateway.config_set_fly_interval_110(mac, parseInt(config.fly_interval_110));
|
|
1704
|
+
}
|
|
1616
1705
|
break;
|
|
1617
1706
|
case 114:
|
|
1618
1707
|
if(config.output_data_rate_101_active){
|
|
@@ -1624,8 +1713,8 @@ module.exports = function(RED) {
|
|
|
1624
1713
|
if(config.x_axis_101 || config.y_axis_101 || config.z_axis_101){
|
|
1625
1714
|
promises.axis_enabled_101 = node.config_gateway.config_set_axis_enabled_101(mac, config.x_axis_101, config.y_axis_101, config.z_axis_101);
|
|
1626
1715
|
}
|
|
1627
|
-
if(config.
|
|
1628
|
-
promises.
|
|
1716
|
+
if(config.sampling_interval_110_active){
|
|
1717
|
+
promises.sampling_interval_110 = node.config_gateway.config_set_sampling_interval_101(mac, parseInt(config.sampling_interval_110));
|
|
1629
1718
|
}
|
|
1630
1719
|
if(config.full_scale_range_101_active){
|
|
1631
1720
|
promises.full_scale_range_101 = node.config_gateway.config_set_full_scale_range_101(mac, parseInt(config.full_scale_range_101));
|
|
@@ -1684,11 +1773,11 @@ module.exports = function(RED) {
|
|
|
1684
1773
|
if(config.smart_threshold_110_active){
|
|
1685
1774
|
promises.smart_threshold_110 = node.config_gateway.config_set_smart_threshold_110(mac, parseInt(config.smart_threshold_110));
|
|
1686
1775
|
}
|
|
1776
|
+
if(config.fly_interval_110_active){
|
|
1777
|
+
promises.fly_interval_110 = node.config_gateway.config_set_fly_interval_110(mac, parseInt(config.fly_interval_110));
|
|
1778
|
+
}
|
|
1687
1779
|
break;
|
|
1688
1780
|
case 180:
|
|
1689
|
-
if(config.current_calibration_c1_80_active){
|
|
1690
|
-
promises.current_calibration_c1_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1691
|
-
}
|
|
1692
1781
|
if(config.output_data_rate_101_active){
|
|
1693
1782
|
promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));
|
|
1694
1783
|
}
|
|
@@ -1733,12 +1822,6 @@ module.exports = function(RED) {
|
|
|
1733
1822
|
}
|
|
1734
1823
|
break;
|
|
1735
1824
|
case 181:
|
|
1736
|
-
if(config.current_calibration_c1_80_active){
|
|
1737
|
-
promises.current_calibration_c1_80_active = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1738
|
-
}
|
|
1739
|
-
if(config.current_calibration_c2_80_active){
|
|
1740
|
-
promises.current_calibration_c2_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c2_80), 3);
|
|
1741
|
-
}
|
|
1742
1825
|
if(config.output_data_rate_p1_81_active){
|
|
1743
1826
|
promises.output_data_rate_p1_81 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_p1_81));
|
|
1744
1827
|
}
|
|
@@ -1805,6 +1888,14 @@ module.exports = function(RED) {
|
|
|
1805
1888
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1806
1889
|
}
|
|
1807
1890
|
break;
|
|
1891
|
+
case 202:
|
|
1892
|
+
if(config.sampling_interval_202_active){
|
|
1893
|
+
promises.sampling_interval_202 = node.config_gateway.config_set_sampling_interval_202(mac, parseInt(config.sampling_interval_202));
|
|
1894
|
+
}
|
|
1895
|
+
if(config.set_rtc_202){
|
|
1896
|
+
promises.set_rtc_202 = node.config_gateway.config_set_rtc_202(mac);
|
|
1897
|
+
}
|
|
1898
|
+
break;
|
|
1808
1899
|
case 505:
|
|
1809
1900
|
if(config.current_calibration_c1_80_active){
|
|
1810
1901
|
promises.current_calibration_c1_80_active = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
@@ -1947,9 +2038,6 @@ module.exports = function(RED) {
|
|
|
1947
2038
|
}
|
|
1948
2039
|
break;
|
|
1949
2040
|
case 538:
|
|
1950
|
-
if(config.current_calibration_c1_80_active){
|
|
1951
|
-
promises.current_calibration_c1_80 = node.config_gateway.config_set_current_calibration_individual_80(mac, parseInt(config.current_calibration_c1_80), 1);
|
|
1952
|
-
}
|
|
1953
2041
|
if(config.output_data_rate_101_active){
|
|
1954
2042
|
promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));
|
|
1955
2043
|
}
|
|
@@ -2064,6 +2152,15 @@ module.exports = function(RED) {
|
|
|
2064
2152
|
if(config.rx_timeout_539_active){
|
|
2065
2153
|
promises.rx_timeout_539 = node.config_gateway.config_set_rx_timeout_539(mac, parseInt(config.rx_timeout_539));
|
|
2066
2154
|
}
|
|
2155
|
+
if(config.stop_bit_1011_active){
|
|
2156
|
+
promises.stop_bit_1011 = node.config_gateway.config_set_stop_bit_1011(mac, parseInt(config.stop_bit_1011));
|
|
2157
|
+
}
|
|
2158
|
+
if(config.set_parity_1011_active){
|
|
2159
|
+
promises.set_parity_1011 = node.config_gateway.config_set_set_parity_1011(mac, parseInt(config.set_parity_1011));
|
|
2160
|
+
}
|
|
2161
|
+
if(config.reboot_1011){
|
|
2162
|
+
promises.reboot_1011 = node.config_gateway.config_set_reboot_1011(mac);
|
|
2163
|
+
}
|
|
2067
2164
|
break;
|
|
2068
2165
|
case 1011:
|
|
2069
2166
|
if(config.stay_on_mode_539_active){
|
|
@@ -2081,11 +2178,20 @@ module.exports = function(RED) {
|
|
|
2081
2178
|
if(config.auto_address_timeout_1011_active){
|
|
2082
2179
|
promises.auto_address_timeout_1011 = node.config_gateway.config_set_auto_address_timeout_1011(mac, parseInt(config.auto_address_timeout_1011));
|
|
2083
2180
|
}
|
|
2181
|
+
if(config.stop_bit_1011_active){
|
|
2182
|
+
promises.stop_bit_1011 = node.config_gateway.config_set_stop_bit_1011(mac, parseInt(config.stop_bit_1011));
|
|
2183
|
+
}
|
|
2184
|
+
if(config.set_parity_1011_active){
|
|
2185
|
+
promises.set_parity_1011 = node.config_gateway.config_set_parity_1011(mac, parseInt(config.set_parity_1011));
|
|
2186
|
+
}
|
|
2187
|
+
if(config.reboot_1011){
|
|
2188
|
+
promises.reboot_1011 = node.config_gateway.config_set_reboot_1011(mac);
|
|
2189
|
+
}
|
|
2084
2190
|
break;
|
|
2085
2191
|
}
|
|
2086
2192
|
}
|
|
2087
2193
|
// These sensors listed in original_otf_devices use a different OTF code.
|
|
2088
|
-
let original_otf_devices = [53, 80, 81, 82, 83, 84, 101, 102, 180, 181, 518, 519, 520, 538];
|
|
2194
|
+
let original_otf_devices = [53, 80, 81, 82, 83, 84, 101, 102, 110, 111, 112, 114, 180, 181, 518, 519, 520, 538];
|
|
2089
2195
|
// If we changed the network ID reboot the sensor to take effect.
|
|
2090
2196
|
// TODO if we add the encryption key command to node-red we need to reboot for it as well.
|
|
2091
2197
|
if(reboot){
|
|
@@ -2197,7 +2303,7 @@ module.exports = function(RED) {
|
|
|
2197
2303
|
_send_otn_request(sensor);
|
|
2198
2304
|
}, 100);
|
|
2199
2305
|
}else if(config.auto_config && config.on_the_fly_enable && sensor.mode == "OTN"){
|
|
2200
|
-
if(config.sensor_type == 101 || config.sensor_type == 102){
|
|
2306
|
+
if(config.sensor_type == 101 || config.sensor_type == 102 || config.sensor_type == 202){
|
|
2201
2307
|
if(this.gateway.hasOwnProperty('fly_101_in_progress') && this.gateway.fly_101_in_progress == false || !this.gateway.hasOwnProperty('fly_101_in_progress')){
|
|
2202
2308
|
this.gateway.fly_101_in_progress = true;
|
|
2203
2309
|
node.warn('Starting RTC Timer' + Date.now());
|
|
@@ -2219,7 +2325,7 @@ module.exports = function(RED) {
|
|
|
2219
2325
|
}else{
|
|
2220
2326
|
_config(sensor, true);
|
|
2221
2327
|
}
|
|
2222
|
-
} else if(config.sensor_type == 101 && sensor.mode == "FLY" || config.sensor_type == 102 && sensor.mode == "FLY"){
|
|
2328
|
+
} else if(config.sensor_type == 101 && sensor.mode == "FLY" || config.sensor_type == 102 && sensor.mode == "FLY" || config.sensor_type == 202 && sensor.mode == "FLY"){
|
|
2223
2329
|
if(this.gateway.hasOwnProperty('fly_101_in_progress') && this.gateway.fly_101_in_progress == false || !this.gateway.hasOwnProperty('fly_101_in_progress')){
|
|
2224
2330
|
this.gateway.fly_101_in_progress = true;
|
|
2225
2331
|
node.warn('Starting RTC Timer' + Date.now());
|
|
@@ -2308,7 +2414,7 @@ module.exports = function(RED) {
|
|
|
2308
2414
|
}
|
|
2309
2415
|
|
|
2310
2416
|
}else if(config.auto_config && config.on_the_fly_enable && sensor.mode == "OTN"){
|
|
2311
|
-
if(config.sensor_type == 101 || config.sensor_type == 102){
|
|
2417
|
+
if(config.sensor_type == 101 || config.sensor_type == 102 || config.sensor_type == 202){
|
|
2312
2418
|
if(this.gateway.hasOwnProperty('fly_101_in_progress') && this.gateway.fly_101_in_progress == false || !this.gateway.hasOwnProperty('fly_101_in_progress')){
|
|
2313
2419
|
this.gateway.fly_101_in_progress = true;
|
|
2314
2420
|
node.warn('Starting RTC Timer' + Date.now());
|
|
@@ -2330,7 +2436,7 @@ module.exports = function(RED) {
|
|
|
2330
2436
|
_config(sensor, true);
|
|
2331
2437
|
}
|
|
2332
2438
|
|
|
2333
|
-
}else if(sensor.mode == "FLY" && config.sensor_type == 101 || sensor.mode == "FLY" && config.sensor_type == 102){
|
|
2439
|
+
}else if(sensor.mode == "FLY" && config.sensor_type == 101 || sensor.mode == "FLY" && config.sensor_type == 102 || sensor.mode == "FLY" && config.sensor_type == 202){
|
|
2334
2440
|
if(this.gateway.hasOwnProperty('fly_101_in_progress') && this.gateway.fly_101_in_progress == false || !this.gateway.hasOwnProperty('fly_101_in_progress')){
|
|
2335
2441
|
this.gateway.fly_101_in_progress = true;
|
|
2336
2442
|
node.warn('Starting RTC Timer' + Date.now());
|