@Gleno0h sorry, I wasn’t at home yesterday, so I could not answer.
Today I cleaned my changed code of weather20.js. Now there are only parts in the Code my Station uses.
weather20.js:
module.exports = function(helper) {
var protocolInfo, pulsesToBinaryMapping;
pulsesToBinaryMapping = {
'01': '0',
'02': '1',
'03': ''
};
return protocolInfo = {
name: 'weather20',
type: 'weather',
values: {
temperature: {
type: "number"
},
channel: {
type: "number"
},
sync: {
type: "number"
},
id: {
type: "number"
}
},
brands: ["Weinberger"],
pulseLengths: [476, 1960, 4525, 9530],
pulseCount: 58,
decodePulses: function(pulses) {
var binary, result, sync, t0, t1, temperature;
binary = helper.map(pulses, pulsesToBinaryMapping);
sync = helper.binaryToBoolean(binary, 26);
t0 = helper.binaryToNumber(binary, 15, 23);
t1 = helper.binaryToNumber(binary, 12, 14);
if (t1 == 7) {
temperature=512-t0;
temperature=temperature/10; }
else {
temperature = t0/10;}
return result = {
id: helper.binaryToNumber(binary, 4, 11),
channel: helper.binaryToNumber(binary, 24, 27),
temperature: temperature,
sync: sync
};
}
};
};
Frontend still the same:
And here is a picture of how to read the sensor data. But I think, these things are ok because Debug of homeduino shows the right temperatur, channel etc.
21:10:12debug [pimatic-homeduino]: weather20: { id: 52, channel: 6, temperature: 21.1, sync: true }
21:10:12debug [pimatic-homeduino]: received: [ 460, 1976, 4544, 9560 ] 0202010101010202010201010101010102020102010102020102020103
21:10:12debug [pimatic-homeduino]: data: "RF receive 460 4544 1976 9560 0 0 0 0 0101020202020101020102020202020201010201020201010201010203"
I don’t know where and how the temperature is stored in any kind of database or file an how the frontend gets the values. So I stuck at this point.
There is one more thing: Why do I need sync? Or what’s the use of sync? Do I really need it?