Thanks all for pointing me in the right direction, since im pretty new to all of this!
So after knowing the cause of the problem was because of weather5 not being the correct protocol.
I tried making my own protocol thanks to this advanced Bl999 protocol explanation and this post on how to add it.
So i finally got it to work correctly. by creating a “weather16.js” file and add is to frcontroljs protocol library.
Can anyone tell me if i did it the correct way? Like should i have created weather16 or added is to a existing weather file etc… Just to make sure im not learning it the wrong way.
Thanks!
Weather16.js
module.exports = function(helper) {
var protocolInfo, pulsesToBinaryMapping;
pulsesToBinaryMapping = {
'01': '0',
'02': '1',
'03': ''
};
return protocolInfo = {
name: 'weather16',
type: 'weather',
values: {
id: {
type: "number"
},
temperature: {
type: "number"
},
humidity: {
type: "number"
},
lowBattery: {
type: "boolean"
}
},
brands: ["Ea2labs"],
pulseLengths: [500, 1850, 3900, 9000],
pulseCount: 74,
decodePulses: function(pulses) {
var binary, humidity, id, lowBattery, result, temperature;
binary = helper.map(pulses, pulsesToBinaryMapping);
id = helper.binaryToNumberLSBMSB(binary, 0, 7);
lowBattery = helper.binaryToNumberLSBMSB(binary, 8, 8) !== 0;
temperature = helper.binaryToSignedNumberLSBMSB(binary, 12, 23) / 10.0;
h0 = helper.binaryToSignedNumberLSBMSB(binary, 24, 31);
humidity = h0+100;
return result = {
id: id,
lowBattery: lowBattery,
temperature: temperature,
humidity: humidity
};
}
};
};