Skip to content

Commit 4a20746

Browse files
Merge pull request #239113 from dominicbetts/central-payload-updates
IoT Central: clarify payload information
2 parents b1a7230 + e7602b8 commit 4a20746

File tree

1 file changed

+80
-4
lines changed

1 file changed

+80
-4
lines changed

articles/iot-central/core/concepts-telemetry-properties-commands.md

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Telemetry, property, and command payloads in Azure IoT Central | Microsoft Docs
3-
description: Azure IoT Central device templates let you specify the telemetry, properties, and commands of a device must implement. Understand the format of the data a device can exchange with IoT Central.
2+
title: Device message payloads in Azure IoT Central
3+
description: Device templates specify the telemetry, properties, and commands a device uses. Understand the format of the data a device can exchange with IoT Central.
44
author: dominicbetts
55
ms.author: dobett
6-
ms.date: 06/08/2022
6+
ms.date: 05/24/2023
77
ms.topic: conceptual
88
ms.service: iot-central
99
services: iot-central
@@ -34,6 +34,9 @@ Each example shows a snippet from the device model that defines the type and exa
3434
3535
The JSON file that defines the device model uses the [Digital Twin Definition Language (DTDL) V2](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/DTDL.v2.md).
3636

37+
> [!TIP]
38+
> To troubleshoot device payload issues, see [Unmodeled data issues](troubleshoot-connection.md#unmodeled-data-issues) or use the **Raw data** view of the device in your IoT Central application.
39+
3740
For sample device code that shows some of these payloads in use, see the [Create and connect a client application to your Azure IoT Central application](tutorial-connect-device.md) tutorial.
3841

3942
## View raw data
@@ -74,11 +77,84 @@ To learn more about message properties, see [System Properties of device-to-clou
7477

7578
### Telemetry in components
7679

77-
If the telemetry is defined in a component, add a custom message property called `$.sub` with the name of the component as defined in the device model. To learn more, see [Tutorial: Create and connect a client application to your Azure IoT Central application](tutorial-connect-device.md).
80+
If the telemetry is defined in a component, add a custom message property called `$.sub` with the name of the component as defined in the device model. To learn more, see [Tutorial: Create and connect a client application to your Azure IoT Central application](tutorial-connect-device.md). This tutorial shows how to use different programming languages to send telemetry from a component.
7881

7982
> [!IMPORTANT]
8083
> To display telemetry from components hosted in IoT Edge modules correctly, use [IoT Edge version 1.2.4](https://github.com/Azure/azure-iotedge/releases/tag/1.2.4) or later. If you use an earlier version, telemetry from your components in IoT Edge modules displays as *_unmodeleddata*.
8184
85+
### Telemetry in inherited interfaces
86+
87+
If the telemetry is defined in an inherited interface, your device sends the telemetry as if it is defined in the root interface. Given the following device model:
88+
89+
```json
90+
[
91+
{
92+
"@id": "dtmi:contoso:device;1",
93+
"@type": "Interface",
94+
"contents": [
95+
{
96+
"@type": [
97+
"Property",
98+
"Cloud",
99+
"StringValue"
100+
],
101+
"displayName": {
102+
"en": "Device Name"
103+
},
104+
"name": "DeviceName",
105+
"schema": "string"
106+
}
107+
],
108+
"displayName": {
109+
"en": "Contoso Device"
110+
},
111+
"extends": [
112+
"dtmi:contoso:sensor;1"
113+
],
114+
"@context": [
115+
"dtmi:iotcentral:context;2",
116+
"dtmi:dtdl:context;2"
117+
]
118+
},
119+
{
120+
"@context": [
121+
"dtmi:iotcentral:context;2",
122+
"dtmi:dtdl:context;2"
123+
],
124+
"@id": "dtmi:contoso:sensor;1",
125+
"@type": [
126+
"Interface",
127+
"NamedInterface"
128+
],
129+
"contents": [
130+
{
131+
"@type": [
132+
"Telemetry",
133+
"NumberValue"
134+
],
135+
"displayName": {
136+
"en": "Meter Voltage"
137+
},
138+
"name": "MeterVoltage",
139+
"schema": "double"
140+
}
141+
],
142+
"displayName": {
143+
"en": "Contoso Sensor"
144+
},
145+
"name": "ContosoSensor"
146+
}
147+
]
148+
```
149+
150+
The device sends meter voltage telemetry using the following payload. The device doesn't include the interface name in the payload:
151+
152+
```json
153+
{
154+
"MeterVoltage": 5.07
155+
}
156+
```
157+
82158
### Primitive types
83159

84160
This section shows examples of primitive telemetry types that a device streams to an IoT Central application.

0 commit comments

Comments
 (0)