TelemetryItem
A telemetry item is a sub-type of a RelatedItem. It represents a telemetry item in the Item Service, such as a device sensor.
A telemetry item has the same characteristics as a RelatedItem but also has a "_sourceId" property to identify the data sensor source readings. For more information, see the following code example with reference to the schema:
{
"_id": "f3e36c5e-5d9f-4d5d-a692-b25ce180438b",
"_sourceId": "a2e052a6-9126-21d5-7301-0000863f27ad-3450121", // The source's id
}
| Parameter | Type | Description | Required |
|---|---|---|---|
_id | String | The TelemetryItem's ID | Required |
_sourceId | String | The ID of an external source, device, sensor, or point on a sensor that generates the time series data. | Required |
Custom properties
Like a RelatedItem, you can add your own properties:
{
"_id": "f3e36c5e-5d9f-4d5d-a692-b25ce180438b",
"_sourceId": "a2e052a6-9126-21d5-7301-0000863f27ad-3450121",
"name": "your sensor's name", // Custom property
"description": "a description of your sensor", // Custom property
"dtType": "The asset type", // Custom property
"floorname": "The asset's floor", // Custom property
"roomname": "The asset's room", // Custom property
}
Readings
Readings are timeseries items stored in the database that contain timestamped recordings from the data source.
{
{
"_ts": "2022-07-02T05:15:30+05:30",
"_tsMetadata": {
"_telItemId": "62befda2c21eca157f108e22",
"_sourceId": "a2e052a6-9126-21d5-7301-0000863f27ad-3450121"
}
},
{
"_ts": "2022-07-02T05:20:35+06:30",
"_tsMetadata": {
"_telItemId": "62befda2c21eca157f108e22",
"_sourceId": "a2e052a6-9126-21d5-7301-0000863f27ad-3450121"
}
}
}
| Parameter | Type | Description | Required |
|---|---|---|---|
_ts | String | The reading's timestamp. | Required |
_tsMetadata | Object | An object that contains the timestamp's metadata, such as the TelemetryItem's ID and the source ID | Required |
_tsMetadata._telItemId | String | The ID of the TelemetryItem that recorded the reading. | Required |
_tsMetadata._sourceId | String | The ID of the TelemetryItem's source that recorded the reading | Required |
Readings custom attributes
You can add custom attributes to a reading. The following example includes value and unit properties to store temperature recordings.
{
{
"_ts": "2022-07-02T05:15:30+05:30",
"_tsMetadata": {
"_telItemId": "62befda2c21eca157f108e22",
"_sourceId": "a2e052a6-9126-21d5-7301-0000863f27ad-3450121"
},
"value": "23.2", // Custom property
"unit": "degC" // Custom property
}
}
Collection
Store TelemetryItems in a NamedTelemetryCollection. When your TelemetryItems are in a collection, you can create relationships between them and items in the same or other collection.
API
You can create and manage telemetry items using the IafItemSvc JavaScript Platform API or the Item Service REST API.