Configure data discovery
- Last UpdatedJun 29, 2026
- 4 minute read
- PI System
- Adapter for BACnet 1.2
- Adapters
You can perform a data discovery for existing data items on demand. Data discovery is initiated through REST calls, and it is tied to a specific discovery Id, which you can either specify or let the adapter generate it.
Data discovery includes different routes. For example, you can choose to do the following:
-
Retrieve the discovery results
-
Query the discovery status
-
Cancel or delete discoveries
-
Merge discovery results with the data selection configuration
-
Retrieve results from a current discovery and compare it with results from a previous discovery
-
Retrieve results from a current discovery and compare it with results from a current data selection configuration
Configuration steps
-
Start any of the Configuration tools capable of making HTTP requests.
-
Run a POST command with the Id of the discovery and autoSelect set to either true or false to the following endpoint.
For this example, 5590 is the default port number. If you selected a different port number, replace it with that value:
http://localhost:5590/api/v1/configuration/<ComponentId>/Discoveries.
Note: Including an Id is optional. If you do not include one, the adapter automatically generates one.
Example using curl:
curl -d "{ \"Id\":\"TestDiscovery\", \"autoSelect\":true }" -H "Content-Type:application/json" -X POST http://localhost:5590/api/v1/configuration/<ComponentId>/Discoveries"
Discovery parameters
The following table lists all available discovery parameters and describes what inputs are permitted for a discovery query.
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
string |
The Id of the discovery. Note: You cannot run multiple discoveries with the same Id. Including an id is optional. If you do not include one, the adapter automatically generates one. |
|
query |
string |
A filter that limits the scope of the discovery. For BACnet, the query can filter by device ID, MAC address, or both. For query syntax and examples, see the Discovery query syntax section below. |
|
autoSelect |
boolean |
When set to true, the result of the discovery gets pushed to the data selection configuration. |
Examples
Discoveries status
The following example shows the status of all discoveries. The discovery id in this example was auto-generated. Refer to the table below for a description of each parameter.
[
{
"id": "8ff855f1-a636-490a-bb31-207410a6e607",
"query": null,
"startTime": "2020-09-30T19:34:01.8180401+02:00",
"endTime": "2020-09-30T19:34:01.8368776+02:00",
"progress": 30,
"itemsFound": 4,
"newItems": 0,
"resultUrl": "http://127.0.0.1:5590/api/v1/Configuration/<ComponentId>/Discoveries/8ff855f1-a636-490a-bb31-207410a6e607/result",
"autoSelect": false,
"status": "Complete",
"errors": null
}
]
This following table lists all attributes of a discovery status, as displayed in the previous example. After a discovery has been initiated, you can query the status of the discovery at any time to see discovery attributes, such as progress, data items found, and result URL.
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
string |
The Id of the discovery. Note: You cannot run multiple discoveries with the same Id. Including an id is optional. If you do not include one, the adapter automatically generates one. |
|
query |
string |
A filter that limits the scope of the discovery. For BACnet, the query can filter by device ID, MAC address, or both. For query syntax and examples, see the Discovery query syntax section below. |
|
startTime |
datetime |
Time when the discovery started |
|
endTime |
datetime |
Time when the discovery ended |
|
progress |
double |
Progress of the discovery |
|
itemsFound |
integer |
Number of data items that the discovery found on the data source |
|
newItems |
integer |
Number of new data items that the discovery found in comparison to the previous discovery |
|
resultUrl |
integer |
URL at which you can access the results of the discovery |
|
autoSelect |
boolean |
When set to true, the result of the discovery gets pushed to the data selection configuration. |
|
status |
reference |
Status of the discovery, for example Active or Complete |
|
errors |
string |
Errors encountered during the discovery |
Discovery query syntax
Use the query property to limit discovery to specific BACnet devices. If no query is specified, the adapter discovers all devices that are available through the configured BACnet network. The discovery request supports filtering by device ID, MAC address, or both. The query string consists of semicolon-separated name=value pairs.
Supported query names are:
-
DeviceIds - A comma-separated list of BACnet device IDs.
-
MacAddresses - A comma-separated list of BACnet MAC addresses.
For example:
DeviceIds=1,2
MacAddresses=00:1D:DC:B7:6A:D4,00:1D:DC:B8:6B:D5
Multiple filters can be combined in a single query:
DeviceIds=1,2;MacAddresses=00:1D:DC:B7:6A:D4
The following example starts a discovery operation for devices with BACnet device IDs 1 and 2 and automatically adds discovered items to the data selection configuration:
curl -d "{ \"Id\":\"SampleA\",\"query\":\"DeviceIds=1,2\", \"autoSelect\":true }" -H "Content-Type:application/json" -X POST http://localhost:5590/api/v1/configuration/<ComponentId>/Discoveries
Discovery
The following discovery query searches the entire data source for data items on every configured outstation. Since auto-select is set to true, all items will automatically be added to the data selection.
curl -d "{ \"Id\":\"TestDiscovery\", \"autoSelect\":true }" -H "Content-Type:application/json" -X POST http://localhost:5590/api/v1/configuration/<ComponentId>/Discoveries
Result:
[
{
"id": "TestDiscovery",
"query": null,
"startTime": "2020-09-30T19:34:01.8180401+02:00",
"endTime": "2020-09-30T19:34:01.8368776+02:00",
"progress": 100,
"itemsFound": 400,
"newItems": 124,
"resultUrl": http://127.0.0.1:5590/api/v1/Configuration/DNP3-1/Discoveries/TestDiscovery/result,
"autoSelect": true,
"status": "Complete",
"errors": null
}
]
REST URLs
|
Relative URL |
HTTP verb |
Action |
|---|---|---|
|
api/v1/configuration/<componentId>/discoveries |
GET |
Returns status of all discoveries |
|
api/v1/configuration/<componentId>/discoveries |
POST |
Initiates a new discovery and returns its Id |
|
api/v1/configuration/<componentId>/discoveries |
DELETE |
Cancels and deletes all saved discoveries |
|
api/v1/configuration/<componentId>/discoveries/<discoveryId> |
GET |
Gets the status of an individual discovery. Note: If a discovery with the specified Id does not exist, you will get an error message. |
|
api/v1/configuration/<componentId>/discoveries/<discoveryId> |
DELETE |
Cancels and deletes discovery and result |
|
api/v1/configuration/<componentId>/discoveries/<discoveryId>/result |
GET |
Returns the result of a discovery |
|
api/v1/configuration/<componentId>/discoveries/<discoveryId>/result?diff=previousId |
GET |
Returns the difference between the result and the previous result |
|
api/v1/configuration/<componentId>/dataselection?diff=<discoveryId> |
GET |
Returns the difference between the data selection configuration and the discovery results |
|
api/v1/configuration/<componentId>/discoveries/<discoveryId>/result |
DELETE |
Cancels and deletes discovery result. Note: The discovery Id is still valid, but a query will contain a status of canceled.Only the Status property will contain a canceled status, but not the query. |
|
api/v1/configuration/<componentId>/discoveries/<discoveryId>/cancel |
POST |
Cancels the on-demand data source discovery |
|
api/v1/configuration/<componentId>/dataselection/select?discoveryid=<discoveryId> |
POST |
Adds the discovered items to data selection with selected set to true |
|
api/v1/configuration/<componentId>/dataselection/unselect?discoveryid=<discoveryId> |
POST |
Adds the discovered items to data selection with selected set to false |
Note: Replace <componentId> with the Id of your adapter component and replace <discoveryId> with the Id of the discovery for which you want to perform the action.