Sign inSign up

weevenetwork/mcclimate-vicki-decoder

By weevenetwork

•Updated over 3 years ago

Decoder for McClimate Vicki Decoder.

Image
0

381

weevenetwork/mcclimate-vicki-decoder repository overview

⁠McClimate Vicki Decoder

NameMcClimate Vicki Decoder
Versionv1.0.0
GitHubweeve-modules/mcclimate-vicki-decoder⁠
AuthorsMesud Pasic

⁠Description

Decode Vicki LoRaWAN's payload into human-friendly format. You'll be able to retrieve:

  • Target Temperature

  • Measured temperature and humidity

  • motorPosition and motorRange

  • openWindow detection

  • ChildLock

  • High and Low Motor Consumption warning bytes

  • Temp and humidity sensor status byte - is it functional or broken

  • Battery voltage

  • Incoming payload looks like this

{
  "data": {
    "adr": true,
    "applicationID": "165",
    "applicationName": "101976551-101976576-",
    "confirmedUplink": false,
    "data": "AQBSAj8D/gM9Bw4FCwAAAAcNAA8AEgA=",
    "devAddr": "AHCcrA==",
    "devEUI": "70b3d52dd3003e30",
    "deviceName": "70B3D52DD3003E30",
    "dr": 5,
    "objectJSON": "",
    "rxInfo": [
      {
        "antenna": 0,
        "board": 263,
        "channel": 7,
        "context": "k3pa1A==",
        "crcStatus": "CRC_OK",
        "fineTimestampType": "NONE",
        "gatewayID": "cHb/AGQDBbc=",
        "loRaSNR": 7,
        "location": {
          "accuracy": 0,
          "altitude": 0,
          "latitude": 0,
          "longitude": 0,
          "source": "UNKNOWN"
        },
        "rfChain": 0,
        "rssi": -69,
        "time": "1647945089527",
        "timeSinceGPSEpoch": null,
        "uplinkID": "b0Gb7KexQnKNp42bxnYD1w=="
      }
    ],
    "tags": null,
    "txInfo": {
      "frequency": 868500000,
      "loRaModulationInfo": {
        "bandwidth": 125,
        "codeRate": "4/5",
        "polarizationInversion": false,
        "spreadingFactor": 7
      },
      "modulation": "LORA"
    },
    "fcnt": 6150,
    "fport": 5
  },
  "type": "up"
}
  • Decoded output passed to next module via POST call will look like this
{
   "data":{
      "adr":true,
      "applicationID":"165",
      "applicationName":"101976551-101976576-",
      "confirmedUplink":false,
      "data":{
         "reason":1,
         "targetTemperature":0,
         "sensorTemperature":12.8515625,
         "relativeHumidity":0.78125,
         "motorRange":3587,
         "motorPosition":3903,
         "batteryVoltage":2,
         "openWindow":false,
         "childLock":true,
         "highMotorConsumption":true,
         "lowMotorConsumption":true,
         "brokenSensor":true
      },
      "devAddr":"AHCcrA==",
      "devEUI":"70b3d52dd3003e30",
      "deviceName":"70B3D52DD3003E30",
      "dr":5,
      "objectJSON":"",
      "rxInfo":[
         {
            "antenna":0,
            "board":263,
            "channel":7,
            "context":"k3pa1A==",
            "crcStatus":"CRC_OK",
            "fineTimestampType":"NONE",
            "gatewayID":"cHb/AGQDBbc=",
            "loRaSNR":7,
            "location":{
               "accuracy":0,
               "altitude":0,
               "latitude":0,
               "longitude":0,
               "source":"UNKNOWN"
            },
            "rfChain":0,
            "rssi":-69,
            "time":"1647945089527",
            "timeSinceGPSEpoch":null,
            "uplinkID":"b0Gb7KexQnKNp42bxnYD1w=="
         }
      ],
      "tags":null,
      "txInfo":{
         "frequency":868500000,
         "loRaModulationInfo":{
            "bandwidth":125,
            "codeRate":"4/5",
            "polarizationInversion":false,
            "spreadingFactor":7
         },
         "modulation":"LORA"
      },
      "fcnt":6150,
      "fport":5
   },
   "type":"up"
}
  • Depending on environment variables NESTED_RESPONSE & CUSTOM_FIELDS out can be nestd with few fields or with all fields in "data" property, for example:
    • when nested without custom fields
{
  timestamp: '1647945089527',
  devEUI: '70b3d52dd3003e30',
  deviceName: '70B3D52DD3003E30',
  data: {
    reason: 1,
    targetTemperature: 0,
    sensorTemperature: 12.8515625,
    relativeHumidity: 0.78125,
    motorRange: 3587,
    motorPosition: 3903,
    batteryVoltage: 2,
    openWindow: false,
    childLock: true,
    highMotorConsumption: true,
    lowMotorConsumption: true,
    brokenSensor: true
  }
}
    • when nested with custom fields
{
  timestamp: '1647945089527',
  devEUI: '70b3d52dd3003e30',
  deviceName: '70B3D52DD3003E30',
  data: {
    targetTemperature: 0,
  }
}
    • when not nested without custom fields
{
  timestamp: '1647945089527',
  devEUI: '70b3d52dd3003e30',
  deviceName: '70B3D52DD3003E30',
  reason: 1,
  targetTemperature: 0,
  sensorTemperature: 12.8515625,
  relativeHumidity: 0.78125,
  motorRange: 3587,
  motorPosition: 3903,
  batteryVoltage: 2,
  openWindow: false,
  childLock: true,
  highMotorConsumption: true,
  lowMotorConsumption: true,
  brokenSensor: true
}
    • when nested without custom fields
{
  timestamp: '1647945089527',
  devEUI: '70b3d52dd3003e30',
  deviceName: '70B3D52DD3003E30',
  data: {
    reason: 1,
    targetTemperature: 0,
    sensorTemperature: 12.8515625,
    relativeHumidity: 0.78125,
    motorRange: 3587,
    motorPosition: 3903,
    batteryVoltage: 2,
    openWindow: false,
    childLock: true,
    highMotorConsumption: true,
    lowMotorConsumption: true,
    brokenSensor: true
  }
}
    • when nested with custom fields
{
  timestamp: '1647945089527',
  devEUI: '70b3d52dd3003e30',
  deviceName: '70B3D52DD3003E30',
  data: {
    targetTemperature: 0,
  }
}

⁠Features

  • Parsing Melita.io data for thermostat
  • Sends data to next module service via REST API

⁠Environment Variables

Environment VariablestypeDescription
NESTED_RESPONSEstringyes/no enum type, determines if sensor "date" property will be passed in data property or if properties will be extracted as single items and passed with rest of the payload
CUSTOM_FIELDSstringcomma separated names of fields that user wants to pass to next module, if ommited, all fields from "data" property will be passed
⁠Module Specific
⁠Set by the weeve Agent on the edge-node
Environment VariablestypeDescription
MODULE_NAMEstringName of the module
MODULE_TYPEstringType of the module (Input, Processing, Output)
INGRESS_HOSTstringHost where app is running
INGRESS_PORTstringPort where app is running
EGRESS_URLSstringHTTP ReST endpoint for the next module

⁠Dependencies

"dependencies": {
    "body-parser": "^1.19.2",
    "express": "^4.17.3",
    "express-winston": "^4.2.0",
    "node-fetch": "^2.6.1",
    "winston": "^3.6.0"
}

Tag summary

Content type

Image

Digest

sha256:da90effc3…

Size

87.3 MB

Last updated

over 3 years ago

docker pull weevenetwork/mcclimate-vicki-decoder:v1.0.0