Application data decoder service

In this guide we will show how to decode data coming fromyour devices (only for supported devices) and to forward them to an application endpoint of your choice.

Capabilities

The application data decoder is capable of decoding data coming from supported devices and to forward the decoded data to your application endpoint.

How to set up your iotcreators project

This data decoder, from the iotcreators project perspective is seen as an application endpoint. Thus, you will have to set up this data decoder service as an application endpoint in the "your application server" tab.
The address is:

👍

Application data decoder service address

https://api.scs.iot.telekom.com/ddd-http-appl-forwarder/forwarder

See also this screenshot:

1429

How to decode data

Necessary headers

In your iotcreators project, please set up the necessary headers documented below. Without these headers, the application addition will be rejected.

1430
  • authorization: this header contains the "Basic auth-token", where auth-token is the token used to authorize requests for your api. It is the base64(username:password)
  • endpoint-forward-url: this header contains the application endpoint that the decoded data will be sent to

Forwarding device data to a specific decoder

To forward the device data to a specific decoder, you will have to add a specific tag when adding that device to your project. Such tag must have a "name" equal to "deviceType" and a value equal to the desired decoder.
In the below example, you can see how to decode mbus payloads.

1322

Supported device types

🚧

If you do not specify the deviceType, the payload coming from the device will be simply passed through the decoder. The output format to your application endpoint will be the same as here: https://docs.iotcreators.com/docs/5-forward-message-to-application
If you specify an unsupported deviceType, the message will be simply passed through and an error message will be added to the forwarded json to warn you.

Output message format

This is an example of the output message format, decoded by the mbus decoder.

{ 
  "reports": [
    {
      "serialNumber": "IMEI:866425033313638",
      "timestamp": 1598887180734,
      "subscriptionId": "fa37d89c-a7e2-4f3d-b12f-6002a3642b4c",
      "resourcePath": "uplinkMsg/0/data",
      "value": "685E5E680800729085712624232804735000000C05000000000C12420700003C2ADDB4EBDD3B3ADDB4EB0A5A04020A5E04020A620000046D22108D114C0500000000446D3B177E1444ED7E3B179E148C01050000000084016D3B177F1C0B2
65365080416",
      "customAttributes": {
        "deviceType": "mbus",
        "id": "IMEI:866425033313638"
      },
      "decoder": "mbus", //decoder name
      "data": {
        "encoded": "685E5E680800729085712624232804735000000C05000000000C12420700003C2ADDB4EBDD3B3ADDB4EB0A5A04020A5E04020A620000046D22108D114C0500000000446D3B177E1444ED7E3B179E148C01050000000084016D3B177F1
C0B265365080416", //raw payload that device sent to decoder
        "decoded": { //decoded json coming from decoded, this depends on the decoder
          "MBusData": {
            "SlaveInformation": {
              "Id": "26718590",
              "Manufacturer": "HYD",
              "Version": "40",
              "ProductName": "ABB F95 Typ US770",
              "Medium": "Heat: Outlet",
              "AccessNumber": "115",
              "Status": "50",
              "Signature": "0000"
            },
            "DataRecord": [
              {
                "@id": "0",
                "Function": "Instantaneous value",
                "Unit": "Energy (100 Wh)",
                "Value": "0",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "1",
                "Function": "Instantaneous value",
                "Unit": "Volume (1e-4  m^3)",
                "Value": "742",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "2",
                "Function": "Value during error state",
                "Unit": "Power (1e-1 W)",
                "Value": "144521543",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "3",
                "Function": "Value during error state",
                "Unit": "Volume flow (1e-4  m^3/h)",
                "Value": "1521543",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "4",
                "Function": "Instantaneous value",
                "Unit": "Flow temperature (1e-1 deg C)",
                "Value": "204",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "5",
                "Function": "Instantaneous value",
                "Unit": "Return temperature (1e-1 deg C)",
                "Value": "204",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "6",
                "Function": "Instantaneous value",
                "Unit": "Temperature Difference (1e-1  deg C)",
                "Value": "0",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "7",
                "Function": "Instantaneous value",
                "Unit": "Time Point (time & date)",
                "Value": "2012-01-13T16:34:00",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "8",
                "Function": "Instantaneous value",
                "Unit": "Energy (100 Wh)",
                "Value": "0",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "9",
                "Function": "Instantaneous value",
                "Unit": "Time Point (time & date)",
                "Value": "2011-04-30T23:59:00",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "10",
                "Function": "Instantaneous value",
                "Unit": "Time Point (time & date)",
                "Value": "2012-04-30T23:59:00",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "11",
                "Function": "Instantaneous value",
                "Unit": "Energy (100 Wh)",
                "Value": "0",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "12",
                "Function": "Instantaneous value",
                "Unit": "Time Point (time & date)",
                "Value": "2011-12-31T23:59:00",
                "Timestamp": "1970-01-01T00:00:00"
              },
              {
                "@id": "13",
                "Function": "Instantaneous value",
                "Unit": "Operating time (hours)",
                "Value": "86553",
                "Timestamp": "1970-01-01T00:00:00"
              }
            ]
          }
        }
      },
      "device": { //device that was decoded by decoder
        "deviceType": "mbus",
        "id": "IMEI:866425033313638"
      },
      "status": "OK", //status of the decoding, either OK or ERROR
      "statusCode": 200, //http return code from decoder
      "statusMessage": "This payload has been correctly decoded" //status message from decoder
    }
  ],
  "registrations": [],
  "deregistrations": [],
  "updates": [],
  "expirations": [],
  "responses": []
}