Device Telemetry Data
The following JSON format is used to send data from your SDK client to IoTConnect. In the below example, SDK sends data with temperature, humidity, weight, and gyroscope values from the device.
While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.
[{ "uniqueId": "<DEVICE UNIQUE ID>", "time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "data": { "temperature": 15.55, "humidity": 27.97, "weight": 36, "gyroscope": { "x": -1.2, "y": 0.25, "z": 1.1 } } }]
uniqueId: It is the device uniqueID
time: Current date and time with UTC timezone
data: Set JSON data with sensor name and value as per the device-generated data
Make sure you set all the required sensor names in the device template, as explained in the prerequisite step.
OTA Acknowledgement Command D2C
JSON payload for users who use our SDK to send Device acknowledgment commands D2C.
{ "ackId": "<ACK GUID>", "st": "<7/4>", "msg": "OTA updated successfully.", "childId": null }
ackId: You will receive the Acknowledgement ID from callbackMessage() method while receiving the command.
st: 7 – success, 4 – failed.
msg: Msg (optional). It is used for sending your custom message.
childId: ChildId (optional). It is used when you have a gateway template.
D2C Device Acknowledgement Command
JSON payload for users who use our SDK to send Device acknowledgment commands D2C.
{ "ackId": "<ACK GUID>", "st": "<6/4>", "msg": "Device command received successfully.", "childId": null }
ackId: You will receive the Acknowledgement ID from callbackMessage() method while receiving the command.
st: 6 – success, 4 – failed.
msg: Msg (optional). It is used for sending your custom message.
childId: ChildId (optional). It is used when you have a gateway template.
Gateway Device Telemetry D2C
JSON payload for users who use our SDK to send Device Telemetry D2C.
While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.
[{ "uniqueId": "<GATEWAY DEVICE UNIQUE ID>", // Gateway/Parent device Id "time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "data": { "Temperature": 10, "Humidity": 20 } }, { "uniqueId": "<CHILD DEVICE'S UNIQUE ID>", // Child ID associated with Gateway uniqueID "time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "data": { "Temperature": 30, "Gyroscope": { "x": 40, "y": 50, "z": 60 } } }, { "uniqueId": "<CHILD DEVICE'S UNIQUE ID>", // Child ID associated with Gateway uniqueID "time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "data": { "Temperature": 10, "Humidity": 20 } }]
Edge Device Telemetry Data
While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.
With using SendData() method of IoTConnect SDK
[{ "uniqueId": "<DEVICE UNIQUE ID>", // Edge device uniqueID "time": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "data": { "Temperature": 10, "Humidity": 20, "Gyroscope": { "x": 30, "y": 40, "z": 50 } } }]
Edge Device Rules Match Telemetry
While sending telemetry data, your device can send a few or all sensor (Template attribute) values. It is not required always to send all sensor ( Template attributes) values.
{ "cpId": "<COMPANY CPID>", "t": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "mt": 3, // Message Type 3 - Rule Matched Data "dtg": "<DEVICE TEMPLATE GUID>", "sdk": { "l": "M_<LANGUAGE CODE>", "v": "2.0", "e": "<ENV>" }, "d": [{ "rg": "620164A4-A501-42D9-979D-D5C68436625A", "ct": "Temperature > 50", "cv": { "Temperature": 66 }, "sg": "B4E647B7-68FB-4E18-BBB2-B9C27EF11DBD", "d": [{ "temp": "11", "humidity": "80", "Temperature": "66", "aaa": "red", "gyro": { "x": "1", "y": "-5", "z": "8" } }], "id": "<EDGE DEVICE UNIQUE ID>", // It is Edge Device unique ID "dt": "2020-01-24T10:06:17.857Z", //Date format <YYYY-HH-MMTHH:RR:SS.mmmz> "tg": "" }] }
cpId: Company code CPID. Get it from portal “Settings -> Key Vault” page.
dtg: Device Template GUID
sdk.l: SDK language code. You can refer in above example on same page.
sdk.e: This is the Environment of your solution
id: It is the Edge device’s uniqueID
rg: It is Rule GUID
ct: Rule Condition Text
cv: Evaluated Condition value
sg: Subscription GUID
Twin update property
{ "Key" : "value" // e.g { "frm_version": 1.5 } }
key: Twin desired property key
value: value associated with the desired property key.