Community Forum B.One Community Forum Zenner water meter payload

  • Zenner water meter payload

    Posted by Laxr7 on 23. February 2024 at 17:09

    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-LORA

    So 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

    Laxr7 replied 5 days, 6 hours ago 4 Members · 8 Replies
  • 8 Replies
  • Laxr7

    Member
    23. February 2024 at 17:30

    Here is a clearer overview of the payload

  • Community Admin

    Administrator
    1. March 2024 at 13:34

    Hello @Laxr7,

    As you have unfortunately not yet received any feedback on this enquiry here in the forum, we would like to do so. As it turns out, you have already received the documents you need from your colleagues at ZENNER Support 🙂 We hope this helped you and that you were able to integrate the meters into the other network?

    Best regards!

    • Laxr7

      Member
      1. March 2024 at 13:54

      @Community

      Thank you very much, 🙏 yes, I received the documents and am already working on it.

      Wish you a nice weekend already

       

      Kind regards 🙏😄

    • Community Admin

      Administrator
      8. March 2024 at 17:15

      Very good, then we wish you continued success with the information you received and a nice weekend too! 🙂

      Best regards

  • DEMCAK

    Member
    13. May 2024 at 15:16

    Hi do you had any luck with creation of payload decoder?

    Im looking for it also.

    Can you help me?

    Thank you

    • Laxr7

      Member
      5. June 2024 at 11:08

      Hi,

      yes it worked. why don’t you write me a PM

      peace🙏

    • DEMCAK

      Member
      17. October 2024 at 14:09

      function decodeUplink(input) {

      var bytes = input.bytes;

      var status = bytes[0]; // Assuming the first byte contains the status summary bits

      var data = {

      removal_detection: (status & 0x01) >> 0,

      battery_low: (status & 0x02) >> 1,

      battery_end_of_life: (status & 0x04) >> 2,

      hw_error: (status & 0x08) >> 3,

      currently_unused: (status & 0x10) >> 4,

      coil_manipulation: (status & 0x20) >> 5,

      transceiver_monitoring_flag1: (status & 0x40) >> 6,

      transceiver_monitoring_flag2: (status & 0x80) >> 7,

      // … other status bits

      };

      // Assuming the next bytes contain meter values in SP12 format

      var meterValues = [];

      for (var i = 1; i < bytes.length; i += 4) {

      // Day value (4 bytes) assuming little-endian

      var meterValue = bytes[1] + (bytes[2] << 8) + (bytes[3] << 16) + (bytes[4] << 24);

      meterValues.push(meterValue);

      }

      data.meter_values = meterValues;

      return {

      data: data,

      };

      }

Log in to reply.