Data source parameters
- Last UpdatedNov 10, 2025
- 2 minute read
- PI System
- Adapter for MQTT 1.4
- Adapters
The following parameters are available for configuring a Sparkplug B data source:
|
Parameter |
Required |
Type |
Description |
|---|---|---|---|
|
hostNameOrIpAddress |
Required |
string |
Host name or IP address of the MQTT server |
|
port |
Optional |
integer |
Port number of the MQTT server. Required only if Protocol is TCP. |
|
primaryHostId |
Optional |
string |
The Id of the primary host. The adapter is considered the primary application. |
|
protocol |
Optional |
enum |
The protocol used to communicate to the MQTT broker |
|
TLS |
Optional |
enum |
Determines if TLS should be used and what version |
|
userName |
Optional |
string |
User name or client Id for accessing the MQTT server |
|
passWord |
Optional |
string |
Password or token for accessing the MQTT server. Note: We recommend using REST to configure the data source when the password must be specified because REST will encrypt the password. If you do not use REST, the plain text password is stored on-disk. You cannot specify a password without specifying a username. Allowed value: Any string |
|
clientId |
Optional |
string |
Unique identification of the adapter component connecting to the MQTT broker. Note: If ClientId is null, the adapter generates a GUID. |
|
MQTTVersion |
Optional |
enum |
Version of the MQTT protocol to be used. Allowed value: 3.1.0, or 3.1.1, or 5.0.0 |
|
validateServerCertificate |
Optional |
boolean |
Determines if the server certificate gets validated. If the server certificate validation is disabled, a warning is printed. Note: This parameter changes https to http if used in a request. Default value: true |
|
clientCertificateThumbprint |
Optional |
string |
The thumbprint of the certificate when the MQTT broker requires a client certificate. Default value: null |
|
clientCertificatePassword |
Optional |
string |
(Protected) - The password to access the certificate when the MQTT broker requires a client certificate. Default value: null |
|
streamIdPrefix |
Optional |
string |
Specifies what prefix is used for stream Ids. The naming convention is {StreamIdPrefix}{StreamId}. An empty string means no prefix is added to the stream Ids and names. A null value defaults to ComponentId followed by a period. Example: MqttSparkplugB1.{Topic}.{MetricName} Note: Every time you change the StreamIdPrefix of a configured adapter, for example when you delete and add a data source, you need to restart the adapter for the changes to take place. New streams are created on adapter restart and pre-existing streams are no longer updated. Allowed value: any string |
|
defaultStreamIdPattern |
Optional |
string |
Specifies the default stream Id pattern to use. The MQTT {BaseTopic} string has the
following format: {namespace}/{groupId}/{edgeNodeId}/{deviceId} Possible parameters: {BaseTopic}, {Topic}, {MetricName}. |