@ncd-io/node-red-enterprise-sensors 0.1.16 → 0.1.18
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 +16 -6
- package/package.json +1 -1
- package/wireless.html +16 -1
- package/wireless.js +3 -0
package/lib/WirelessGateway.js
CHANGED
|
@@ -883,6 +883,16 @@ module.exports = class WirelessSensor{
|
|
|
883
883
|
packet.push(...cal_val);
|
|
884
884
|
return this.config_send(sensor_mac, packet);
|
|
885
885
|
}
|
|
886
|
+
config_set_sensor_temperature_offset_44(sensor_mac, value){
|
|
887
|
+
console.log('config_set_sensor_temperature_offset_44');
|
|
888
|
+
// convert before processing
|
|
889
|
+
value = value * 100;
|
|
890
|
+
var packet = [244, 30, 0, 0, 0];
|
|
891
|
+
var cal_val = int2Bytes(value, 2);
|
|
892
|
+
packet.push(...cal_val);
|
|
893
|
+
console.log(packet);
|
|
894
|
+
return this.config_send(sensor_mac, packet);
|
|
895
|
+
}
|
|
886
896
|
config_set_output_data_rate_p2_81(sensor_mac, output_rate){
|
|
887
897
|
console.log('config_set_output_data_rate_p2_81');
|
|
888
898
|
var packet = [244, 79, 0, 0, 101, 36, output_rate];
|
|
@@ -6208,17 +6218,17 @@ function sensor_types(parent){
|
|
|
6208
6218
|
parse: (payload, parsed) => {
|
|
6209
6219
|
return {
|
|
6210
6220
|
moisture_1: payload.slice(0, 2).reduce(msbLsb)/100,
|
|
6211
|
-
temp_1: signInt(payload.slice(2, 4).reduce(msbLsb))/100,
|
|
6221
|
+
temp_1: signInt(payload.slice(2, 4).reduce(msbLsb), 16)/100,
|
|
6212
6222
|
moisture_2: payload.slice(4, 6).reduce(msbLsb)/100,
|
|
6213
|
-
temp_2: signInt(payload.slice(6, 8).reduce(msbLsb))/100,
|
|
6223
|
+
temp_2: signInt(payload.slice(6, 8).reduce(msbLsb), 16)/100,
|
|
6214
6224
|
moisture_3: payload.slice(8, 10).reduce(msbLsb)/100,
|
|
6215
|
-
temp_3: signInt(payload.slice(10, 12).reduce(msbLsb))/100,
|
|
6225
|
+
temp_3: signInt(payload.slice(10, 12).reduce(msbLsb), 16)/100,
|
|
6216
6226
|
moisture_4: payload.slice(12, 14).reduce(msbLsb)/100,
|
|
6217
|
-
temp_4: signInt(payload.slice(14, 16).reduce(msbLsb))/100,
|
|
6227
|
+
temp_4: signInt(payload.slice(14, 16).reduce(msbLsb), 16)/100,
|
|
6218
6228
|
moisture_5: payload.slice(16, 18).reduce(msbLsb)/100,
|
|
6219
|
-
temp_5: signInt(payload.slice(18, 20).reduce(msbLsb))/100,
|
|
6229
|
+
temp_5: signInt(payload.slice(18, 20).reduce(msbLsb), 16)/100,
|
|
6220
6230
|
moisture_6: payload.slice(20, 22).reduce(msbLsb)/100,
|
|
6221
|
-
temp_6: signInt(payload.slice(22, 24).reduce(msbLsb))/100
|
|
6231
|
+
temp_6: signInt(payload.slice(22, 24).reduce(msbLsb), 16)/100
|
|
6222
6232
|
}
|
|
6223
6233
|
}
|
|
6224
6234
|
},
|
package/package.json
CHANGED
package/wireless.html
CHANGED
|
@@ -226,6 +226,9 @@
|
|
|
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
|
+
temperature_offset_44_active: {value: ""},
|
|
230
|
+
temperature_offset_44: {value: 4, validate: NCD_validators.number_range(0, 25)},
|
|
231
|
+
|
|
229
232
|
filtering: {value: 0, validate: RED.validators.number()},
|
|
230
233
|
data_rate: {value: 5, validate: RED.validators.number()},
|
|
231
234
|
time_series: {value: 0, validate: RED.validators.number()},
|
|
@@ -1038,7 +1041,19 @@
|
|
|
1038
1041
|
<input type="text" id="node-input-force_calibration_co2" placeholder="455" value="455">
|
|
1039
1042
|
</div>
|
|
1040
1043
|
</div>
|
|
1041
|
-
|
|
1044
|
+
<div class="form-row ncd-active-check">
|
|
1045
|
+
<div>
|
|
1046
|
+
<strong>Temperature Offset</strong>
|
|
1047
|
+
</div>
|
|
1048
|
+
<div>
|
|
1049
|
+
<label for="node-input-temperature_offset_44_active"><i class="icon-tag"></i> Auto Config</label>
|
|
1050
|
+
<input type="checkbox" id="node-input-temperature_offset_44_active" class="ncd-config-toggle" data-target-id="node-input-temperature_offset_44" value="1">
|
|
1051
|
+
</div>
|
|
1052
|
+
<div>
|
|
1053
|
+
<label for="node-input-temperature_offset_44"><i class="icon-tag"></i> Value</label>
|
|
1054
|
+
<input type="text" id="node-input-temperature_offset_44" placeholder="4" value="4">
|
|
1055
|
+
</div>
|
|
1056
|
+
</div>
|
|
1042
1057
|
<div class="ncd-dependent" data-sensor-84 data-sensor-519 data-sensor-537>
|
|
1043
1058
|
<hr>
|
|
1044
1059
|
<div class="form-row ncd-active-check">
|
package/wireless.js
CHANGED
|
@@ -513,6 +513,9 @@ module.exports = function(RED) {
|
|
|
513
513
|
if(config.force_calibration_co2_auto_config){
|
|
514
514
|
promises.sensor_forced_calibration = node.config_gateway.config_set_sensor_forced_calibration(mac, parseInt(config.force_calibration_co2));
|
|
515
515
|
}
|
|
516
|
+
if(config.temperature_offset_44_active){
|
|
517
|
+
promises.temperature_offset_44 = node.config_gateway.config_set_sensor_temperature_offset_44(mac, parseInt(config.temperature_offset_44));
|
|
518
|
+
}
|
|
516
519
|
break;
|
|
517
520
|
case 45:
|
|
518
521
|
if(config.sensor_boot_time_420ma_active){
|