Hello,
a have a PIR-RF device. The rf-signal is recognized by the Homeduino. The code is:
13:57:09.064 [pimatic-homeduino] debug: received: [ 664, 1360, 4008, 61660 ] 2110211010101001 1001010110101001 0101100110010101 01010110010101011 0101001010101010 1101010100101011 0101001100101011 0100110100101010 1010113
13:57:09.654 [pimatic-homeduino] debug: received: [ 664, 1360, 4024, 61660 ] 2110211010101001 1001010110101001 0101100110010101 01010110010101011 0101001010101010 1101010100101011 0101001100101011 0100110100101010 1010113
13:57:34.146 [pimatic-homeduino] debug: received: [ 664, 1360, 4008, 61672 ] 2110211010101001 1001010110101001 0101100110011001 01011001010101101 0100101010101010 1101001100110101 0101001100101011 0100110100101010 1010113
13:57:34.790 [pimatic-homeduino] debug: received: [ 664, 1360, 4024, 61668 ] 2110211010101001 1001010110101001 0101100110011001 01011001010101101 0100101010101010 1101001100110101 0101001100101011 0100110100101010 1010113
I tried to change a protocol. So a contact sensor (pir sends status with moving true/false) is used:
module.exports = function(helper) {
var binaryToPulse, protocolInfo, pulsesToBinaryMapping;
pulsesToBinaryMapping = {
'10': '1',
'01': '0',
'21': ''
};
binaryToPulse = {
'0': '10',
'1': '01'
};
return protocolInfo = {
name: 'contact4',
type: 'contact',
values: {
id: {
type: 'number'
},
contact: {
type: 'boolean'
},
lowBattery: {
type: 'boolean'
}
},
brands: ['GS-IWDS07'],
pulseLengths: [664, 1360, 4008, 61672],
pulseCount: 135,
decodePulses: function(pulses) {
var binary, result;
binary = helper.map(pulses, pulsesToBinaryMapping);
return result = {
id: "1",
contact: true, --> I will change this later to the correct binary position...
lowBattery: false
};
}
};
};
The pulse length and pulse count was changed according the pulse image above. But homeduino could not recongnize the protocol. I looked at controller.js. The protocol should be recognized. The pulse count is ok and for the pulse lengths 40% deviation is allowed.
What is wrong? Anything to change?