diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9d18df2..4a492fb 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -6,7 +6,6 @@ on: types: [published] workflow_dispatch: - env: image_name: kbeaugrand/az-iotedge-watteco-decoder-module module_path: src/modules/WattecoDecoderModule @@ -14,10 +13,43 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + tests: + # The type of runner that the job will run on + runs-on: ubuntu-latest + name: "Test the decoder" + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install dependencies + working-directory: ${{ env.module_path }} + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + + - name: Make Codec files replacements + working-directory: ${{ env.module_path }} + run: | + chmod +x replaceCodecImports.sh + ./replaceCodecImports.sh + + - name: Test with pytest + working-directory: ${{ env.module_path }} + run: pytest --cov=./ --cov-report=xml test_main.py + # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest + needs: tests strategy: matrix: arch: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ba116d..9bbd4d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,27 +11,60 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +env: + image_name: kbeaugrand/az-iotedge-watteco-decoder-module + module_path: src/modules/WattecoDecoderModule + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + tests: + # The type of runner that the job will run on + runs-on: ubuntu-latest + name: "Test the decoder" + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install dependencies + working-directory: ${{ env.module_path }} + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + + - name: Make Codec files replacements + working-directory: ${{ env.module_path }} + run: | + chmod +x replaceCodecImports.sh + ./replaceCodecImports.sh + + - name: Test with pytest + working-directory: ${{ env.module_path }} + run: pytest --cov=./ --cov-report=xml test_main.py + # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest + needs: tests strategy: matrix: arch: [amd64, arm32v7, arm64v8] - env: - image_name: kbeaugrand/az-iotedge-watteco-decoder-module - tag_name: 0.0.1 - module_path: src/modules/WattecoDecoderModule # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 with: - submodules: true + submodules: true # - name: Docker Login # # You may pin to the exact commit or the version. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbcd2b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.pytest_cache +__pycache__ +.coverage \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a230e1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "src" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/README.md b/README.md index ec34234..f1c4962 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Azure IoT Edge LoRaWAN Watteco Sensors Support -[![Build](https://github.com/kbeaugrand/iotedge-lorawan-watecco-decoder/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/kbeaugrand/iotedge-lorawan-watecco-decoder/actions/workflows/ci.yml) -[![Continuous Deployment](https://github.com/kbeaugrand/iotedge-lorawan-watecco-decoder/actions/workflows/cd.yml/badge.svg)](https://github.com/kbeaugrand/iotedge-lorawan-watecco-decoder/actions/workflows/cd.yml) +[![Build](https://github.com/kbeaugrand-org/iotedge-lorawan-watteco/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/kbeaugrand-org/iotedge-lorawan-watteco/actions/workflows/ci.yml) +[![Continuous Deployment](https://github.com/kbeaugrand-org/iotedge-lorawan-watteco/actions/workflows/cd.yml/badge.svg)](https://github.com/kbeaugrand-org/iotedge-lorawan-watteco/actions/workflows/cd.yml) ## Description -This repository stores the code for executing an Azure IoT Edge LoRaWAN Decoder module for Watecco Sensors. +This repository stores the code for executing an Azure IoT Edge LoRaWAN Decoder module for watteco Sensors. ### Batch Uncompress @@ -27,26 +27,26 @@ To distinguish which kind of frame is present, the decoding function will be awa __Current Version__ of NKE uncompress module used is __1.0.5__. -| Sensor Name | Decoder Endpoint | -|-----------------------------------------|---------------------------------| -| 50-70-001 S0 | /api/s0 | -| 50-70-007 THr harvesting | /api/thr | -| 50-70-011 Senso | /api/senso | -| 50-70-[014/039/051/072/079] PulseSenso | /api/pulsesenso | -| 50-70-016 Presso | /api/presso | -| 50-70-[043/142] Remote temperature | /api/remotetemperature | -| 50-70-049 Celso | /api/celso | -| 50-70-053 TH | /api/th | -| 50-70-071 Flasho | /api/flasho | -| 50-70-074 VAQAO+Plus | /api/vaqaoplus | -| 50-70-085 T | /api/t | -| 50-70-099 Atmo | /api/atmo | -| 50-70-101 Ventilo | /api/ventilo | -| 50-70-108 Closo | /api/closo | -| 50-70-123 PulseSenso Atex Zone 1 | /api/pulsesensoatexz1 | -| 50-70-139 Remote temperature 2CTN | /api/remotetemperature2ctn | -| 50-70-168 VAQAO | /api/vaqao | -| 50-70-098 Intens'O | /api/stdframe | +| Sensor Name | Decoder Endpoint | | +|-----------------------------------------|---------------------------------|-----| +| 50-70-001 S0 | /api/s0 | [X] | +| 50-70-007 THr harvesting | /api/thr | [X] | +| 50-70-011 Senso | /api/senso | [X] | +| 50-70-[014/039/051/072/079] PulseSenso | /api/pulsesenso | [ ] | +| 50-70-016 Presso | /api/presso | [X] | +| 50-70-[043/142] Remote temperature | /api/remotetemperature | [ ] | +| 50-70-049 Celso | /api/celso | [ ] | +| 50-70-053 TH | /api/th | [ ] | +| 50-70-071 Flasho | /api/flasho | [ ] | +| 50-70-074 VAQAO+Plus | /api/vaqaoplus | [X] | +| 50-70-085 T | /api/t | [ ] | +| 50-70-099 Atmo | /api/atmo | [X] | +| 50-70-101 Ventilo | /api/ventilo | [ ] | +| 50-70-108 Closo | /api/closo | [ ] | +| 50-70-123 PulseSenso Atex Zone 1 | /api/pulsesensoatexz1 | [ ] | +| 50-70-139 Remote temperature 2CTN | /api/remotetemperature2ctn | [ ] | +| 50-70-168 VAQAO | /api/vaqao | [X] | +| 50-70-098 Intens'O | /api/stdframe | [ ] | ## Deploy diff --git a/dtdl/Watecco - S0 Sensor (50-70-001).json b/dtdl/Watecco - S0 Sensor (50-70-001).json deleted file mode 100644 index 8832e8c..0000000 --- a/dtdl/Watecco - S0 Sensor (50-70-001).json +++ /dev/null @@ -1,202 +0,0 @@ -[ - { - "@id": "dtmi:kbeaugrand:watecco:S0;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:S0:Index1;1", - "@type": "Telemetry", - "displayName": { - "en": "Pulse Count" - }, - "name": "Index1", - "schema": "integer" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:BatteryLevel;1", - "@type": [ - "Telemetry", - "Voltage" - ], - "displayName": { - "en": "BatteryLevel" - }, - "name": "BatteryLevel", - "schema": "integer", - "unit": "millivolt" - } - ], - "displayName": { - "en": "Watecco - S0 (50-70-001)" - }, - "extends": [ - "dtmi:kbeaugrand:watecco:S0:LoRaDevice;1" - ], - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:AppEUI;1", - "@type": "Property", - "description": { - "en": "This is the unique ID of the Application server." - }, - "displayName": { - "en": "AppEUI" - }, - "name": "AppEUI", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:AppKey;1", - "@type": "Property", - "description": { - "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" - }, - "displayName": { - "en": "AppKey" - }, - "name": "AppKey", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:SensorDecoder;1", - "@type": "Property", - "description": { - "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." - }, - "displayName": { - "en": "SensorDecoder" - }, - "name": "SensorDecoder", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate;1", - "@type": "Property", - "description": { - "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." - }, - "displayName": { - "en": "RX2DataRate" - }, - "name": "RX2DataRate", - "schema": { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema;1", - "@type": "Enum", - "displayName": { - "en": "Enum" - }, - "enumValues": [ - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF12BW125;1", - "displayName": { - "en": "SF12BW125" - }, - "enumValue": "SF12BW125", - "name": "SF12BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF11BW125;1", - "displayName": { - "en": "SF11BW125" - }, - "enumValue": "SF11BW125", - "name": "SF11BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF10BW125;1", - "displayName": { - "en": "SF10BW125" - }, - "enumValue": "SF10BW125", - "name": "SF10BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF8BW125;1", - "displayName": { - "en": "SF8BW125" - }, - "enumValue": "SF8BW125", - "name": "SF8BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF7BW250;1", - "displayName": { - "en": "SF7BW250" - }, - "enumValue": "SF7BW250", - "name": "SF7BW250" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF7BW125;1", - "displayName": { - "en": "SF7BW125" - }, - "enumValue": "SF7BW125", - "name": "SF7BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF9BW125;1", - "displayName": { - "en": "SF9BW125" - }, - "enumValue": "SF9BW125", - "name": "SF9BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF8BW500;1", - "displayName": { - "en": "SF8BW500" - }, - "enumValue": "SF8BW500", - "name": "SF8BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF11BW500;1", - "displayName": { - "en": "SF11BW500" - }, - "enumValue": "SF11BW500", - "name": "SF11BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF10BW500;1", - "displayName": { - "en": "SF10BW500" - }, - "enumValue": "SF10BW500", - "name": "SF10BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:S0:LoRaDevice:RX2DataRate:schema:SF9BW500;1", - "displayName": { - "en": "SF9BW500" - }, - "enumValue": "SF9BW500", - "name": "SF9BW500" - } - ], - "valueSchema": "string" - }, - "writable": true - } - ], - "displayName": { - "en": "LoRa Interface" - }, - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - } -] \ No newline at end of file diff --git a/dtdl/Watecco - Sens'O Sensor (50-70-011).json b/dtdl/Watecco - Sens'O Sensor (50-70-011).json deleted file mode 100644 index 205cfed..0000000 --- a/dtdl/Watecco - Sens'O Sensor (50-70-011).json +++ /dev/null @@ -1,189 +0,0 @@ -[ - { - "@id": "dtmi:kbeaugrand:watecco:SensO;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:SensO:Volume;1", - "@type": "Telemetry", - "displayName": { - "en": "Volume" - }, - "name": "Volume", - "schema": "integer" - } - ], - "displayName": { - "en": "Watecco - SensO (50-70-011)" - }, - "extends": [ - "dtmi:kbeaugrand:watecco:SensO:LoRaDevice;1" - ], - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:AppEUI;1", - "@type": "Property", - "description": { - "en": "This is the unique ID of the Application server." - }, - "displayName": { - "en": "AppEUI" - }, - "name": "AppEUI", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:AppKey;1", - "@type": "Property", - "description": { - "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" - }, - "displayName": { - "en": "AppKey" - }, - "name": "AppKey", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:SensorDecoder;1", - "@type": "Property", - "description": { - "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." - }, - "displayName": { - "en": "SensorDecoder" - }, - "name": "SensorDecoder", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate;1", - "@type": "Property", - "description": { - "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." - }, - "displayName": { - "en": "RX2DataRate" - }, - "name": "RX2DataRate", - "schema": { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema;1", - "@type": "Enum", - "displayName": { - "en": "Enum" - }, - "enumValues": [ - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF12BW125;1", - "displayName": { - "en": "SF12BW125" - }, - "enumValue": "SF12BW125", - "name": "SF12BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF11BW125;1", - "displayName": { - "en": "SF11BW125" - }, - "enumValue": "SF11BW125", - "name": "SF11BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF10BW125;1", - "displayName": { - "en": "SF10BW125" - }, - "enumValue": "SF10BW125", - "name": "SF10BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF8BW125;1", - "displayName": { - "en": "SF8BW125" - }, - "enumValue": "SF8BW125", - "name": "SF8BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF7BW250;1", - "displayName": { - "en": "SF7BW250" - }, - "enumValue": "SF7BW250", - "name": "SF7BW250" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF7BW125;1", - "displayName": { - "en": "SF7BW125" - }, - "enumValue": "SF7BW125", - "name": "SF7BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF9BW125;1", - "displayName": { - "en": "SF9BW125" - }, - "enumValue": "SF9BW125", - "name": "SF9BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF8BW500;1", - "displayName": { - "en": "SF8BW500" - }, - "enumValue": "SF8BW500", - "name": "SF8BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF11BW500;1", - "displayName": { - "en": "SF11BW500" - }, - "enumValue": "SF11BW500", - "name": "SF11BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF10BW500;1", - "displayName": { - "en": "SF10BW500" - }, - "enumValue": "SF10BW500", - "name": "SF10BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:SensO:LoRaDevice:RX2DataRate:schema:SF9BW500;1", - "displayName": { - "en": "SF9BW500" - }, - "enumValue": "SF9BW500", - "name": "SF9BW500" - } - ], - "valueSchema": "string" - }, - "writable": true - } - ], - "displayName": { - "en": "LoRa Interface" - }, - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - } -] \ No newline at end of file diff --git a/dtdl/Watecco - THr Sensor (50-70-007).json b/dtdl/Watecco - THr Sensor (50-70-007).json deleted file mode 100644 index 2b8a18e..0000000 --- a/dtdl/Watecco - THr Sensor (50-70-007).json +++ /dev/null @@ -1,216 +0,0 @@ -[ - { - "@id": "dtmi:kbeaugrand:watecco:THr;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:THr:Temperature;1", - "@type": [ - "Telemetry", - "Temperature" - ], - "displayName": { - "en": "Temperature" - }, - "name": "Temperature", - "schema": "double", - "unit": "degreeCelsius" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:Humidity;1", - "@type": [ - "Telemetry", - "Humidity" - ], - "displayName": { - "en": "Humidity" - }, - "name": "Humidity", - "schema": "double", - "unit": "percent" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:SinglePrecision;1", - "@type": "Telemetry", - "displayName": { - "en": "SinglePrecision" - }, - "name": "SinglePrecision", - "schema": "integer", - "unit": "percent" - } - ], - "displayName": { - "en": "Watecco - THr (50-70-007)" - }, - "extends": [ - "dtmi:kbeaugrand:watecco:THr:LoRaDevice;1" - ], - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:AppEUI;1", - "@type": "Property", - "description": { - "en": "This is the unique ID of the Application server." - }, - "displayName": { - "en": "AppEUI" - }, - "name": "AppEUI", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:AppKey;1", - "@type": "Property", - "description": { - "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" - }, - "displayName": { - "en": "AppKey" - }, - "name": "AppKey", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:SensorDecoder;1", - "@type": "Property", - "description": { - "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." - }, - "displayName": { - "en": "SensorDecoder" - }, - "name": "SensorDecoder", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate;1", - "@type": "Property", - "description": { - "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." - }, - "displayName": { - "en": "RX2DataRate" - }, - "name": "RX2DataRate", - "schema": { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema;1", - "@type": "Enum", - "displayName": { - "en": "Enum" - }, - "enumValues": [ - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF12BW125;1", - "displayName": { - "en": "SF12BW125" - }, - "enumValue": "SF12BW125", - "name": "SF12BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF11BW125;1", - "displayName": { - "en": "SF11BW125" - }, - "enumValue": "SF11BW125", - "name": "SF11BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF10BW125;1", - "displayName": { - "en": "SF10BW125" - }, - "enumValue": "SF10BW125", - "name": "SF10BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF8BW125;1", - "displayName": { - "en": "SF8BW125" - }, - "enumValue": "SF8BW125", - "name": "SF8BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF7BW250;1", - "displayName": { - "en": "SF7BW250" - }, - "enumValue": "SF7BW250", - "name": "SF7BW250" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF7BW125;1", - "displayName": { - "en": "SF7BW125" - }, - "enumValue": "SF7BW125", - "name": "SF7BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF9BW125;1", - "displayName": { - "en": "SF9BW125" - }, - "enumValue": "SF9BW125", - "name": "SF9BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF8BW500;1", - "displayName": { - "en": "SF8BW500" - }, - "enumValue": "SF8BW500", - "name": "SF8BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF11BW500;1", - "displayName": { - "en": "SF11BW500" - }, - "enumValue": "SF11BW500", - "name": "SF11BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF10BW500;1", - "displayName": { - "en": "SF10BW500" - }, - "enumValue": "SF10BW500", - "name": "SF10BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:THr:LoRaDevice:RX2DataRate:schema:SF9BW500;1", - "displayName": { - "en": "SF9BW500" - }, - "enumValue": "SF9BW500", - "name": "SF9BW500" - } - ], - "valueSchema": "string" - }, - "writable": true - } - ], - "displayName": { - "en": "LoRa Interface" - }, - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - } -] \ No newline at end of file diff --git a/dtdl/Watecco - VAQA'O Sensor (50-70-168).json b/dtdl/Watecco - VAQA'O Sensor (50-70-168).json deleted file mode 100644 index 0f013c8..0000000 --- a/dtdl/Watecco - VAQA'O Sensor (50-70-168).json +++ /dev/null @@ -1,248 +0,0 @@ -[ - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:Temperature;1", - "@type": [ - "Telemetry", - "Temperature" - ], - "displayName": { - "en": "Temperature" - }, - "name": "Temperature", - "schema": "double" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:Humidity;1", - "@type": [ - "Telemetry", - "Humidity" - ], - "displayName": { - "en": "Humidity" - }, - "name": "Humidity", - "schema": "double" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:Illuminance;1", - "@type": [ - "Telemetry", - "Illuminance" - ], - "displayName": { - "en": "Illuminance" - }, - "name": "Illuminance", - "schema": "double" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:Pressure;1", - "@type": [ - "Telemetry", - "Pressure" - ], - "displayName": { - "en": "Pressure" - }, - "name": "Pressure", - "schema": "double", - "unit": "bar" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:Occupancy;1", - "@type": "Telemetry", - "displayName": { - "en": "Occupancy" - }, - "name": "Occupancy", - "schema": "boolean" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:BatteryLevel;1", - "@type": "Telemetry", - "displayName": { - "en": "Battery Level" - }, - "name": "BatteryLevel", - "schema": "double", - "unit": "percent" - } - ], - "displayName": { - "en": "VAQA'O Sensor (50-70-168)" - }, - "extends": [ - "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice;1" - ], - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice;1", - "@type": "Interface", - "contents": [ - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:AppEUI;1", - "@type": "Property", - "description": { - "en": "This is the unique ID of the Application server." - }, - "displayName": { - "en": "AppEUI" - }, - "name": "AppEUI", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:AppKey;1", - "@type": "Property", - "description": { - "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" - }, - "displayName": { - "en": "AppKey" - }, - "name": "AppKey", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:SensorDecoder;1", - "@type": "Property", - "description": { - "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." - }, - "displayName": { - "en": "SensorDecoder" - }, - "name": "SensorDecoder", - "schema": "string", - "writable": true - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate;1", - "@type": "Property", - "description": { - "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." - }, - "displayName": { - "en": "RX2DataRate" - }, - "name": "RX2DataRate", - "schema": { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema;1", - "@type": "Enum", - "displayName": { - "en": "Enum" - }, - "enumValues": [ - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF12BW125;1", - "displayName": { - "en": "SF12BW125" - }, - "enumValue": "SF12BW125", - "name": "SF12BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF11BW125;1", - "displayName": { - "en": "SF11BW125" - }, - "enumValue": "SF11BW125", - "name": "SF11BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF10BW125;1", - "displayName": { - "en": "SF10BW125" - }, - "enumValue": "SF10BW125", - "name": "SF10BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF8BW125;1", - "displayName": { - "en": "SF8BW125" - }, - "enumValue": "SF8BW125", - "name": "SF8BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF7BW250;1", - "displayName": { - "en": "SF7BW250" - }, - "enumValue": "SF7BW250", - "name": "SF7BW250" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF7BW125;1", - "displayName": { - "en": "SF7BW125" - }, - "enumValue": "SF7BW125", - "name": "SF7BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF9BW125;1", - "displayName": { - "en": "SF9BW125" - }, - "enumValue": "SF9BW125", - "name": "SF9BW125" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF8BW500;1", - "displayName": { - "en": "SF8BW500" - }, - "enumValue": "SF8BW500", - "name": "SF8BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF11BW500;1", - "displayName": { - "en": "SF11BW500" - }, - "enumValue": "SF11BW500", - "name": "SF11BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF10BW500;1", - "displayName": { - "en": "SF10BW500" - }, - "enumValue": "SF10BW500", - "name": "SF10BW500" - }, - { - "@id": "dtmi:kbeaugrand:watecco:VAQUAO:LoRaDevice:RX2DataRate:schema:SF9BW500;1", - "displayName": { - "en": "SF9BW500" - }, - "enumValue": "SF9BW500", - "name": "SF9BW500" - } - ], - "valueSchema": "string" - }, - "writable": true - } - ], - "displayName": { - "en": "LoRa Interface" - }, - "@context": [ - "dtmi:iotcentral:context;2", - "dtmi:dtdl:context;2" - ] - } -] \ No newline at end of file diff --git a/dtdl/Watteco - Atmo (50-70-099).png b/dtdl/Watteco - Atmo (50-70-099).png new file mode 100644 index 0000000..191aedf Binary files /dev/null and b/dtdl/Watteco - Atmo (50-70-099).png differ diff --git a/dtdl/Watteco - Atmo Sensor (50-70-099).json b/dtdl/Watteco - Atmo Sensor (50-70-099).json new file mode 100644 index 0000000..c138c91 --- /dev/null +++ b/dtdl/Watteco - Atmo Sensor (50-70-099).json @@ -0,0 +1,526 @@ +[ + { + "@id": "dtmi:watteco:Atmo;1", + "@type": "Interface", + "contents": [ + { + "@id": "dtmi:watteco:Atmo:data;1", + "@type": "Telemetry", + "comment": "Sens'O Sensors data", + "displayName": { + "en": "data" + }, + "name": "data", + "schema": { + "@id": "dtmi:watteco:Atmo:data:schema;1", + "@type": "Object", + "displayName": { + "en": "Object" + }, + "fields": [ + { + "@id": "dtmi:watteco:Atmo:data:schema:Temperature;1", + "displayName": { + "en": "Temperature" + }, + "name": "Temperature", + "schema": "double" + }, + { + "@id": "dtmi:watteco:Atmo:data:schema:RelativeHumidity;1", + "displayName": { + "en": "RelativeHumidity" + }, + "name": "RelativeHumidity", + "schema": "double" + }, + { + "@id": "dtmi:watteco:Atmo:data:schema:Pressure;1", + "displayName": { + "en": "Pressure" + }, + "name": "Pressure", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:data:schema:BatteryLevel;1", + "displayName": { + "en": "BatteryLevel" + }, + "name": "BatteryLevel", + "schema": "double" + } + ] + } + } + ], + "extends": [ + "dtmi:watteco:Atmo:LoRaDevice;1" + ], + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ] + }, + { + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ], + "@id": "dtmi:watteco:Atmo:LoRaDevice;1", + "@type": [ + "Interface", + "NamedInterface" + ], + "contents": [ + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:AppEUI;1", + "@type": "Property", + "description": { + "en": "This is the unique ID of the Application server." + }, + "displayName": { + "en": "AppEUI" + }, + "name": "AppEUI", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:AppKey;1", + "@type": "Property", + "description": { + "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" + }, + "displayName": { + "en": "AppKey" + }, + "name": "AppKey", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:SensorDecoder;1", + "@type": "Property", + "description": { + "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." + }, + "displayName": { + "en": "SensorDecoder" + }, + "name": "SensorDecoder", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate;1", + "@type": "Property", + "description": { + "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." + }, + "displayName": { + "en": "RX2DataRate" + }, + "name": "RX2DataRate", + "schema": { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema;1", + "@type": "Enum", + "displayName": { + "en": "Enum" + }, + "enumValues": [ + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF12BW125;1", + "displayName": { + "en": "SF12BW125" + }, + "enumValue": "SF12BW125", + "name": "SF12BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF11BW125;1", + "displayName": { + "en": "SF11BW125" + }, + "enumValue": "SF11BW125", + "name": "SF11BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF10BW125;1", + "displayName": { + "en": "SF10BW125" + }, + "enumValue": "SF10BW125", + "name": "SF10BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF8BW125;1", + "displayName": { + "en": "SF8BW125" + }, + "enumValue": "SF8BW125", + "name": "SF8BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF7BW250;1", + "displayName": { + "en": "SF7BW250" + }, + "enumValue": "SF7BW250", + "name": "SF7BW250" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF7BW125;1", + "displayName": { + "en": "SF7BW125" + }, + "enumValue": "SF7BW125", + "name": "SF7BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF9BW125;1", + "displayName": { + "en": "SF9BW125" + }, + "enumValue": "SF9BW125", + "name": "SF9BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF8BW500;1", + "displayName": { + "en": "SF8BW500" + }, + "enumValue": "SF8BW500", + "name": "SF8BW500" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF11BW500;1", + "displayName": { + "en": "SF11BW500" + }, + "enumValue": "SF11BW500", + "name": "SF11BW500" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF10BW500;1", + "displayName": { + "en": "SF10BW500" + }, + "enumValue": "SF10BW500", + "name": "SF10BW500" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF9BW500;1", + "displayName": { + "en": "SF9BW500" + }, + "enumValue": "SF9BW500", + "name": "SF9BW500" + } + ], + "valueSchema": "string" + }, + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:tmst;1", + "@type": "Telemetry", + "description": { + "en": "Internal timestamp of \"RX finished\" event (32b unsigned)" + }, + "displayName": { + "en": "TimeStamp" + }, + "name": "tmst", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:time;1", + "@type": "Telemetry", + "description": { + "en": "UTC time of pkt RX, us precision, ISO 8601 'compact' format" + }, + "displayName": { + "en": "Time" + }, + "name": "time", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:tmms;1", + "@type": "Telemetry", + "description": { + "en": "GPS time of pkt RX, number of milliseconds since 06.Jan.1980" + }, + "displayName": { + "en": "GPS Time" + }, + "name": "tmms", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:freq;1", + "@type": [ + "Telemetry", + "Frequency" + ], + "description": { + "en": "RX central frequency in MHz (unsigned float, Hz precision)" + }, + "displayName": { + "en": "Frequency" + }, + "name": "freq", + "schema": "float", + "unit": "megahertz" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:chan;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"IF\" channel used for RX (unsigned integer)" + }, + "displayName": { + "en": "Channel" + }, + "name": "chan", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:rfch;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"RF chain\" used for RX (unsigned integer)" + }, + "displayName": { + "en": "RF Chain" + }, + "name": "rfch", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:stat;1", + "@type": "Telemetry", + "description": { + "en": " CRC status: 1 = OK, -1 = fail, 0 = no CRC" + }, + "displayName": { + "en": "Status" + }, + "name": "stat", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:datr;1", + "@type": "Telemetry", + "description": { + "en": "LoRa datarate identifier (eg. SF12BW500)" + }, + "displayName": { + "en": "Data Rate" + }, + "name": "datr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:codr;1", + "@type": "Telemetry", + "description": { + "en": "FSK datarate (unsigned, in bits per second)" + }, + "displayName": { + "en": "Coding Rate" + }, + "name": "codr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:rssi;1", + "@type": "Telemetry", + "description": { + "en": "RSSI in dBm (signed integer, 1 dB precision)" + }, + "displayName": { + "en": "RSSI" + }, + "name": "rssi", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:lsnr;1", + "@type": "Telemetry", + "description": { + "en": "Lora SNR ratio in dB (signed float, 0.1 dB precision)" + }, + "displayName": { + "en": "LSNR" + }, + "name": "lsnr", + "schema": "double" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:size;1", + "@type": "Telemetry", + "description": { + "en": "RF packet payload size in bytes (unsigned integer)" + }, + "displayName": { + "en": "RF Size" + }, + "name": "size", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:modu;1", + "@type": "Telemetry", + "description": { + "en": "Modulation identifier \"LORA\" or \"FSK\"" + }, + "displayName": { + "en": "Modulation" + }, + "name": "modu", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:rawdata;1", + "@type": "Telemetry", + "displayName": { + "en": "Raw Data" + }, + "name": "rawdata", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:fcnt;1", + "@type": "Telemetry", + "displayName": { + "en": "Frame Counter" + }, + "name": "fcnt", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:port;1", + "@type": "Telemetry", + "displayName": { + "en": "Port" + }, + "name": "port", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:gatewayid;1", + "@type": "Telemetry", + "displayName": { + "en": "Gateway ID" + }, + "name": "gatewayid", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:edgets;1", + "@type": "Telemetry", + "displayName": { + "en": "Edge TimeStamp" + }, + "name": "edgets", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:AppSKey;1", + "@type": "Property", + "displayName": { + "en": "AppSKey" + }, + "name": "AppSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:NwkSKey;1", + "@type": "Property", + "displayName": { + "en": "NwkSKey" + }, + "name": "NwkSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:DevAddr;1", + "@type": "Property", + "displayName": { + "en": "DevAddr" + }, + "name": "DevAddr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:FCntDown;1", + "@type": "Property", + "displayName": { + "en": "FCntDown" + }, + "name": "FCntDown", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:FCntUp;1", + "@type": "Property", + "displayName": { + "en": "FCntUp" + }, + "name": "FCntUp", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:DevEUI;1", + "@type": "Property", + "displayName": { + "en": "DevEUI" + }, + "name": "DevEUI", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:NetId;1", + "@type": "Property", + "displayName": { + "en": "NetId" + }, + "name": "NetId", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:DevNonce;1", + "@type": "Property", + "displayName": { + "en": "DevNonce" + }, + "name": "DevNonce", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX1DROffset;1", + "@type": "Property", + "displayName": { + "en": "RX1DROffset" + }, + "name": "RX1DROffset", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RXDelay;1", + "@type": "Property", + "displayName": { + "en": "RXDelay" + }, + "name": "RXDelay", + "schema": "string" + } + ], + "displayName": { + "en": "LoRa Interface" + }, + "name": "LoRa" + } +] \ No newline at end of file diff --git a/dtdl/Watteco - Press'O (50-70-017).json b/dtdl/Watteco - Press'O (50-70-017).json new file mode 100644 index 0000000..2122e8e --- /dev/null +++ b/dtdl/Watteco - Press'O (50-70-017).json @@ -0,0 +1,518 @@ +[ + { + "@id": "dtmi:watteco:PressO;1", + "@type": "Interface", + "contents": [ + { + "@id": "dtmi:watteco:Atmo:data;1", + "@type": "Telemetry", + "comment": "Sens'O Sensors data", + "displayName": { + "en": "data" + }, + "name": "data", + "schema": { + "@id": "dtmi:watteco:Atmo:data:schema;1", + "@type": "Object", + "displayName": { + "en": "Object" + }, + "fields": [ + { + "@id": "dtmi:watteco:Atmo:data:schema:mA;1", + "displayName": { + "en": "4-20mA" + }, + "name": "mA", + "schema": "double" + }, + { + "@id": "dtmi:watteco:Atmo:data:schema:V;1", + "displayName": { + "en": "0-10V" + }, + "name": "V", + "schema": "double" + }, + { + "@id": "dtmi:watteco:Atmo:data:schema:BatteryLevel;1", + "displayName": { + "en": "BatteryLevel" + }, + "name": "BatteryLevel", + "schema": "double" + } + ] + } + } + ], + "extends": [ + "dtmi:watteco:Atmo:LoRaDevice;1" + ], + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ] + }, + { + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ], + "@id": "dtmi:watteco:Atmo:LoRaDevice;1", + "@type": [ + "Interface", + "NamedInterface" + ], + "contents": [ + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:AppEUI;1", + "@type": "Property", + "description": { + "en": "This is the unique ID of the Application server." + }, + "displayName": { + "en": "AppEUI" + }, + "name": "AppEUI", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:AppKey;1", + "@type": "Property", + "description": { + "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" + }, + "displayName": { + "en": "AppKey" + }, + "name": "AppKey", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:SensorDecoder;1", + "@type": "Property", + "description": { + "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." + }, + "displayName": { + "en": "SensorDecoder" + }, + "name": "SensorDecoder", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate;1", + "@type": "Property", + "description": { + "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." + }, + "displayName": { + "en": "RX2DataRate" + }, + "name": "RX2DataRate", + "schema": { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema;1", + "@type": "Enum", + "displayName": { + "en": "Enum" + }, + "enumValues": [ + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF12BW125;1", + "displayName": { + "en": "SF12BW125" + }, + "enumValue": "SF12BW125", + "name": "SF12BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF11BW125;1", + "displayName": { + "en": "SF11BW125" + }, + "enumValue": "SF11BW125", + "name": "SF11BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF10BW125;1", + "displayName": { + "en": "SF10BW125" + }, + "enumValue": "SF10BW125", + "name": "SF10BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF8BW125;1", + "displayName": { + "en": "SF8BW125" + }, + "enumValue": "SF8BW125", + "name": "SF8BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF7BW250;1", + "displayName": { + "en": "SF7BW250" + }, + "enumValue": "SF7BW250", + "name": "SF7BW250" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF7BW125;1", + "displayName": { + "en": "SF7BW125" + }, + "enumValue": "SF7BW125", + "name": "SF7BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF9BW125;1", + "displayName": { + "en": "SF9BW125" + }, + "enumValue": "SF9BW125", + "name": "SF9BW125" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF8BW500;1", + "displayName": { + "en": "SF8BW500" + }, + "enumValue": "SF8BW500", + "name": "SF8BW500" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF11BW500;1", + "displayName": { + "en": "SF11BW500" + }, + "enumValue": "SF11BW500", + "name": "SF11BW500" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF10BW500;1", + "displayName": { + "en": "SF10BW500" + }, + "enumValue": "SF10BW500", + "name": "SF10BW500" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX2DataRate:schema:SF9BW500;1", + "displayName": { + "en": "SF9BW500" + }, + "enumValue": "SF9BW500", + "name": "SF9BW500" + } + ], + "valueSchema": "string" + }, + "writable": true + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:tmst;1", + "@type": "Telemetry", + "description": { + "en": "Internal timestamp of \"RX finished\" event (32b unsigned)" + }, + "displayName": { + "en": "TimeStamp" + }, + "name": "tmst", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:time;1", + "@type": "Telemetry", + "description": { + "en": "UTC time of pkt RX, us precision, ISO 8601 'compact' format" + }, + "displayName": { + "en": "Time" + }, + "name": "time", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:tmms;1", + "@type": "Telemetry", + "description": { + "en": "GPS time of pkt RX, number of milliseconds since 06.Jan.1980" + }, + "displayName": { + "en": "GPS Time" + }, + "name": "tmms", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:freq;1", + "@type": [ + "Telemetry", + "Frequency" + ], + "description": { + "en": "RX central frequency in MHz (unsigned float, Hz precision)" + }, + "displayName": { + "en": "Frequency" + }, + "name": "freq", + "schema": "float", + "unit": "megahertz" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:chan;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"IF\" channel used for RX (unsigned integer)" + }, + "displayName": { + "en": "Channel" + }, + "name": "chan", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:rfch;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"RF chain\" used for RX (unsigned integer)" + }, + "displayName": { + "en": "RF Chain" + }, + "name": "rfch", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:stat;1", + "@type": "Telemetry", + "description": { + "en": " CRC status: 1 = OK, -1 = fail, 0 = no CRC" + }, + "displayName": { + "en": "Status" + }, + "name": "stat", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:datr;1", + "@type": "Telemetry", + "description": { + "en": "LoRa datarate identifier (eg. SF12BW500)" + }, + "displayName": { + "en": "Data Rate" + }, + "name": "datr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:codr;1", + "@type": "Telemetry", + "description": { + "en": "FSK datarate (unsigned, in bits per second)" + }, + "displayName": { + "en": "Coding Rate" + }, + "name": "codr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:rssi;1", + "@type": "Telemetry", + "description": { + "en": "RSSI in dBm (signed integer, 1 dB precision)" + }, + "displayName": { + "en": "RSSI" + }, + "name": "rssi", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:lsnr;1", + "@type": "Telemetry", + "description": { + "en": "Lora SNR ratio in dB (signed float, 0.1 dB precision)" + }, + "displayName": { + "en": "LSNR" + }, + "name": "lsnr", + "schema": "double" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:size;1", + "@type": "Telemetry", + "description": { + "en": "RF packet payload size in bytes (unsigned integer)" + }, + "displayName": { + "en": "RF Size" + }, + "name": "size", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:modu;1", + "@type": "Telemetry", + "description": { + "en": "Modulation identifier \"LORA\" or \"FSK\"" + }, + "displayName": { + "en": "Modulation" + }, + "name": "modu", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:rawdata;1", + "@type": "Telemetry", + "displayName": { + "en": "Raw Data" + }, + "name": "rawdata", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:fcnt;1", + "@type": "Telemetry", + "displayName": { + "en": "Frame Counter" + }, + "name": "fcnt", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:port;1", + "@type": "Telemetry", + "displayName": { + "en": "Port" + }, + "name": "port", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:gatewayid;1", + "@type": "Telemetry", + "displayName": { + "en": "Gateway ID" + }, + "name": "gatewayid", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:edgets;1", + "@type": "Telemetry", + "displayName": { + "en": "Edge TimeStamp" + }, + "name": "edgets", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:AppSKey;1", + "@type": "Property", + "displayName": { + "en": "AppSKey" + }, + "name": "AppSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:NwkSKey;1", + "@type": "Property", + "displayName": { + "en": "NwkSKey" + }, + "name": "NwkSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:DevAddr;1", + "@type": "Property", + "displayName": { + "en": "DevAddr" + }, + "name": "DevAddr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:FCntDown;1", + "@type": "Property", + "displayName": { + "en": "FCntDown" + }, + "name": "FCntDown", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:FCntUp;1", + "@type": "Property", + "displayName": { + "en": "FCntUp" + }, + "name": "FCntUp", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:DevEUI;1", + "@type": "Property", + "displayName": { + "en": "DevEUI" + }, + "name": "DevEUI", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:NetId;1", + "@type": "Property", + "displayName": { + "en": "NetId" + }, + "name": "NetId", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:DevNonce;1", + "@type": "Property", + "displayName": { + "en": "DevNonce" + }, + "name": "DevNonce", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RX1DROffset;1", + "@type": "Property", + "displayName": { + "en": "RX1DROffset" + }, + "name": "RX1DROffset", + "schema": "string" + }, + { + "@id": "dtmi:watteco:Atmo:LoRaDevice:RXDelay;1", + "@type": "Property", + "displayName": { + "en": "RXDelay" + }, + "name": "RXDelay", + "schema": "string" + } + ], + "displayName": { + "en": "LoRa Interface" + }, + "name": "LoRa" + } + ] \ No newline at end of file diff --git a/dtdl/Watteco - PressO Sensor (50-70-017).jpg b/dtdl/Watteco - PressO Sensor (50-70-017).jpg new file mode 100644 index 0000000..9c11cf4 Binary files /dev/null and b/dtdl/Watteco - PressO Sensor (50-70-017).jpg differ diff --git a/dtdl/Watecco - S0 Sensor (50-70-001).jpg b/dtdl/Watteco - S0 Sensor (50-70-001).jpg similarity index 100% rename from dtdl/Watecco - S0 Sensor (50-70-001).jpg rename to dtdl/Watteco - S0 Sensor (50-70-001).jpg diff --git a/dtdl/Watteco - S0 Sensor (50-70-001).json b/dtdl/Watteco - S0 Sensor (50-70-001).json new file mode 100644 index 0000000..42ca5a2 --- /dev/null +++ b/dtdl/Watteco - S0 Sensor (50-70-001).json @@ -0,0 +1,510 @@ +[ + { + "@id": "dtmi:watteco:S0;1", + "@type": "Interface", + "contents": [ + { + "@id": "dtmi:watteco:S0:data;1", + "@type": "Telemetry", + "comment": "Sens'O Sensors data", + "displayName": { + "en": "data" + }, + "name": "data", + "schema": { + "@id": "dtmi:watteco:S0:data:schema;1", + "@type": "Object", + "displayName": { + "en": "Object" + }, + "fields": [ + { + "@id": "dtmi:watteco:S0:data:schema:Volume;1", + "displayName": { + "en": "Volume" + }, + "name": "Volume", + "schema": "double" + }, + { + "@id": "dtmi:watteco:S0:data:schema:DisposableBatteryVoltage;1", + "displayName": { + "en": "DisposableBatteryVoltage" + }, + "name": "DisposableBatteryVoltage", + "schema": "double" + } + ] + } + } + ], + "extends": [ + "dtmi:watteco:S0:LoRaDevice;1" + ], + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ] + }, + { + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ], + "@id": "dtmi:watteco:S0:LoRaDevice;1", + "@type": [ + "Interface", + "NamedInterface" + ], + "contents": [ + { + "@id": "dtmi:watteco:S0:LoRaDevice:AppEUI;1", + "@type": "Property", + "description": { + "en": "This is the unique ID of the Application server." + }, + "displayName": { + "en": "AppEUI" + }, + "name": "AppEUI", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:AppKey;1", + "@type": "Property", + "description": { + "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" + }, + "displayName": { + "en": "AppKey" + }, + "name": "AppKey", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:SensorDecoder;1", + "@type": "Property", + "description": { + "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." + }, + "displayName": { + "en": "SensorDecoder" + }, + "name": "SensorDecoder", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate;1", + "@type": "Property", + "description": { + "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." + }, + "displayName": { + "en": "RX2DataRate" + }, + "name": "RX2DataRate", + "schema": { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema;1", + "@type": "Enum", + "displayName": { + "en": "Enum" + }, + "enumValues": [ + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF12BW125;1", + "displayName": { + "en": "SF12BW125" + }, + "enumValue": "SF12BW125", + "name": "SF12BW125" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF11BW125;1", + "displayName": { + "en": "SF11BW125" + }, + "enumValue": "SF11BW125", + "name": "SF11BW125" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF10BW125;1", + "displayName": { + "en": "SF10BW125" + }, + "enumValue": "SF10BW125", + "name": "SF10BW125" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF8BW125;1", + "displayName": { + "en": "SF8BW125" + }, + "enumValue": "SF8BW125", + "name": "SF8BW125" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF7BW250;1", + "displayName": { + "en": "SF7BW250" + }, + "enumValue": "SF7BW250", + "name": "SF7BW250" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF7BW125;1", + "displayName": { + "en": "SF7BW125" + }, + "enumValue": "SF7BW125", + "name": "SF7BW125" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF9BW125;1", + "displayName": { + "en": "SF9BW125" + }, + "enumValue": "SF9BW125", + "name": "SF9BW125" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF8BW500;1", + "displayName": { + "en": "SF8BW500" + }, + "enumValue": "SF8BW500", + "name": "SF8BW500" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF11BW500;1", + "displayName": { + "en": "SF11BW500" + }, + "enumValue": "SF11BW500", + "name": "SF11BW500" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF10BW500;1", + "displayName": { + "en": "SF10BW500" + }, + "enumValue": "SF10BW500", + "name": "SF10BW500" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX2DataRate:schema:SF9BW500;1", + "displayName": { + "en": "SF9BW500" + }, + "enumValue": "SF9BW500", + "name": "SF9BW500" + } + ], + "valueSchema": "string" + }, + "writable": true + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:tmst;1", + "@type": "Telemetry", + "description": { + "en": "Internal timestamp of \"RX finished\" event (32b unsigned)" + }, + "displayName": { + "en": "TimeStamp" + }, + "name": "tmst", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:time;1", + "@type": "Telemetry", + "description": { + "en": "UTC time of pkt RX, us precision, ISO 8601 'compact' format" + }, + "displayName": { + "en": "Time" + }, + "name": "time", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:tmms;1", + "@type": "Telemetry", + "description": { + "en": "GPS time of pkt RX, number of milliseconds since 06.Jan.1980" + }, + "displayName": { + "en": "GPS Time" + }, + "name": "tmms", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:freq;1", + "@type": [ + "Telemetry", + "Frequency" + ], + "description": { + "en": "RX central frequency in MHz (unsigned float, Hz precision)" + }, + "displayName": { + "en": "Frequency" + }, + "name": "freq", + "schema": "float", + "unit": "megahertz" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:chan;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"IF\" channel used for RX (unsigned integer)" + }, + "displayName": { + "en": "Channel" + }, + "name": "chan", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:rfch;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"RF chain\" used for RX (unsigned integer)" + }, + "displayName": { + "en": "RF Chain" + }, + "name": "rfch", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:stat;1", + "@type": "Telemetry", + "description": { + "en": " CRC status: 1 = OK, -1 = fail, 0 = no CRC" + }, + "displayName": { + "en": "Status" + }, + "name": "stat", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:datr;1", + "@type": "Telemetry", + "description": { + "en": "LoRa datarate identifier (eg. SF12BW500)" + }, + "displayName": { + "en": "Data Rate" + }, + "name": "datr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:codr;1", + "@type": "Telemetry", + "description": { + "en": "FSK datarate (unsigned, in bits per second)" + }, + "displayName": { + "en": "Coding Rate" + }, + "name": "codr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:rssi;1", + "@type": "Telemetry", + "description": { + "en": "RSSI in dBm (signed integer, 1 dB precision)" + }, + "displayName": { + "en": "RSSI" + }, + "name": "rssi", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:lsnr;1", + "@type": "Telemetry", + "description": { + "en": "Lora SNR ratio in dB (signed float, 0.1 dB precision)" + }, + "displayName": { + "en": "LSNR" + }, + "name": "lsnr", + "schema": "double" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:size;1", + "@type": "Telemetry", + "description": { + "en": "RF packet payload size in bytes (unsigned integer)" + }, + "displayName": { + "en": "RF Size" + }, + "name": "size", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:modu;1", + "@type": "Telemetry", + "description": { + "en": "Modulation identifier \"LORA\" or \"FSK\"" + }, + "displayName": { + "en": "Modulation" + }, + "name": "modu", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:rawdata;1", + "@type": "Telemetry", + "displayName": { + "en": "Raw Data" + }, + "name": "rawdata", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:fcnt;1", + "@type": "Telemetry", + "displayName": { + "en": "Frame Counter" + }, + "name": "fcnt", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:port;1", + "@type": "Telemetry", + "displayName": { + "en": "Port" + }, + "name": "port", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:gatewayid;1", + "@type": "Telemetry", + "displayName": { + "en": "Gateway ID" + }, + "name": "gatewayid", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:edgets;1", + "@type": "Telemetry", + "displayName": { + "en": "Edge TimeStamp" + }, + "name": "edgets", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:AppSKey;1", + "@type": "Property", + "displayName": { + "en": "AppSKey" + }, + "name": "AppSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:NwkSKey;1", + "@type": "Property", + "displayName": { + "en": "NwkSKey" + }, + "name": "NwkSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:DevAddr;1", + "@type": "Property", + "displayName": { + "en": "DevAddr" + }, + "name": "DevAddr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:FCntDown;1", + "@type": "Property", + "displayName": { + "en": "FCntDown" + }, + "name": "FCntDown", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:FCntUp;1", + "@type": "Property", + "displayName": { + "en": "FCntUp" + }, + "name": "FCntUp", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:DevEUI;1", + "@type": "Property", + "displayName": { + "en": "DevEUI" + }, + "name": "DevEUI", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:NetId;1", + "@type": "Property", + "displayName": { + "en": "NetId" + }, + "name": "NetId", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:DevNonce;1", + "@type": "Property", + "displayName": { + "en": "DevNonce" + }, + "name": "DevNonce", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RX1DROffset;1", + "@type": "Property", + "displayName": { + "en": "RX1DROffset" + }, + "name": "RX1DROffset", + "schema": "string" + }, + { + "@id": "dtmi:watteco:S0:LoRaDevice:RXDelay;1", + "@type": "Property", + "displayName": { + "en": "RXDelay" + }, + "name": "RXDelay", + "schema": "string" + } + ], + "displayName": { + "en": "LoRa Interface" + }, + "name": "LoRa" + } +] \ No newline at end of file diff --git a/dtdl/Watecco - Sens'O (50-70-011).png b/dtdl/Watteco - Sens'O (50-70-011).png similarity index 100% rename from dtdl/Watecco - Sens'O (50-70-011).png rename to dtdl/Watteco - Sens'O (50-70-011).png diff --git a/dtdl/Watteco - Sens'O Sensor (50-70-011).json b/dtdl/Watteco - Sens'O Sensor (50-70-011).json new file mode 100644 index 0000000..695a4e4 --- /dev/null +++ b/dtdl/Watteco - Sens'O Sensor (50-70-011).json @@ -0,0 +1,590 @@ +[ + { + "@id": "dtmi:watteco:SensO;1", + "@type": "Interface", + "contents": [ + { + "@id": "dtmi:watteco:SensO:data;1", + "@type": "Telemetry", + "comment": "Sens'O Sensors data", + "displayName": { + "en": "data" + }, + "name": "data", + "schema": { + "@id": "dtmi:watteco:SensO:data:schema;1", + "@type": "Object", + "displayName": { + "en": "Object" + }, + "fields": [ + { + "@id": "dtmi:watteco:SensO:data:schema:Volume;1", + "displayName": { + "en": "Volume" + }, + "name": "Volume", + "schema": "double" + }, + { + "@id": "dtmi:watteco:SensO:data:schema:DisposableBatteryVoltage;1", + "displayName": { + "en": "DisposableBatteryVoltage" + }, + "name": "DisposableBatteryVoltage", + "schema": "double" + }, + { + "@id": "dtmi:watteco:SensO:data:Status;1", + "displayName": { + "en": "Status" + }, + "name": "Status", + "schema": { + "@id": "dtmi:watteco:SensO:data:Status:schema;1", + "@type": "Object", + "displayName": { + "en": "Status" + }, + "fields": [ + { + "@id": "dtmi:watteco:SensO:data:Status:schema:Freeze;1", + "displayName": { + "en": "Freeze" + }, + "name": "Freeze", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:Installation;1", + "displayName": { + "en": "Installation" + }, + "name": "Installation", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:Battery;1", + "displayName": { + "en": "Battery" + }, + "name": "Battery", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:Fraud;1", + "displayName": { + "en": "Fraud" + }, + "name": "Fraud", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:BackWaterLevel3;1", + "displayName": { + "en": "BackWaterLevel3" + }, + "name": "BackWaterLevel3", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:BackWaterLevel2;1", + "displayName": { + "en": "BackWaterLevel2" + }, + "name": "BackWaterLevel2", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:BackWaterLevel1;1", + "displayName": { + "en": "BackWaterLevel1" + }, + "name": "BackWaterLevel1", + "schema": "boolean" + }, + { + "@id": "dtmi:watteco:SensO:data:Status:schema:Leak;1", + "displayName": { + "en": "Leak" + }, + "name": "Leak", + "schema": "boolean" + } + ] + } + } + ] + } + } + ], + "extends": [ + "dtmi:watteco:SensO:LoRaDevice;1" + ], + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ] + }, + { + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ], + "@id": "dtmi:watteco:SensO:LoRaDevice;1", + "@type": [ + "Interface", + "NamedInterface" + ], + "contents": [ + { + "@id": "dtmi:watteco:SensO:LoRaDevice:AppEUI;1", + "@type": "Property", + "description": { + "en": "This is the unique ID of the Application server." + }, + "displayName": { + "en": "AppEUI" + }, + "name": "AppEUI", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:AppKey;1", + "@type": "Property", + "description": { + "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" + }, + "displayName": { + "en": "AppKey" + }, + "name": "AppKey", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:SensorDecoder;1", + "@type": "Property", + "description": { + "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." + }, + "displayName": { + "en": "SensorDecoder" + }, + "name": "SensorDecoder", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate;1", + "@type": "Property", + "description": { + "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." + }, + "displayName": { + "en": "RX2DataRate" + }, + "name": "RX2DataRate", + "schema": { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema;1", + "@type": "Enum", + "displayName": { + "en": "Enum" + }, + "enumValues": [ + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF12BW125;1", + "displayName": { + "en": "SF12BW125" + }, + "enumValue": "SF12BW125", + "name": "SF12BW125" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF11BW125;1", + "displayName": { + "en": "SF11BW125" + }, + "enumValue": "SF11BW125", + "name": "SF11BW125" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF10BW125;1", + "displayName": { + "en": "SF10BW125" + }, + "enumValue": "SF10BW125", + "name": "SF10BW125" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF8BW125;1", + "displayName": { + "en": "SF8BW125" + }, + "enumValue": "SF8BW125", + "name": "SF8BW125" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF7BW250;1", + "displayName": { + "en": "SF7BW250" + }, + "enumValue": "SF7BW250", + "name": "SF7BW250" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF7BW125;1", + "displayName": { + "en": "SF7BW125" + }, + "enumValue": "SF7BW125", + "name": "SF7BW125" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF9BW125;1", + "displayName": { + "en": "SF9BW125" + }, + "enumValue": "SF9BW125", + "name": "SF9BW125" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF8BW500;1", + "displayName": { + "en": "SF8BW500" + }, + "enumValue": "SF8BW500", + "name": "SF8BW500" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF11BW500;1", + "displayName": { + "en": "SF11BW500" + }, + "enumValue": "SF11BW500", + "name": "SF11BW500" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF10BW500;1", + "displayName": { + "en": "SF10BW500" + }, + "enumValue": "SF10BW500", + "name": "SF10BW500" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX2DataRate:schema:SF9BW500;1", + "displayName": { + "en": "SF9BW500" + }, + "enumValue": "SF9BW500", + "name": "SF9BW500" + } + ], + "valueSchema": "string" + }, + "writable": true + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:tmst;1", + "@type": "Telemetry", + "description": { + "en": "Internal timestamp of \"RX finished\" event (32b unsigned)" + }, + "displayName": { + "en": "TimeStamp" + }, + "name": "tmst", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:time;1", + "@type": "Telemetry", + "description": { + "en": "UTC time of pkt RX, us precision, ISO 8601 'compact' format" + }, + "displayName": { + "en": "Time" + }, + "name": "time", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:tmms;1", + "@type": "Telemetry", + "description": { + "en": "GPS time of pkt RX, number of milliseconds since 06.Jan.1980" + }, + "displayName": { + "en": "GPS Time" + }, + "name": "tmms", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:freq;1", + "@type": [ + "Telemetry", + "Frequency" + ], + "description": { + "en": "RX central frequency in MHz (unsigned float, Hz precision)" + }, + "displayName": { + "en": "Frequency" + }, + "name": "freq", + "schema": "float", + "unit": "megahertz" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:chan;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"IF\" channel used for RX (unsigned integer)" + }, + "displayName": { + "en": "Channel" + }, + "name": "chan", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:rfch;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"RF chain\" used for RX (unsigned integer)" + }, + "displayName": { + "en": "RF Chain" + }, + "name": "rfch", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:stat;1", + "@type": "Telemetry", + "description": { + "en": " CRC status: 1 = OK, -1 = fail, 0 = no CRC" + }, + "displayName": { + "en": "Status" + }, + "name": "stat", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:datr;1", + "@type": "Telemetry", + "description": { + "en": "LoRa datarate identifier (eg. SF12BW500)" + }, + "displayName": { + "en": "Data Rate" + }, + "name": "datr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:codr;1", + "@type": "Telemetry", + "description": { + "en": "FSK datarate (unsigned, in bits per second)" + }, + "displayName": { + "en": "Coding Rate" + }, + "name": "codr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:rssi;1", + "@type": "Telemetry", + "description": { + "en": "RSSI in dBm (signed integer, 1 dB precision)" + }, + "displayName": { + "en": "RSSI" + }, + "name": "rssi", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:lsnr;1", + "@type": "Telemetry", + "description": { + "en": "Lora SNR ratio in dB (signed float, 0.1 dB precision)" + }, + "displayName": { + "en": "LSNR" + }, + "name": "lsnr", + "schema": "double" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:size;1", + "@type": "Telemetry", + "description": { + "en": "RF packet payload size in bytes (unsigned integer)" + }, + "displayName": { + "en": "RF Size" + }, + "name": "size", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:modu;1", + "@type": "Telemetry", + "description": { + "en": "Modulation identifier \"LORA\" or \"FSK\"" + }, + "displayName": { + "en": "Modulation" + }, + "name": "modu", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:rawdata;1", + "@type": "Telemetry", + "displayName": { + "en": "Raw Data" + }, + "name": "rawdata", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:fcnt;1", + "@type": "Telemetry", + "displayName": { + "en": "Frame Counter" + }, + "name": "fcnt", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:port;1", + "@type": "Telemetry", + "displayName": { + "en": "Port" + }, + "name": "port", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:gatewayid;1", + "@type": "Telemetry", + "displayName": { + "en": "Gateway ID" + }, + "name": "gatewayid", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:edgets;1", + "@type": "Telemetry", + "displayName": { + "en": "Edge TimeStamp" + }, + "name": "edgets", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:AppSKey;1", + "@type": "Property", + "displayName": { + "en": "AppSKey" + }, + "name": "AppSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:NwkSKey;1", + "@type": "Property", + "displayName": { + "en": "NwkSKey" + }, + "name": "NwkSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:DevAddr;1", + "@type": "Property", + "displayName": { + "en": "DevAddr" + }, + "name": "DevAddr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:FCntDown;1", + "@type": "Property", + "displayName": { + "en": "FCntDown" + }, + "name": "FCntDown", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:FCntUp;1", + "@type": "Property", + "displayName": { + "en": "FCntUp" + }, + "name": "FCntUp", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:DevEUI;1", + "@type": "Property", + "displayName": { + "en": "DevEUI" + }, + "name": "DevEUI", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:NetId;1", + "@type": "Property", + "displayName": { + "en": "NetId" + }, + "name": "NetId", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:DevNonce;1", + "@type": "Property", + "displayName": { + "en": "DevNonce" + }, + "name": "DevNonce", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RX1DROffset;1", + "@type": "Property", + "displayName": { + "en": "RX1DROffset" + }, + "name": "RX1DROffset", + "schema": "string" + }, + { + "@id": "dtmi:watteco:SensO:LoRaDevice:RXDelay;1", + "@type": "Property", + "displayName": { + "en": "RXDelay" + }, + "name": "RXDelay", + "schema": "string" + } + ], + "displayName": { + "en": "LoRa Interface" + }, + "name": "LoRa" + } + ] \ No newline at end of file diff --git a/dtdl/Watecco - THr Sensor (50-70-007).jpg b/dtdl/Watteco - THr Sensor (50-70-007).jpg similarity index 100% rename from dtdl/Watecco - THr Sensor (50-70-007).jpg rename to dtdl/Watteco - THr Sensor (50-70-007).jpg diff --git a/dtdl/Watteco - THr Sensor (50-70-007).json b/dtdl/Watteco - THr Sensor (50-70-007).json new file mode 100644 index 0000000..3b1f1cd --- /dev/null +++ b/dtdl/Watteco - THr Sensor (50-70-007).json @@ -0,0 +1,526 @@ +[ + { + "@id": "dtmi:watteco:THr;1", + "@type": "Interface", + "contents": [ + { + "@id": "dtmi:watteco:THr:data;1", + "@type": "Telemetry", + "comment": "THr Sensors data", + "displayName": { + "en": "data" + }, + "name": "data", + "schema": { + "@id": "dtmi:watteco:THr:data:schema;1", + "@type": "Object", + "displayName": { + "en": "Object" + }, + "fields": [ + { + "@id": "dtmi:watteco:THr:data:schema:Temperature;1", + "displayName": { + "en": "Temperature" + }, + "name": "Temperature", + "schema": "double" + }, + { + "@id": "dtmi:watteco:THr:data:schema:Illuminance;1", + "displayName": { + "en": "Illuminance" + }, + "name": "Illuminance", + "schema": "double" + }, + { + "@id": "dtmi:watteco:THr:data:schema:DisposableBatteryVoltage;1", + "displayName": { + "en": "DisposableBatteryVoltage" + }, + "name": "DisposableBatteryVoltage", + "schema": "double" + }, + { + "@id": "dtmi:watteco:THr:data:schema:RechargeableBatteryVoltage;1", + "displayName": { + "en": "RechargeableBatteryVoltage" + }, + "name": "RechargeableBatteryVoltage", + "schema": "double" + } + ] + } + } + ], + "extends": [ + "dtmi:watteco:THr:LoRaDevice;1" + ], + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ] + }, + { + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ], + "@id": "dtmi:watteco:THr:LoRaDevice;1", + "@type": [ + "Interface", + "NamedInterface" + ], + "contents": [ + { + "@id": "dtmi:watteco:THr:LoRaDevice:AppEUI;1", + "@type": "Property", + "description": { + "en": "This is the unique ID of the Application server." + }, + "displayName": { + "en": "AppEUI" + }, + "name": "AppEUI", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:AppKey;1", + "@type": "Property", + "description": { + "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" + }, + "displayName": { + "en": "AppKey" + }, + "name": "AppKey", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:SensorDecoder;1", + "@type": "Property", + "description": { + "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." + }, + "displayName": { + "en": "SensorDecoder" + }, + "name": "SensorDecoder", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate;1", + "@type": "Property", + "description": { + "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." + }, + "displayName": { + "en": "RX2DataRate" + }, + "name": "RX2DataRate", + "schema": { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema;1", + "@type": "Enum", + "displayName": { + "en": "Enum" + }, + "enumValues": [ + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF12BW125;1", + "displayName": { + "en": "SF12BW125" + }, + "enumValue": "SF12BW125", + "name": "SF12BW125" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF11BW125;1", + "displayName": { + "en": "SF11BW125" + }, + "enumValue": "SF11BW125", + "name": "SF11BW125" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF10BW125;1", + "displayName": { + "en": "SF10BW125" + }, + "enumValue": "SF10BW125", + "name": "SF10BW125" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF8BW125;1", + "displayName": { + "en": "SF8BW125" + }, + "enumValue": "SF8BW125", + "name": "SF8BW125" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF7BW250;1", + "displayName": { + "en": "SF7BW250" + }, + "enumValue": "SF7BW250", + "name": "SF7BW250" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF7BW125;1", + "displayName": { + "en": "SF7BW125" + }, + "enumValue": "SF7BW125", + "name": "SF7BW125" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF9BW125;1", + "displayName": { + "en": "SF9BW125" + }, + "enumValue": "SF9BW125", + "name": "SF9BW125" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF8BW500;1", + "displayName": { + "en": "SF8BW500" + }, + "enumValue": "SF8BW500", + "name": "SF8BW500" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF11BW500;1", + "displayName": { + "en": "SF11BW500" + }, + "enumValue": "SF11BW500", + "name": "SF11BW500" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF10BW500;1", + "displayName": { + "en": "SF10BW500" + }, + "enumValue": "SF10BW500", + "name": "SF10BW500" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX2DataRate:schema:SF9BW500;1", + "displayName": { + "en": "SF9BW500" + }, + "enumValue": "SF9BW500", + "name": "SF9BW500" + } + ], + "valueSchema": "string" + }, + "writable": true + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:tmst;1", + "@type": "Telemetry", + "description": { + "en": "Internal timestamp of \"RX finished\" event (32b unsigned)" + }, + "displayName": { + "en": "TimeStamp" + }, + "name": "tmst", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:time;1", + "@type": "Telemetry", + "description": { + "en": "UTC time of pkt RX, us precision, ISO 8601 'compact' format" + }, + "displayName": { + "en": "Time" + }, + "name": "time", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:tmms;1", + "@type": "Telemetry", + "description": { + "en": "GPS time of pkt RX, number of milliseconds since 06.Jan.1980" + }, + "displayName": { + "en": "GPS Time" + }, + "name": "tmms", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:freq;1", + "@type": [ + "Telemetry", + "Frequency" + ], + "description": { + "en": "RX central frequency in MHz (unsigned float, Hz precision)" + }, + "displayName": { + "en": "Frequency" + }, + "name": "freq", + "schema": "float", + "unit": "megahertz" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:chan;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"IF\" channel used for RX (unsigned integer)" + }, + "displayName": { + "en": "Channel" + }, + "name": "chan", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:rfch;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"RF chain\" used for RX (unsigned integer)" + }, + "displayName": { + "en": "RF Chain" + }, + "name": "rfch", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:stat;1", + "@type": "Telemetry", + "description": { + "en": " CRC status: 1 = OK, -1 = fail, 0 = no CRC" + }, + "displayName": { + "en": "Status" + }, + "name": "stat", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:datr;1", + "@type": "Telemetry", + "description": { + "en": "LoRa datarate identifier (eg. SF12BW500)" + }, + "displayName": { + "en": "Data Rate" + }, + "name": "datr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:codr;1", + "@type": "Telemetry", + "description": { + "en": "FSK datarate (unsigned, in bits per second)" + }, + "displayName": { + "en": "Coding Rate" + }, + "name": "codr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:rssi;1", + "@type": "Telemetry", + "description": { + "en": "RSSI in dBm (signed integer, 1 dB precision)" + }, + "displayName": { + "en": "RSSI" + }, + "name": "rssi", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:lsnr;1", + "@type": "Telemetry", + "description": { + "en": "Lora SNR ratio in dB (signed float, 0.1 dB precision)" + }, + "displayName": { + "en": "LSNR" + }, + "name": "lsnr", + "schema": "double" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:size;1", + "@type": "Telemetry", + "description": { + "en": "RF packet payload size in bytes (unsigned integer)" + }, + "displayName": { + "en": "RF Size" + }, + "name": "size", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:modu;1", + "@type": "Telemetry", + "description": { + "en": "Modulation identifier \"LORA\" or \"FSK\"" + }, + "displayName": { + "en": "Modulation" + }, + "name": "modu", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:rawdata;1", + "@type": "Telemetry", + "displayName": { + "en": "Raw Data" + }, + "name": "rawdata", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:fcnt;1", + "@type": "Telemetry", + "displayName": { + "en": "Frame Counter" + }, + "name": "fcnt", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:port;1", + "@type": "Telemetry", + "displayName": { + "en": "Port" + }, + "name": "port", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:gatewayid;1", + "@type": "Telemetry", + "displayName": { + "en": "Gateway ID" + }, + "name": "gatewayid", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:edgets;1", + "@type": "Telemetry", + "displayName": { + "en": "Edge TimeStamp" + }, + "name": "edgets", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:AppSKey;1", + "@type": "Property", + "displayName": { + "en": "AppSKey" + }, + "name": "AppSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:NwkSKey;1", + "@type": "Property", + "displayName": { + "en": "NwkSKey" + }, + "name": "NwkSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:DevAddr;1", + "@type": "Property", + "displayName": { + "en": "DevAddr" + }, + "name": "DevAddr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:FCntDown;1", + "@type": "Property", + "displayName": { + "en": "FCntDown" + }, + "name": "FCntDown", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:FCntUp;1", + "@type": "Property", + "displayName": { + "en": "FCntUp" + }, + "name": "FCntUp", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:DevEUI;1", + "@type": "Property", + "displayName": { + "en": "DevEUI" + }, + "name": "DevEUI", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:NetId;1", + "@type": "Property", + "displayName": { + "en": "NetId" + }, + "name": "NetId", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:DevNonce;1", + "@type": "Property", + "displayName": { + "en": "DevNonce" + }, + "name": "DevNonce", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RX1DROffset;1", + "@type": "Property", + "displayName": { + "en": "RX1DROffset" + }, + "name": "RX1DROffset", + "schema": "string" + }, + { + "@id": "dtmi:watteco:THr:LoRaDevice:RXDelay;1", + "@type": "Property", + "displayName": { + "en": "RXDelay" + }, + "name": "RXDelay", + "schema": "string" + } + ], + "displayName": { + "en": "LoRa Interface" + }, + "name": "LoRa" + } +] \ No newline at end of file diff --git a/dtdl/Watteco - VAQA'O Sensor (50-70-168).json b/dtdl/Watteco - VAQA'O Sensor (50-70-168).json new file mode 100644 index 0000000..5d798e4 --- /dev/null +++ b/dtdl/Watteco - VAQA'O Sensor (50-70-168).json @@ -0,0 +1,614 @@ +[ + { + "@id": "dtmi:watteco:vaqaoplus;1", + "@type": "Interface", + "contents": [ + { + "@id": "dtmi:watteco:vaqaoplus:data;1", + "@type": "Telemetry", + "comment": "VaqaO Sensors data", + "displayName": { + "en": "data" + }, + "name": "data", + "schema": { + "@id": "dtmi:watteco:vaqaoplus:data:schema;1", + "@type": "Object", + "displayName": { + "en": "Object" + }, + "fields": [ + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Temperature;1", + "displayName": { + "en": "Temperature" + }, + "name": "Temperature", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:RelativeHumidity;1", + "displayName": { + "en": "RelativeHumidity" + }, + "name": "RelativeHumidity", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:CO2;1", + "displayName": { + "en": "CO2" + }, + "name": "CO2", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:COV;1", + "displayName": { + "en": "COV" + }, + "name": "COV", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:LUX;1", + "displayName": { + "en": "LUX" + }, + "name": "LUX", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Pressure;1", + "displayName": { + "en": "Pressure" + }, + "name": "Pressure", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Occupancy;1", + "displayName": { + "en": "Occupancy" + }, + "name": "Occupancy", + "schema": { + "@type": "Enum", + "enumValues": [ + { + "displayName": { + "en": "Occupied" + }, + "enumValue": 1, + "name": "Occupied" + }, + { + "displayName": { + "en": "Vacant" + }, + "enumValue": 0, + "name": "Vacant" + } + ], + "valueSchema": "integer" + } + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Configuration;1", + "displayName": { + "en": "Configuration" + }, + "name": "Configuration", + "schema": { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Configuration:schema;1", + "@type": "Object", + "fields": [ + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Configuration:schema:CurrentPowerMode;1", + "displayName": { + "en": "CurrentPowerMode" + }, + "name": "CurrentPowerMode", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Configuration:schema:AvailablePowerSourceBitField;1", + "displayName": { + "en": "AvailablePowerSourceBitField" + }, + "name": "AvailablePowerSourceBitField", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Configuration:schema:DisposableBatteryVoltage;1", + "displayName": { + "en": "DisposableBatteryVoltage" + }, + "name": "DisposableBatteryVoltage", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:data:schema:Configuration:schema:CurrentPowerSource;1", + "displayName": { + "en": "CurrentPowerSource" + }, + "name": "CurrentPowerSource", + "schema": "string" + } + ] + } + } + ] + } + } + ], + "extends": [ + "dtmi:watteco:vaqaoplus:LoRaDevice;1" + ], + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ] + }, + { + "@context": [ + "dtmi:iotcentral:context;2", + "dtmi:dtdl:context;2" + ], + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice;1", + "@type": [ + "Interface", + "NamedInterface" + ], + "contents": [ + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:AppEUI;1", + "@type": "Property", + "description": { + "en": "This is the unique ID of the Application server." + }, + "displayName": { + "en": "AppEUI" + }, + "name": "AppEUI", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:AppKey;1", + "@type": "Property", + "description": { + "en": "The data encryption key used to \"encode\" the messages between the end nodes and the Application Server" + }, + "displayName": { + "en": "AppKey" + }, + "name": "AppKey", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:SensorDecoder;1", + "@type": "Property", + "description": { + "en": "The name of an integrated decoder function or the URI to a decoder in a custom decoder module in the format: http://modulename/api/decodername." + }, + "displayName": { + "en": "SensorDecoder" + }, + "name": "SensorDecoder", + "schema": "string", + "writable": true + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate;1", + "@type": "Property", + "description": { + "en": "Rx2DataRate (Receive window 2 data rate, currently only supported for OTAA devices): Any of the allowed data rates." + }, + "displayName": { + "en": "RX2DataRate" + }, + "name": "RX2DataRate", + "schema": { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema;1", + "@type": "Enum", + "displayName": { + "en": "Enum" + }, + "enumValues": [ + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF12BW125;1", + "displayName": { + "en": "SF12BW125" + }, + "enumValue": "SF12BW125", + "name": "SF12BW125" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF11BW125;1", + "displayName": { + "en": "SF11BW125" + }, + "enumValue": "SF11BW125", + "name": "SF11BW125" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF10BW125;1", + "displayName": { + "en": "SF10BW125" + }, + "enumValue": "SF10BW125", + "name": "SF10BW125" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF8BW125;1", + "displayName": { + "en": "SF8BW125" + }, + "enumValue": "SF8BW125", + "name": "SF8BW125" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF7BW250;1", + "displayName": { + "en": "SF7BW250" + }, + "enumValue": "SF7BW250", + "name": "SF7BW250" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF7BW125;1", + "displayName": { + "en": "SF7BW125" + }, + "enumValue": "SF7BW125", + "name": "SF7BW125" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF9BW125;1", + "displayName": { + "en": "SF9BW125" + }, + "enumValue": "SF9BW125", + "name": "SF9BW125" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF8BW500;1", + "displayName": { + "en": "SF8BW500" + }, + "enumValue": "SF8BW500", + "name": "SF8BW500" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF11BW500;1", + "displayName": { + "en": "SF11BW500" + }, + "enumValue": "SF11BW500", + "name": "SF11BW500" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF10BW500;1", + "displayName": { + "en": "SF10BW500" + }, + "enumValue": "SF10BW500", + "name": "SF10BW500" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX2DataRate:schema:SF9BW500;1", + "displayName": { + "en": "SF9BW500" + }, + "enumValue": "SF9BW500", + "name": "SF9BW500" + } + ], + "valueSchema": "string" + }, + "writable": true + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:tmst;1", + "@type": "Telemetry", + "description": { + "en": "Internal timestamp of \"RX finished\" event (32b unsigned)" + }, + "displayName": { + "en": "TimeStamp" + }, + "name": "tmst", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:time;1", + "@type": "Telemetry", + "description": { + "en": "UTC time of pkt RX, us precision, ISO 8601 'compact' format" + }, + "displayName": { + "en": "Time" + }, + "name": "time", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:tmms;1", + "@type": "Telemetry", + "description": { + "en": "GPS time of pkt RX, number of milliseconds since 06.Jan.1980" + }, + "displayName": { + "en": "GPS Time" + }, + "name": "tmms", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:freq;1", + "@type": [ + "Telemetry", + "Frequency" + ], + "description": { + "en": "RX central frequency in MHz (unsigned float, Hz precision)" + }, + "displayName": { + "en": "Frequency" + }, + "name": "freq", + "schema": "float", + "unit": "megahertz" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:chan;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"IF\" channel used for RX (unsigned integer)" + }, + "displayName": { + "en": "Channel" + }, + "name": "chan", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:rfch;1", + "@type": "Telemetry", + "description": { + "en": "Concentrator \"RF chain\" used for RX (unsigned integer)" + }, + "displayName": { + "en": "RF Chain" + }, + "name": "rfch", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:stat;1", + "@type": "Telemetry", + "description": { + "en": " CRC status: 1 = OK, -1 = fail, 0 = no CRC" + }, + "displayName": { + "en": "Status" + }, + "name": "stat", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:datr;1", + "@type": "Telemetry", + "description": { + "en": "LoRa datarate identifier (eg. SF12BW500)" + }, + "displayName": { + "en": "Data Rate" + }, + "name": "datr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:codr;1", + "@type": "Telemetry", + "description": { + "en": "FSK datarate (unsigned, in bits per second)" + }, + "displayName": { + "en": "Coding Rate" + }, + "name": "codr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:rssi;1", + "@type": "Telemetry", + "description": { + "en": "RSSI in dBm (signed integer, 1 dB precision)" + }, + "displayName": { + "en": "RSSI" + }, + "name": "rssi", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:lsnr;1", + "@type": "Telemetry", + "description": { + "en": "Lora SNR ratio in dB (signed float, 0.1 dB precision)" + }, + "displayName": { + "en": "LSNR" + }, + "name": "lsnr", + "schema": "double" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:size;1", + "@type": "Telemetry", + "description": { + "en": "RF packet payload size in bytes (unsigned integer)" + }, + "displayName": { + "en": "RF Size" + }, + "name": "size", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:modu;1", + "@type": "Telemetry", + "description": { + "en": "Modulation identifier \"LORA\" or \"FSK\"" + }, + "displayName": { + "en": "Modulation" + }, + "name": "modu", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:rawdata;1", + "@type": "Telemetry", + "displayName": { + "en": "Raw Data" + }, + "name": "rawdata", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:fcnt;1", + "@type": "Telemetry", + "displayName": { + "en": "Frame Counter" + }, + "name": "fcnt", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:port;1", + "@type": "Telemetry", + "displayName": { + "en": "Port" + }, + "name": "port", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:gatewayid;1", + "@type": "Telemetry", + "displayName": { + "en": "Gateway ID" + }, + "name": "gatewayid", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:edgets;1", + "@type": "Telemetry", + "displayName": { + "en": "Edge TimeStamp" + }, + "name": "edgets", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:AppSKey;1", + "@type": "Property", + "displayName": { + "en": "AppSKey" + }, + "name": "AppSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:NwkSKey;1", + "@type": "Property", + "displayName": { + "en": "NwkSKey" + }, + "name": "NwkSKey", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:DevAddr;1", + "@type": "Property", + "displayName": { + "en": "DevAddr" + }, + "name": "DevAddr", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:FCntDown;1", + "@type": "Property", + "displayName": { + "en": "FCntDown" + }, + "name": "FCntDown", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:FCntUp;1", + "@type": "Property", + "displayName": { + "en": "FCntUp" + }, + "name": "FCntUp", + "schema": "integer" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:DevEUI;1", + "@type": "Property", + "displayName": { + "en": "DevEUI" + }, + "name": "DevEUI", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:NetId;1", + "@type": "Property", + "displayName": { + "en": "NetId" + }, + "name": "NetId", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:DevNonce;1", + "@type": "Property", + "displayName": { + "en": "DevNonce" + }, + "name": "DevNonce", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RX1DROffset;1", + "@type": "Property", + "displayName": { + "en": "RX1DROffset" + }, + "name": "RX1DROffset", + "schema": "string" + }, + { + "@id": "dtmi:watteco:vaqaoplus:LoRaDevice:RXDelay;1", + "@type": "Property", + "displayName": { + "en": "RXDelay" + }, + "name": "RXDelay", + "schema": "string" + } + ], + "displayName": { + "en": "LoRa Interface" + }, + "name": "LoRa" + } +] \ No newline at end of file diff --git a/dtdl/Watecco - VAQA'O Sensor (50-70-168).png b/dtdl/Watteco - VAQA'O Sensor (50-70-168).png similarity index 100% rename from dtdl/Watecco - VAQA'O Sensor (50-70-168).png rename to dtdl/Watteco - VAQA'O Sensor (50-70-168).png diff --git a/src/modules/WattecoDecoderModule/Batch b/src/modules/WattecoDecoderModule/Batch new file mode 160000 index 0000000..9ea0a36 --- /dev/null +++ b/src/modules/WattecoDecoderModule/Batch @@ -0,0 +1 @@ +Subproject commit 9ea0a36e4f60a4fc0aef7c4ed6bcb9b3407bc3d9 diff --git a/src/modules/WattecoDecoderModule/Codec-Report-Batch-Python b/src/modules/WattecoDecoderModule/Codec-Report-Batch-Python deleted file mode 160000 index 1a62868..0000000 --- a/src/modules/WattecoDecoderModule/Codec-Report-Batch-Python +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1a62868de60254c25f16340f47e88484b46bc383 diff --git a/src/modules/WattecoDecoderModule/Codec-Report-Standard-Python b/src/modules/WattecoDecoderModule/Codec-Report-Standard-Python deleted file mode 160000 index d56dbee..0000000 --- a/src/modules/WattecoDecoderModule/Codec-Report-Standard-Python +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d56dbee7e8629462ae241e38be6113a889a6d954 diff --git a/src/modules/WattecoDecoderModule/Dockerfile.amd64 b/src/modules/WattecoDecoderModule/Dockerfile.amd64 index 8ad8326..cd565fb 100644 --- a/src/modules/WattecoDecoderModule/Dockerfile.amd64 +++ b/src/modules/WattecoDecoderModule/Dockerfile.amd64 @@ -2,27 +2,24 @@ FROM busybox as builder WORKDIR /src -COPY ./Codec-Report-Standard-Python/srcWatteco/* ./Codec/Standard/ -COPY ./Codec-Report-Batch-Python/br_uncompress.py ./Codec/Batch/ -COPY ./Codec-Report-Batch-Python/constants.py ./Codec/Batch/ -COPY ./requirements.txt . +COPY . . -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/Decoding_Functions.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL_FRAME.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL.py -RUN sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Codec/Standard/ZCL.py -RUN sed -i 's/import constants/from . import constants/' ./Codec/Batch/br_uncompress.py - -COPY ./main.py . +RUN chmod +x replaceCodecImports.sh && ./replaceCodecImports.sh FROM amd64/python:3.7-slim-buster EXPOSE 80 -WORKDIR / +WORKDIR /app + +COPY --from=builder /src/Batch/ ./Batch/ +COPY --from=builder /src/Standard/ ./Standard/ -COPY --from=builder /src/* /app/ +COPY --from=builder /src/main.py ./ +COPY --from=builder /src/requirements.txt ./ -RUN pip install -r /app/requirements.txt +RUN pip install -r requirements.txt + +WORKDIR / CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/Dockerfile.amd64.debug b/src/modules/WattecoDecoderModule/Dockerfile.amd64.debug index 1981002..c9a3815 100644 --- a/src/modules/WattecoDecoderModule/Dockerfile.amd64.debug +++ b/src/modules/WattecoDecoderModule/Dockerfile.amd64.debug @@ -2,28 +2,25 @@ FROM busybox as builder WORKDIR /src -COPY ./Codec-Report-Standard-Python/srcWatteco/* ./Codec/Standard/ -COPY ./Codec-Report-Batch-Python/br_uncompress.py ./Codec/Batch/ -COPY ./Codec-Report-Batch-Python/constants.py ./Codec/Batch/ -COPY ./requirements.txt . +COPY . . -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/Decoding_Functions.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL_FRAME.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL.py -RUN sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Codec/Standard/ZCL.py -RUN sed -i 's/import constants/from . import constants/' ./Codec/Batch/br_uncompress.py - -COPY ./main.py . +RUN chmod +x replaceCodecImports.sh && ./replaceCodecImports.sh FROM amd64/python:3.7-slim-buster EXPOSE 80 -WORKDIR / +WORKDIR /app + +COPY --from=builder /src/Batch/ ./Batch/ +COPY --from=builder /src/Standard/ ./Standard/ -COPY --from=builder /src/* /app/ +COPY --from=builder /src/main.py ./ +COPY --from=builder /src/requirements.txt ./ RUN pip install ptvsd==4.1.3 -RUN pip install -r /app/requirements.txt +RUN pip install -r requirements.txt + +WORKDIR / CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/Dockerfile.arm32v7 b/src/modules/WattecoDecoderModule/Dockerfile.arm32v7 index 08e9fdc..c8c8070 100644 --- a/src/modules/WattecoDecoderModule/Dockerfile.arm32v7 +++ b/src/modules/WattecoDecoderModule/Dockerfile.arm32v7 @@ -2,27 +2,23 @@ FROM busybox as builder WORKDIR /src -COPY ./Codec-Report-Standard-Python/srcWatteco/* ./Codec/Standard/ -COPY ./Codec-Report-Batch-Python/br_uncompress.py ./Codec/Batch/ -COPY ./Codec-Report-Batch-Python/constants.py ./Codec/Batch/ -COPY ./requirements.txt . - -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/Decoding_Functions.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL_FRAME.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL.py -RUN sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Codec/Standard/ZCL.py -RUN sed -i 's/import constants/from . import constants/' ./Codec/Batch/br_uncompress.py - -COPY ./main.py . +COPY . . +RUN chmod +x replaceCodecImports.sh && ./replaceCodecImports.sh FROM arm32v7/python:3.7-slim-buster EXPOSE 80 -WORKDIR / +WORKDIR /app -COPY --from=builder /src/* /app/ +COPY --from=builder /src/Batch/ ./Batch/ +COPY --from=builder /src/Standard/ ./Standard/ -RUN pip install -r /app/requirements.txt +COPY --from=builder /src/main.py ./ +COPY --from=builder /src/requirements.txt ./ + +RUN pip install -r requirements.txt + +WORKDIR / CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/Dockerfile.arm32v7.debug b/src/modules/WattecoDecoderModule/Dockerfile.arm32v7.debug index e9a2eb7..f51d930 100644 --- a/src/modules/WattecoDecoderModule/Dockerfile.arm32v7.debug +++ b/src/modules/WattecoDecoderModule/Dockerfile.arm32v7.debug @@ -2,28 +2,25 @@ FROM busybox as builder WORKDIR /src -COPY ./Codec-Report-Standard-Python/srcWatteco/* ./Codec/Standard/ -COPY ./Codec-Report-Batch-Python/br_uncompress.py ./Codec/Batch/ -COPY ./Codec-Report-Batch-Python/constants.py ./Codec/Batch/ -COPY ./requirements.txt . +COPY . . -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/Decoding_Functions.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL_FRAME.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL.py -RUN sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Codec/Standard/ZCL.py -RUN sed -i 's/import constants/from . import constants/' ./Codec/Batch/br_uncompress.py - -COPY ./main.py . +RUN chmod +x replaceCodecImports.sh && ./replaceCodecImports.sh FROM arm32v7/python:3.7-slim-buster EXPOSE 80 -WORKDIR / +WORKDIR /app + +COPY --from=builder /src/Batch/ ./Batch/ +COPY --from=builder /src/Standard/ ./Standard/ -COPY --from=builder /src/* /app/ +COPY --from=builder /src/main.py ./ +COPY --from=builder /src/requirements.txt ./ RUN pip install ptvsd==4.1.3 -RUN pip install -r /app/requirements.txt +RUN pip install -r requirements.txt + +WORKDIR / CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/Dockerfile.arm64v8 b/src/modules/WattecoDecoderModule/Dockerfile.arm64v8 index f21bb33..b8f9064 100644 --- a/src/modules/WattecoDecoderModule/Dockerfile.arm64v8 +++ b/src/modules/WattecoDecoderModule/Dockerfile.arm64v8 @@ -2,27 +2,24 @@ FROM busybox as builder WORKDIR /src -COPY ./Codec-Report-Standard-Python/srcWatteco/* ./Codec/Standard/ -COPY ./Codec-Report-Batch-Python/br_uncompress.py ./Codec/Batch/ -COPY ./Codec-Report-Batch-Python/constants.py ./Codec/Batch/ -COPY ./requirements.txt . +COPY . . -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/Decoding_Functions.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL_FRAME.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL.py -RUN sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Codec/Standard/ZCL.py -RUN sed -i 's/import constants/from . import constants/' ./Codec/Batch/br_uncompress.py - -COPY ./main.py . +RUN chmod +x replaceCodecImports.sh && ./replaceCodecImports.sh FROM arm64v8/python:3.7-slim-buster EXPOSE 80 -WORKDIR / +WORKDIR /app + +COPY --from=builder /src/Batch/ ./Batch/ +COPY --from=builder /src/Standard/ ./Standard/ -COPY --from=builder /src/* /app/ +COPY --from=builder /src/main.py ./ +COPY --from=builder /src/requirements.txt ./ -RUN pip install -r /app/requirements.txt +RUN pip install -r requirements.txt + +WORKDIR / CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/Dockerfile.arm64v8.debug b/src/modules/WattecoDecoderModule/Dockerfile.arm64v8.debug index 1028126..4e5ebd5 100644 --- a/src/modules/WattecoDecoderModule/Dockerfile.arm64v8.debug +++ b/src/modules/WattecoDecoderModule/Dockerfile.arm64v8.debug @@ -2,28 +2,25 @@ FROM busybox as builder WORKDIR /src -COPY ./Codec-Report-Standard-Python/srcWatteco/* ./Codec/Standard/ -COPY ./Codec-Report-Batch-Python/br_uncompress.py ./Codec/Batch/ -COPY ./Codec-Report-Batch-Python/constants.py ./Codec/Batch/ -COPY ./requirements.txt . +COPY . . -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/Decoding_Functions.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL_FRAME.py -RUN sed -i 's/from ZCL/from .ZCL/' ./Codec/Standard/ZCL.py -RUN sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Codec/Standard/ZCL.py -RUN sed -i 's/import constants/from . import constants/' ./Codec/Batch/br_uncompress.py - -COPY ./main.py . +RUN chmod +x replaceCodecImports.sh && ./replaceCodecImports.sh FROM arm64v8/python:3.7-slim-buster EXPOSE 80 -WORKDIR / +WORKDIR /app + +COPY --from=builder /src/Batch/ ./Batch/ +COPY --from=builder /src/Standard/ ./Standard/ -COPY --from=builder /src/* /app/ +COPY --from=builder /src/main.py ./ +COPY --from=builder /src/requirements.txt ./ RUN pip install ptvsd==4.1.3 -RUN pip install -r /app/requirements.txt +RUN pip install -r requirements.txt + +WORKDIR / CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/Standard b/src/modules/WattecoDecoderModule/Standard new file mode 160000 index 0000000..44c1d62 --- /dev/null +++ b/src/modules/WattecoDecoderModule/Standard @@ -0,0 +1 @@ +Subproject commit 44c1d62e75c03b5b2010b0e2323366fdc9b01f5f diff --git a/src/modules/WattecoDecoderModule/__init__.py b/src/modules/WattecoDecoderModule/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/WattecoDecoderModule/main.py b/src/modules/WattecoDecoderModule/main.py index cc0b1c0..bc0b7d6 100644 --- a/src/modules/WattecoDecoderModule/main.py +++ b/src/modules/WattecoDecoderModule/main.py @@ -7,7 +7,7 @@ from fastapi import FastAPI from datetime import datetime -from .Standard.Decoding_Functions import Decoding_JSON, version +from .Standard.srcWatteco.Decoding_Functions import Decoding_JSON, version from .Batch import br_uncompress from .Batch.br_uncompress import hex_to_array @@ -15,7 +15,6 @@ def parseFor(tagz: int, commands, payload: str): splited_commands=br_uncompress.split_commands(commands) - print(splited_commands) inputData = base64.b64decode(payload).hex() @@ -44,24 +43,7 @@ def parseFor(tagz: int, commands, payload: str): def parseUnitaryFrame(payload: str): inputData = base64.b64decode(payload).hex() - frame = json.loads(Decoding_JSON(inputData, False)) - - result = {} - result[frame['ClusterID']] = frame['Data'] - - if (frame['AttributeID'] == "NodePowerDescriptor"): - result[frame['ClusterID']]['DisposableBatteryVoltage'] = result[frame['ClusterID']]['DisposableBatteryVoltage'] / 1000 - - if (frame['AttributeID'] == "Occupancy"): - occupancy = 0; - for item in frame['Data']: - print (item) - if frame['Data'][item] == 1: - occupancy = 1 - - result['Occupancy'] = occupancy - - return result + return json.loads(Decoding_JSON(inputData, False)) @app.get("/api/stdframe") def S0Decoder(devEUI: str, payload: str, fport: int): @@ -69,15 +51,57 @@ def S0Decoder(devEUI: str, payload: str, fport: int): @app.get("/api/s0") def S0Decoder(devEUI: str, payload: str, fport: int): - return parseFor(1, ['0,1,10,Index1', '1,100,6,BatteryLevel'], payload) + result = parseFor(1, ['0,1,10,Pulse', '1,100,6,DisposableBatteryVoltage'], payload) + + if 'CommandID' in result and result['CommandID'] == 'ReportAttributes': + if result['AttributeID'] == 'PresentValue': + return { + 'State': result['Data'] + } + if result['AttributeID'] == 'Count': + return { + 'Pulse': result['Data'] + } + else: + result['DisposableBatteryVoltage'] = result['DisposableBatteryVoltage'] / 1000 + return result @app.get("/api/thr") def THRDecoder(devEUI: str, payload: str, fport: int): - return parseFor(3, ['0,10,7,Temperature', '1,100,6,RelativeHumidity', ' 2,10,12,Luminosity', '3,100,6,Disposable_BatteryLevel', '4,100,6,Rechargeable_BatteryLevel'], payload) + result = parseFor(3, ['0,10,7,Temperature', '1,100,6,RelativeHumidity', ' 2,10,12,Illuminance', '3,100,6,DisposableBatteryVoltage', '4,100,6,RechargeableBatteryVoltage'], payload) + + if 'AnalogInput' in result.keys(): + result['Illuminance'] = result.pop('AnalogInput') + result['DisposableBatteryVoltage'] = result['DisposableBatteryVoltage'] / 1000 + result['RechargeableBatteryVoltage'] = result['RechargeableBatteryVoltage'] / 1000 + + return result @app.get("/api/senso") def SensoDecoder(devEUI: str, payload: str, fport: int): - return parseFor(3, ['0,1,4,Status', '1,1,11,Index', '2,1,5,MinFlow', '3,1,5,MaxFlow'], payload) + result = parseFor(1, ['0,1,11,Volume', '1,100,6,DisposableBatteryVoltage'], payload) + + if 'CommandID' in result and result['CommandID'] == 'ReportAttributes': + if result['AttributeID'] == 'Volume': + return { + 'Volume': result['Data'] + } + if result['AttributeID'] == 'Status': + return { + 'Status': { + 'Freeze': result['Data']['b7'], + 'Installation': result['Data']['b6'], + 'Battery': result['Data']['b5'], + 'Fraud': result['Data']['b4'], + 'BackWaterLevel3': result['Data']['b3'], + 'BackWaterLevel2': result['Data']['b2'], + 'BackWaterLevel1': result['Data']['b1'], + 'Leak': result['Data']['b0'] + } + } + else: + result['DisposableBatteryVoltage'] = result['DisposableBatteryVoltage'] / 1000 + return result @app.get("/api/pulsesenso") def PulseSensoDecoder(devEUI: str, payload: str, fport: int): @@ -85,7 +109,22 @@ def PulseSensoDecoder(devEUI: str, payload: str, fport: int): @app.get("/api/presso") def PressoDecoder(devEUI: str, payload: str, fport: int): - return parseFor(3, ['0,0.004,12,4-20mA', '1,1,12,0-10V', '2,100,6,BatteryLevel', '3,100,6,ExtPowerLevel', '4,1,10,Index'], payload) + result = parseFor(3, ['0,0.004,12,mA', '1,1,12,V', '2,100,6,BatteryLevel', '3,100,6,ExtPowerLevel', '4,1,10,Index'], payload) + + if 'CommandID' in result and result['CommandID'] == 'ReportAttributes': + if result['AttributeID'] == 'PresentValue' and result['EndPoint'] == 0: + return { + 'mA': result['Data'] + } + if result['AttributeID'] == 'PresentValue' and result['EndPoint'] == 1: + return { + 'V': result['Data'] / 1000 + } + + result['BatteryLevel'] = result['BatteryLevel'] / 1000 + result['V'] = result['V'] / 1000 + + return result @app.get("/remotetemperature") def RemoteTemperatureDecoder(devEUI: str, payload: str, fport: int): @@ -109,7 +148,12 @@ def TDecoder(devEUI: str, payload: str, fport: int): @app.get("/api/atmo") def AtmoDecoder(devEUI: str, payload: str, fport: int): - return parseFor(3, ['0,1,7,Temperature', '1,1,6,RelativeHumidity', '2,1,7,Pressure', '3,1,10,Index1', '4,1,10,Index2', '5,1,6,BatteryLevel'], payload) + result = parseFor(3, ['0,1,7,Temperature', '1,1,6,RelativeHumidity', '2,1,7,Pressure', '3,1,10,Index1', '4,1,10,Index2', '5,1,6,BatteryLevel'], payload) + + result.pop('Index1') + result.pop('Index2') + + return result @app.get("/api/ventilo") def VentiloDecoder(devEUI: str, payload: str, fport: int): @@ -127,10 +171,12 @@ def PulseSensoAtexZ1Decoder(devEUI: str, payload: str, fport: int): def RemoteTemperature2CTNDecoder(devEUI: str, payload: str, fport: int): return parseFor(3, ['0,10,7,Temperature1', '1,10,7,Temperature2'], payload) -@app.get("/api/vaquao") +@app.get("/api/vaqao") def VAQAODecoder(devEUI: str, payload: str, fport: int): - return parseFor(3, ['1,10,7,Temperature' ,'2,100,6,RelativeHumidity', '3,10,6,CO2', '4,10,6,COV'], payload) + frame = parseFor(3, ['1,10,7,Temperature' ,'2,100,6,RelativeHumidity', '3,10,6,CO2', '4,10,6,COV'], payload) + return frame -@app.get("/api/vaquaoplus") +@app.get("/api/vaqaoplus") def VAQAOPlusDecoder(devEUI: str, payload: str, fport: int): - return parseFor(3, ['0,1,4,Occupancy', '1,10,7,Temperature', '2,100,6,RelativeHumidity', '3,10,6,CO2', '4,10,6,COV', '5,10,6,LUX', '6,10,6,Pressure'], payload) \ No newline at end of file + frame = parseFor(3, ['0,1,4,Occupancy', '1,10,7,Temperature', '2,100,6,RelativeHumidity', '3,10,6,CO2', '4,10,6,COV', '5,10,6,LUX', '6,10,6,Pressure'], payload) + return frame \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/replaceCodecImports.sh b/src/modules/WattecoDecoderModule/replaceCodecImports.sh new file mode 100644 index 0000000..1b50f50 --- /dev/null +++ b/src/modules/WattecoDecoderModule/replaceCodecImports.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +sed -i 's/from ZCL/from .ZCL/' ./Standard/srcWatteco/Decoding_Functions.py +sed -i 's/from ZCL/from .ZCL/' ./Standard/srcWatteco/ZCL_FRAME.py +sed -i 's/from ZCL/from .ZCL/' ./Standard/srcWatteco/ZCL.py +sed -i 's/from WTC_CodecTools/from .WTC_CodecTools/' ./Standard/srcWatteco/ZCL.py +sed -i 's/from TICs/from .TICs/' ./Standard/srcWatteco/ZCL.py +sed -i 's/from WTC_CodecTools/from ..WTC_CodecTools/' ./Standard/srcWatteco/TICs/_TIC_Tools.py +sed -i 's/import constants/from . import constants/' ./Batch/br_uncompress.py \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/requirements-dev.txt b/src/modules/WattecoDecoderModule/requirements-dev.txt new file mode 100644 index 0000000..32bf58f --- /dev/null +++ b/src/modules/WattecoDecoderModule/requirements-dev.txt @@ -0,0 +1,3 @@ +requests==2.26.0 +pytest==6.2.5 +pytest-cov==3.0.0 \ No newline at end of file diff --git a/src/modules/WattecoDecoderModule/test_main.py b/src/modules/WattecoDecoderModule/test_main.py new file mode 100644 index 0000000..b6c2f90 --- /dev/null +++ b/src/modules/WattecoDecoderModule/test_main.py @@ -0,0 +1,97 @@ +from fastapi.testclient import TestClient + +from .main import app + +client = TestClient(app) + +def test_vaqaoplus(): + response = client.get("/api/vaqaoplus?payload=cEQABqw8ABnA7s4BIGEpaCPjgWxsEdBJGyY%2B0d0bABSCAu1eqN2yDAAFtJuXArCAdsuyBigAOA%3D%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {"Occupancy":1,"Temperature":19.7,"RelativeHumidity":54.0,"CO2":690.0,"COV":50.0,"LUX":10,"Pressure":9790} + +def test_vaqao(): + response = client.get("/api/vaqao?payload=QjOAgKhPAR2g6ADckf2BU2j3QgYOUWgv%2BmYm%2BtaSFn1rSYu%2BmESxRVEUFXFoniAUmxk%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {"Temperature":19.6,"RelativeHumidity":30.0,"CO2":500.0,"COV":250.0} + +def test_thr(): + response = client.get("/api/thr?payload=UgAAgIGVBLDIPoIytA8CBQAI3hdwYxMAQBBAugbREiuK%2BSgM2REAgCIS&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {"Temperature":24.2,"RelativeHumidity":54.0,"Illuminance":320.0, "DisposableBatteryVoltage": 0, "RechargeableBatteryVoltage": 3.0} + +def test_s0(): + response = client.get("/api/s0?payload=EQoADwBVEAA%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + + assert json == {"State": False} + + response = client.get("/api/s0?payload=EQoADwQCIwAAAAE%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + + assert json == {"Pulse": 1} + + response = client.get("/api/s0?payload=JhUAIOBgAdceAACgZQ8%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {"Pulse": 45, "DisposableBatteryVoltage": 3.0} + +def test_senso(): + response = client.get("/api/senso?payload=EQqAAgAAKwAAAB0%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + + assert json == {"Volume": 29} + + response = client.get("/api/senso?payload=EQqAAwAAGGA%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + + assert json == { 'Status': { "Freeze": False, "Installation": True, 'Battery': True, 'Fraud': False, 'BackWaterLevel3': False, 'BackWaterLevel2': False, 'BackWaterLevel1': False, 'Leak': False }} + + response = client.get("/api/senso?payload=JhUAIOBgAdceAACgZQ8%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {'DisposableBatteryVoltage': 3.0, 'Volume': 45} + +def test_atmo(): + response = client.get("/api/atmo?payload=VgAAAAGTBNDsEyi0H6DfHgAAAIB7AAAAgAU%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {"Temperature":24.64,"RelativeHumidity":23.24,"Pressure":1012} + +def test_presso(): + response = client.get("/api/presso?payload=EQoADABVOUFQAAA%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + + assert json == {"mA":13.0} + + response = client.get("/api/presso?payload=MQoADABVOUYU0AA%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + + assert json == {"V":9.524} + + response = client.get("/api/presso?payload=IBUAgAH0ok5wgNLeAUISEPmuKVVAu2VpBA%3D%3D&devEUI=70B3D5E75E009F8F&fport=125") + assert response.status_code == 200 + json = response.json() + json.pop('timestamp') + + assert json == {"BatteryLevel":3.5,"V":7.52} \ No newline at end of file