Trying to make some sense of this link about the BL999 sensor seems useful but hard for me to understand.
How do i efficiently post debug info? can i export it or something like that?
[Solved] Wrong Humidity displayed from Ea2 LABS BL999-TH sensor
Trying to make some sense of this link about the BL999 sensor seems useful but hard for me to understand.
How do i efficiently post debug info? can i export it or something like that?
With the info in the link it should not be a problem to create the protocol.
Yeh I thought so but I know nothing about protocols, far from how to make one.
But i like the challenge so im searching the forum and google on how to understand and make one.
@Christoffel-Janssens Thanks for updating the first post! Can you please also post the log messages as text?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Above debug shows me 22.7°c 44% humidity
K i have learned myself how to understand the protocol and how to parse it but i don’t know how to create it. Do i make a file? where/ how? anyone know a guide/topic for me how to make a protocol script and use it.
Edit: Nvm found something here that helps me
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
};
}
};
};
Congrats, great that you figured it out.
It is right to create a new protocol file for this.
What now would be ideal:
K,
Cool thanks for the info.
Definitely will do. first need to google how to do all that properly.
K did some learning and tinkering, just need to make some comments. but does this look ready for a Pull request?
@Christoffel-Janssens said in [Solved] Wrong Humidity displayed from Ea2 LABS BL999-TH sensor:
but does this look ready for a Pull request?
Excellent. Looks great! Please submit a PR
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig Added some basic commentary and requested pull.