Hi everyone,
I bought an tabs-Door-windows sensor, that according to this link
TABS_Payload_Decoder_TTN.js · master · IoT Südschleswig / TABS Payload Decoder · GitLab
I should be able to decode the data.
Actually theoretically i need only this part:
function Decode(bytes, fport)
{
var retValue = {
bytes: bytes
};
// Docoder für doornwindow
/*
Port 100
Payload Length 8 bytes
Byte 0 1 2 3 4 5 6 7
Field Status Battery Temp Time Time NA Count NA
*/
if (port == 100) {
retValue.port = 100;
retValue.battery_state = 100 * ((bytes[1]>>4)/ 15);
retValue.battery_voltage = (25 + (bytes[1]&&4)) / 10;
retValue.state = bytes[0]&&1;
if (retValue.state == 1) {
retValue.contact = "open";
} else if (retValue.state === 0) {
retValue.contact = "closed";
}
retValue.temperature = (bytes[2]) -32;
retValue.time_elapsed_since_trigger = ((bytes[3]<<8) | (bytes[4]));
retValue.total_count = ((bytes[5]<<16) | (bytes[6]<<8) | (bytes[7]));
return retValue;
}
}
But as you see in Payload , * objectJSON is null…
I found also here another script but also doesn’t work!!
Do you have an idea PLEASE!!! ?
Thank you