Zenner water meter payload
Hello everyone
Maybe one of you can help me.
I would like to read Zenner Lora water meters into a private Lora network with a UG65.
Item no.: ETK-MM-DN1580-LORASo far so good. But now I get very strange values.
Decoder:
/**
* Payload Decoder for The Things Industries and similar network servers
*
* @product EDC Communication Module
* @params
* – fPort: 1
* – bytes: Array of bytes
*/
function Decode(fPort, bytes) {
var decoded = {
removal_detection: 0,
battery_low: 0,
battery_end_of_life: 0,
hw_error: 0,
coil_manipulation: 0,
meter_values: []
};if (fPort === 1) {
// Status bytes decoding
var statusByte = bytes[0];
decoded.removal_detection = (statusByte & 0x01) ? 1 : 0;
decoded.battery_low = (statusByte & 0x02) ? 1 : 0;
decoded.battery_end_of_life = (statusByte & 0x04) ? 1 : 0;
decoded.hw_error = (statusByte & 0x08) ? 1 : 0;
decoded.coil_manipulation = (statusByte & 0x10) ? 1 : 0;// Meter values decoding
for (var i = 1; i< bytes.length; i += 4) {
// Assuming meter values are 32-bit unsigned integers
var meterValue = (bytes[i] << 24) | (bytes[i+1] << 16) | (bytes[i+2] << 8) | bytes[i+3] ;
decoded.meter_values.push(meterValue);
}
}return decoded;
}————–
Now I get the following in response:Power
Payload(b64)
kiUgAgICAAEQAAWq5i4CAAA=Payload(hex)
9225200202020001100005aae62e020000<div>and:
</div>{ "battery_end_of_life": 0, "battery_low": 1, "coil_manipulation": 1, "hw_error": 0, "meter_values": [ 622854658, 33554704, 371430, 771883008 ], "removal_detection": 0 }
Can someone tell me where the measured value is hidden? Or how do I have to convert what?
<div> 😅< /div>
Many thanks and greetings to you
Log in to reply.