@ncd-io/node-red-enterprise-sensors 1.6.0 → 1.6.1
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 +18 -15
- package/package.json +1 -1
- package/wireless.html +1 -1
package/lib/WirelessGateway.js
CHANGED
|
@@ -1342,8 +1342,8 @@ module.exports = class WirelessSensor{
|
|
|
1342
1342
|
}
|
|
1343
1343
|
config_set_counter_threshold_108(sensor_mac, value){
|
|
1344
1344
|
console.log('config_set_counter_threshold_108');
|
|
1345
|
-
var packet = [244, 43, 0, 0, 0
|
|
1346
|
-
let threshold = int2Bytes((value),
|
|
1345
|
+
var packet = [244, 43, 0, 0, 0];
|
|
1346
|
+
let threshold = int2Bytes((value), 4);
|
|
1347
1347
|
packet.push(...threshold);
|
|
1348
1348
|
console.log(packet);
|
|
1349
1349
|
return this.config_send(sensor_mac, packet);
|
|
@@ -4161,13 +4161,14 @@ function sensor_types(parent){
|
|
|
4161
4161
|
name: 'RTD Temperature Sensor',
|
|
4162
4162
|
parse: (payload, parsed, mac) => {
|
|
4163
4163
|
if(parsed.firmware > 5){
|
|
4164
|
+
let reserved = payload[7] >> 1; // Fault status (1-bit left shifted)
|
|
4164
4165
|
let fault_status = '';
|
|
4165
|
-
if (
|
|
4166
|
+
if (reserved === 0) {
|
|
4166
4167
|
fault_status = 'data_valid';
|
|
4167
|
-
} else if (
|
|
4168
|
+
} else if (reserved === 15) {
|
|
4168
4169
|
fault_status = 'data_invalid';
|
|
4169
4170
|
} else {
|
|
4170
|
-
const faultTypeBits =
|
|
4171
|
+
const faultTypeBits = reserved & 0b00111100;
|
|
4171
4172
|
switch (faultTypeBits) {
|
|
4172
4173
|
case 32:
|
|
4173
4174
|
fault_status = 'ref_in_vbias';
|
|
@@ -4668,13 +4669,14 @@ function sensor_types(parent){
|
|
|
4668
4669
|
name: '2-Channel RTD Temperature Sensor',
|
|
4669
4670
|
parse: (payload, parsed, mac) => {
|
|
4670
4671
|
if(parsed.firmware > 5){
|
|
4672
|
+
let reserved = payload[7] >> 1; // Fault status (1-bit left shifted)
|
|
4671
4673
|
let fault_status = '';
|
|
4672
|
-
if (
|
|
4674
|
+
if (reserved === 0) {
|
|
4673
4675
|
fault_status = 'data_valid';
|
|
4674
|
-
} else if (
|
|
4676
|
+
} else if (reserved === 15) {
|
|
4675
4677
|
fault_status = 'data_invalid';
|
|
4676
4678
|
} else {
|
|
4677
|
-
const fault_bits = (
|
|
4679
|
+
const fault_bits = (reserved >> 2) & 0b00001111;
|
|
4678
4680
|
switch (fault_bits) {
|
|
4679
4681
|
case 8:
|
|
4680
4682
|
fault_status = 'ref_in_vbias';
|
|
@@ -4689,7 +4691,7 @@ function sensor_types(parent){
|
|
|
4689
4691
|
fault_status = 'over_under_voltage';
|
|
4690
4692
|
break;
|
|
4691
4693
|
}
|
|
4692
|
-
const channel_bits =
|
|
4694
|
+
const channel_bits = reserved & 0b00000011;
|
|
4693
4695
|
switch (channel_bits) {
|
|
4694
4696
|
case 1:
|
|
4695
4697
|
fault_status = fault_status + '_ch1';
|
|
@@ -4742,13 +4744,14 @@ function sensor_types(parent){
|
|
|
4742
4744
|
'55': {
|
|
4743
4745
|
name: '3-Channel RTD Temperature Sensor',
|
|
4744
4746
|
parse: (payload, parsed, mac) => {
|
|
4747
|
+
let reserved = payload[7] >> 1; // Fault status (1-bit left shifted)
|
|
4745
4748
|
let fault_status = '';
|
|
4746
|
-
if (
|
|
4749
|
+
if (reserved === 0) {
|
|
4747
4750
|
fault_status = 'data_valid';
|
|
4748
|
-
} else if (
|
|
4751
|
+
} else if (reserved === 15) {
|
|
4749
4752
|
fault_status = 'data_invalid';
|
|
4750
4753
|
} else {
|
|
4751
|
-
const fault_bits = (
|
|
4754
|
+
const fault_bits = (reserved >> 2) & 0b00001111;
|
|
4752
4755
|
switch (fault_bits) {
|
|
4753
4756
|
case 8:
|
|
4754
4757
|
fault_status = 'ref_in_vbias';
|
|
@@ -4763,7 +4766,7 @@ function sensor_types(parent){
|
|
|
4763
4766
|
fault_status = 'over_under_voltage';
|
|
4764
4767
|
break;
|
|
4765
4768
|
}
|
|
4766
|
-
const channel_bits =
|
|
4769
|
+
const channel_bits = reserved & 0b00000011;
|
|
4767
4770
|
switch (channel_bits) {
|
|
4768
4771
|
case 1:
|
|
4769
4772
|
fault_status = fault_status + '_ch1';
|
|
@@ -13334,7 +13337,7 @@ function sensor_types(parent){
|
|
|
13334
13337
|
parse: (payload, parsed, mac) => {
|
|
13335
13338
|
let res = {};
|
|
13336
13339
|
if(!(payload[7] & 2)){
|
|
13337
|
-
res.pressure_s1 = signInt(payload.slice(8, 12).reduce(msbLsb),
|
|
13340
|
+
res.pressure_s1 = signInt(payload.slice(8, 12).reduce(msbLsb),32)/100;
|
|
13338
13341
|
res.temperature_s1 = signInt(payload.slice(12, 14).reduce(msbLsb),16)/100;
|
|
13339
13342
|
}else{
|
|
13340
13343
|
res.pressure_s1 = null;
|
|
@@ -13342,7 +13345,7 @@ function sensor_types(parent){
|
|
|
13342
13345
|
res.error_s1 = 'Error: Sensor Probe 1 communication error';
|
|
13343
13346
|
}
|
|
13344
13347
|
if(!(payload[7] & 4)){
|
|
13345
|
-
res.pressure_s2 = signInt(payload.slice(14, 18).reduce(msbLsb),
|
|
13348
|
+
res.pressure_s2 = signInt(payload.slice(14, 18).reduce(msbLsb),32)/100;
|
|
13346
13349
|
res.temperature_s2 = signInt(payload.slice(18, 20).reduce(msbLsb),16)/100;
|
|
13347
13350
|
}else{
|
|
13348
13351
|
res.pressure_s2 = null;
|
package/package.json
CHANGED
package/wireless.html
CHANGED
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
input_two_108_active:{value:""},
|
|
444
444
|
input_three_108:{value:0},
|
|
445
445
|
input_three_108_active:{value:""},
|
|
446
|
-
counter_threshold_108:{value:1000, validate: NCD_validators.number_range(0,
|
|
446
|
+
counter_threshold_108:{value:1000, validate: NCD_validators.number_range(0, 4294967295)},
|
|
447
447
|
counter_threshold_108_active:{value:""},
|
|
448
448
|
shift_one_108_active:{value:""},
|
|
449
449
|
shift_one_minutes_108:{value:0, validate: NCD_validators.number_range(0, 59)},
|