Skip to content

Automatic Discovery with REST API

Automatic Discovery with REST API

Automatic discovery can be enable in Edge Xpert by using the Provision Watcher API. For example:

curl --request POST 'http://localhost:59881/api/v2/provisionwatcher' \
--header 'Content-Type: application/json' \
--data-raw '[
   {
      "provisionwatcher":{
         "apiVersion":"v2",
         "name":"Provision-Watcher-0-199",
         "description":"Filter 0~199",
         "adminState":"UNLOCKED",
         "identifiers":{
            "DeviceInstance":"^[01]?[0-9][0-9]?$"
         },
         "serviceName":"device-bacnet-ip",
         "profileName":"bacnet-sim-profile",
         "protocolName":"bacnet-ip"
      },
      "apiVersion":"v2"
   }
]'

For details on each property, see Configurable Properties.

Customize Discovered Device Information

We can customize the name, description, and labels of discovered devices to make device information more user-friendly.

For example, we can use the placeholder {{ModelName}} in the deviceNameTemplate field. The device service will find and replace {{ModelName}} with the metadata it has discovered during discovery.

The following example demonstrates how to override the default device name, description, and labels:

curl --request POST 'http://localhost:59881/api/v2/provisionwatcher' \
--header 'Content-Type: application/json' \
--data-raw '[
   {
      "provisionwatcher":{
         "apiVersion":"v2",
         "name":"Provision-Watcher-0-199",
         "description":"Filter 0~199",
         "adminState":"UNLOCKED",
         "identifiers":{
            "DeviceInstance":"^[01]?[0-9][0-9]?$"
         },
         "serviceName":"device-bacnet-ip",
         "profileName":"bacnet-sim-profile",
         "protocolName":"bacnet-ip",
         "deviceNameTemplate" : "BACnet-IP-{{ModelName}}",
         "deviceLabels" : [
            "Auto-Discovered",
            "instance-{{InstanceID}}",
            "{{DeviceType}}",
            "{{VendorName}}"
         ],
         "deviceDescription" : "{{ModelName}}, DeviceInstance {{DeviceInstance}}",
      },
      "apiVersion":"v2"
   }
]'

You can use protocol properties and device properties as placeholders in the following fields:

  • deviceNameTemplate, which is used to override the device name
  • deviceLabels, which is used to override the device labels
  • deviceDescription, which is used to override the device description

Customize the Profile data via Provision Watcher

BACnet/IP and OPC-UA device services can automatically generate device profiles if a profile name has not been provided.

You can customize the profile name, description, and labels to make the device profile more user-friendly.

curl --request POST 'http://localhost:59881/api/v2/provisionwatcher' \
--header 'Content-Type: application/json' \
--data-raw '[
   {
      "provisionwatcher":{
         "apiVersion":"v2",
         "name":"Provision-Watcher-0-199",
         "description":"Filter 0~199",
         "adminState":"UNLOCKED",
         "identifiers":{
            "DeviceInstance":"^[01]?[0-9][0-9]?$"
         },
         "serviceName":"device-bacnet-ip",
         "protocolName":"bacnet-ip",
         "profileName": "",
         "profileNameTemplate": "BACnet-IP-{{ModelName}}",
         "profileLabels": [
            "Auto-Discovered",
            "{{DeviceType}}",
            "{{VendorName}}"
         ],
         "profileDescription": "{{DeviceType}} profile for {{ModelName}}"
      },
      "apiVersion":"v2"
   }
]'

You can use protocol properties and device properties as placeholders in the following fields:

  • profileNameTemplate, which is used to override the profile name
  • profileLabels, which is used to override the profile labels
  • profileDescription, which is used to override the profile description

Note

Profile auto-generation and field overriding will not work if you provide a profile name.