From 64fb6df076bbf8f1869606405310fb4f05c66c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Schr=C3=B6er?= Date: Wed, 8 Nov 2023 14:29:42 +0000 Subject: [PATCH 1/4] add minol-zenner vendor and edc module definitions --- .../edc-communication-module-codec.yaml | 19 +++++++++++++ .../edc-communication-module-profile.yaml | 21 ++++++++++++++ .../minol-zenner/edc-communication-module.js | 26 +++++++++++++++++ .../edc-communication-module.yaml | 28 +++++++++++++++++++ vendor/minol-zenner/index.yaml | 3 ++ 5 files changed, 97 insertions(+) create mode 100644 vendor/minol-zenner/edc-communication-module-codec.yaml create mode 100644 vendor/minol-zenner/edc-communication-module-profile.yaml create mode 100644 vendor/minol-zenner/edc-communication-module.js create mode 100644 vendor/minol-zenner/edc-communication-module.yaml create mode 100644 vendor/minol-zenner/index.yaml diff --git a/vendor/minol-zenner/edc-communication-module-codec.yaml b/vendor/minol-zenner/edc-communication-module-codec.yaml new file mode 100644 index 0000000000..bec750affc --- /dev/null +++ b/vendor/minol-zenner/edc-communication-module-codec.yaml @@ -0,0 +1,19 @@ +# Uplink decoder decodes binary data uplink into a JSON object (optional) +# For documentation on writing encoders and decoders, see: https://www.thethingsindustries.com/docs/integrations/payload-formatters/javascript/ +uplinkDecoder: + fileName: edc-communication-module.js + + # Examples + examples: + - description: example meter values with status bytes + input: + fPort: 1 + bytes: [27,00,00,00,0c,00,00,00,0d,00,00,00,0f] + output: + data: + removal_detection: 1, + battery_low: 1, + battery_end_of_life: 1, + hw_error: 0, + coil_manipulation: 1, + meter_values: [ 12, 13, 15 ] \ No newline at end of file diff --git a/vendor/minol-zenner/edc-communication-module-profile.yaml b/vendor/minol-zenner/edc-communication-module-profile.yaml new file mode 100644 index 0000000000..f758761d6e --- /dev/null +++ b/vendor/minol-zenner/edc-communication-module-profile.yaml @@ -0,0 +1,21 @@ +# Vendor profile ID, can be freely issued by the vendor +# This vendor profile ID is also used on the QR code for LoRaWAN devices, see +# https://lora-alliance.org/sites/default/files/2020-10/LoRa_Alliance_Vendor_ID_for_QR_Code.pdf +vendorProfileID: 474 + +# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1 +macVersion: '1.0.3' +regionalParametersVersion: 'RP001-1.0.3-RevA' + +# Whether the end device supports join (OTAA) or not (ABP) +supportsJoin: true + +# Maximum EIRP +maxEIRP: 16 + +# Whether the end device supports 32-bit frame counters +supports32bitFCnt: true + +# Whether the end device supports class B +supportsClassB: false +supportsClassC: false diff --git a/vendor/minol-zenner/edc-communication-module.js b/vendor/minol-zenner/edc-communication-module.js new file mode 100644 index 0000000000..f5c63eee6e --- /dev/null +++ b/vendor/minol-zenner/edc-communication-module.js @@ -0,0 +1,26 @@ +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, + coil_manipulation: (status & 0x20) >> 5, + // ... other status bits + }; + + // Assuming the next bytes contain meter values in SP12 format + var meterValues = []; + for (var i = 1; i < bytes.length; i += 4) { + // Combining four bytes to form a meter value + var meterValue = (bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]; + meterValues.push(meterValue); + } + + data.meter_values = meterValues; + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/minol-zenner/edc-communication-module.yaml b/vendor/minol-zenner/edc-communication-module.yaml new file mode 100644 index 0000000000..abdc5ade91 --- /dev/null +++ b/vendor/minol-zenner/edc-communication-module.yaml @@ -0,0 +1,28 @@ +name: EDC COMMUNICATION MODULE FOR WATER METERS +description: The EDC communication module is an add-on module for water meters for secure remote reading and for integrating water meters into smart metering systems + +# Hardware versions (optional, use when you have revisions) +hardwareVersions: + - version: '1.0' + numeric: 1 + +# Firmware versions (at least one is mandatory) +firmwareVersions: + - # Firmware version + version: '2.02.0' + numeric: 1 + # Corresponding hardware versions (optional) + hardwareVersions: + - '1.0' + + # Firmware features (optional) + # Valid values are: remote rejoin (trigger a join from the application layer), transmission interval (configure how + # often he device sends a message). + #features: + + profiles: + EU863-870: + # Identifier of the profile (lowercase, alphanumeric with dashes, max 36 characters) + id: edc-communication-module-profile + lorawanCertified: true + codec: edc-communication-module-codec \ No newline at end of file diff --git a/vendor/minol-zenner/index.yaml b/vendor/minol-zenner/index.yaml new file mode 100644 index 0000000000..68f274078b --- /dev/null +++ b/vendor/minol-zenner/index.yaml @@ -0,0 +1,3 @@ +endDevices: + # Unique identifier of the end device (lowercase, alphanumeric with dashes, max 36 characters) + - edc-communication-module # look in edc-communication-module.yaml for the end device definition From bcf963ea8177bda3dfb544d53152f1fe4ed80ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Schr=C3=B6er?= Date: Fri, 10 Nov 2023 09:58:59 +0000 Subject: [PATCH 2/4] change vendorProfileId --- vendor/minol-zenner/edc-communication-module-profile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/minol-zenner/edc-communication-module-profile.yaml b/vendor/minol-zenner/edc-communication-module-profile.yaml index f758761d6e..695376613d 100644 --- a/vendor/minol-zenner/edc-communication-module-profile.yaml +++ b/vendor/minol-zenner/edc-communication-module-profile.yaml @@ -1,7 +1,7 @@ # Vendor profile ID, can be freely issued by the vendor # This vendor profile ID is also used on the QR code for LoRaWAN devices, see # https://lora-alliance.org/sites/default/files/2020-10/LoRa_Alliance_Vendor_ID_for_QR_Code.pdf -vendorProfileID: 474 +vendorProfileID: 1 # LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1 macVersion: '1.0.3' From 35b992bb6fb57ac719b1b04836801b7bdaefadd3 Mon Sep 17 00:00:00 2001 From: Jaime Trinidad Date: Mon, 13 Nov 2023 14:12:30 +0100 Subject: [PATCH 3/4] codec fixes fix bytes and output data --- vendor/minol-zenner/edc-communication-module-codec.yaml | 4 ++-- vendor/minol-zenner/edc-communication-module.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/minol-zenner/edc-communication-module-codec.yaml b/vendor/minol-zenner/edc-communication-module-codec.yaml index bec750affc..95ac41a72d 100644 --- a/vendor/minol-zenner/edc-communication-module-codec.yaml +++ b/vendor/minol-zenner/edc-communication-module-codec.yaml @@ -8,7 +8,7 @@ uplinkDecoder: - description: example meter values with status bytes input: fPort: 1 - bytes: [27,00,00,00,0c,00,00,00,0d,00,00,00,0f] + bytes: [27, 00, 00, 00, 0c, 00, 00, 00, 0d, 00, 00, 00, 0f] output: data: removal_detection: 1, @@ -16,4 +16,4 @@ uplinkDecoder: battery_end_of_life: 1, hw_error: 0, coil_manipulation: 1, - meter_values: [ 12, 13, 15 ] \ No newline at end of file + meter_values: [12, 13, 15] diff --git a/vendor/minol-zenner/edc-communication-module.yaml b/vendor/minol-zenner/edc-communication-module.yaml index abdc5ade91..f0ac71e96b 100644 --- a/vendor/minol-zenner/edc-communication-module.yaml +++ b/vendor/minol-zenner/edc-communication-module.yaml @@ -19,10 +19,10 @@ firmwareVersions: # Valid values are: remote rejoin (trigger a join from the application layer), transmission interval (configure how # often he device sends a message). #features: - + profiles: EU863-870: # Identifier of the profile (lowercase, alphanumeric with dashes, max 36 characters) id: edc-communication-module-profile lorawanCertified: true - codec: edc-communication-module-codec \ No newline at end of file + codec: edc-communication-module-codec From 4c943652b0eb06263233ce1153220753f45da123 Mon Sep 17 00:00:00 2001 From: Jaime Trinidad Date: Mon, 13 Nov 2023 14:18:33 +0100 Subject: [PATCH 4/4] update fixes --- .../minol-zenner/edc-communication-module-codec.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/minol-zenner/edc-communication-module-codec.yaml b/vendor/minol-zenner/edc-communication-module-codec.yaml index 95ac41a72d..ab42ac67bb 100644 --- a/vendor/minol-zenner/edc-communication-module-codec.yaml +++ b/vendor/minol-zenner/edc-communication-module-codec.yaml @@ -8,12 +8,12 @@ uplinkDecoder: - description: example meter values with status bytes input: fPort: 1 - bytes: [27, 00, 00, 00, 0c, 00, 00, 00, 0d, 00, 00, 00, 0f] + bytes: [0x27, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0F] output: data: - removal_detection: 1, - battery_low: 1, - battery_end_of_life: 1, - hw_error: 0, - coil_manipulation: 1, + removal_detection: 1 + battery_low: 1 + battery_end_of_life: 1 + hw_error: 0 + coil_manipulation: 1 meter_values: [12, 13, 15]