dragino / lds02
Dragino LDS02
The LDS02 reports open/close state alongside battery telemetry. Decoder is an example — confirm bits with your firmware.
Decoder
Copy into ChirpStack or paste in the playground.
// Dragino LDS02 — LoRaWAN door/window sensor (example; FW variants exist)
function decodeUplink(input) {
try {
const bytes = input.bytes;
const decoded = {};
if (bytes.length >= 2) {
const batRaw = (((bytes[0] << 8) | bytes[1]) & 0x3fff) / 1000;
decoded.battery_v = batRaw;
}
if (bytes.length >= 3) {
decoded.door_open = bytes[2] !== 0;
}
if (bytes.length >= 4) {
decoded.installation = bytes[3];
}
return { data: decoded };
} catch (err) {
return { errors: [`Decoder error: ${err.message}`] };
}
}