Device Profiles
A device profile describes the type of device within Edge Xrt using deviceResources to define operations it supports and deviceCommands to group these resources together. Each device added to a device service has an associated profile written in JSON format.
Note
Multiple devices can be configured to use the same device profile.
Device Profile Content
Profile Identification Information
A device profile contains identification information as shown in the table below:
Identification Information | Description | Required |
---|---|---|
name | The name of the device profile. Must be the same as the base profile file name | Y |
apiVersion | The API Version for the profile | Y |
manufacturer | Manufacturer of the device | N |
model | Model of the device | N |
description | A description of the device profile | N |
labels | A list of labels that can be used when searching device profiles | N |
Resources
A profile contains deviceResources. The following tables show the parameters for these and whether the parameters are required or optional:
deviceResource Parameter | Description | Required |
---|---|---|
name | The name of the device resource | Y |
description | A description of the device resource | N |
attributes | These are device service specific, for more information refer to the specific device service Component page | Y |
properties - valueType | The Data Type for the resource to use. See specific device service Components for supported Data Types | Y |
properties - readWrite | Read and Write permissions for the resource | Y |
The deviceResources section of the profile specifies individual values within a device that can be read from or written to.
The IOTech Device Configuration Tool provides a GUI for the management of device profiles for various protocols. This online tool allows you to create device profiles using the GUI instead of manually using a text editor.
Commands
A profile can optionally contain deviceCommands which can be used to group device resources in a single command. Below is a table explaining deviceCommand parameters:
deviceCommand Parameter | Description | Required |
---|---|---|
name | The name of the deviceCommand | Y |
readWrite | Whether the command is read or write or both | Y |
resourceOperations | These are the deviceResources to be grouped into the deviceCommand | Y |
The following extract combines the device resources for BinaryInput1 and BinaryInput2 in a single GET command for reading:
"deviceCommands": [
{
"name": "BinaryInputs",
"readWrite": "R",
"resourceOperations":
[
{
"deviceResource": "BinaryInput1"
},
{
"deviceResource": "BinaryInput2"
}
]
}
]
The following extract combines the device resources for DeviceResource1 and DeviceResource2 in a single GET and a single SET command for reading and writing:
"deviceCommands": [
{
"name": "GroupedResources",
"readWrite": "RW",
"resourceOperations":
[
{
"deviceResource": "DeviceResource1"
},
{
"deviceResource": "DeviceResource2"
}
]
}
]
Load Device Profiles
The device service must provide a list of the profile files required by the configured devices in a JSON file that is specified in the profile configuration parameter(ProfileListFile); by default profiles.json is used. The specified JSON file contains an array of the base names of the profile files.
Note
The base name is the name of the profile file is without the .json file extension. The base name of a profile must match the name parameter inside the profile.
For example, a profiles.json file containing the following array will load files named profile-1.json, profile-2.json, profile-3.json and profile-4.json from the directory specified by the ProfileDir configuration parameter:
["profile-1", "profile-2", "profile-3", "profile-4"]
Example Device Profile
An example device profile for the BACnet Device Service Component can be seen below:
{
"name": "bacnet-ip-sim-profile",
"apiVersion": "v2",
"labels": ["sim", "bacnet-ip"],
"deviceResources": [
{
"attributes": {
"instance": 1234,
"property": 75,
"type": 8
},
"name": "BacnetSimulator:object-identifier",
"properties": {
"readWrite": "RW",
"valueType": "string"
}
},
{
"attributes": {
"instance": 1234,
"property": 77,
"type": 8
},
"name": "BacnetSimulator:object-name",
"properties": {
"readWrite": "RW",
"valueType": "string"
}
}
],
"deviceCommands": [
{
"name": "Example",
"readWrite": "RW",
"resourceOperations":
[
{
"deviceResource": "BacnetSimulator:object-identifier"
},
{
"deviceResource": "BacnetSimulator:object-name"
}
]
}
]
}
In the example we can see the identification information, name, apiVersion and labels are assigned.
Further down the profile, we can see the device resources, which define the operations for a device.
Through the use of deviceResources, we create end points for a user to query using the Xrt MQTT API. For more information see the MQTT API Guide.
Further Information
For further information on the device service configuration parameters common to all device service components, see the Device Service Component Configuration
For further information on provisioning devices, see the Device Provisioning.