Overview
A client-mode connector for a curated slice of the AVEVA PI Web API (PI System / FactoryTalk Historian) under your customer hosthttps://{host}/piwebapi:
BASE_ADDRESS is https://YOUR_PI_HOST/piwebapi (no trailing slash; endpoints start with /). Topics use historian/aveva-pi-web-api/<object>/<verb>. Pass stream / element WebIds on each MQTT payload.
See the base guide: REST API Connectors.
Customer-hosted. There is no public PI Web API sandbox. Replace
YOUR_PI_HOST and supply Basic, Kerberos, or Bearer (OIDC) credentials configured on your instance. Prefer Hub secrets.Channels (WebSocket) for live value change streams are out of scope. This package is client REST only. Use host Swagger at
https://{host}/piwebapi/help for the full controller surface.Prefer Hub secrets for tokens / passwords. This template has not been verified against a live PI Web API host. Queue status remains blocked until an authenticated live smoke succeeds.
Basic Syntax
Events
Auth
Bearer (OIDC) — default in the template:- Obtain an access token from your PI Web API OpenID Connect / identity provider configuration.
- Pass
api_tokenon the MQTT request payload so headers resolve:Authorization: Bearer {value.json.api_token}
- Store the token in Hub secrets /
GET SECRET "PI_WEB_API_TOKEN". Never commit real credentials.
- Uncomment
WITH USERNAME/WITH PASSWORD GET SECRET "PI_WEB_API_PASSWORD"onREST_API_CONFIG, or sendAuthorization: Basic <base64(user:pass)>by adjusting the header scheme and payload field. - Map the identity to a PI / AF identity with read/write rights for the target points.
Example payloads
System status:PostStreamSetsRecorded):
{payload} (include only fields PI Web API expects).
Deploy notes
- Deployable file:
AvevaPiWebApiRestApi.lot— noADD METADATA. - Hub catalog sidecar:
hub-metadata.lot(WITH STATUS "beta", icon, doclink). - Replace
YOUR_PI_HOSTbefore use. TLS: keepUSE_SSL "true"for HTTPS hosts. - Obtain WebIds via Points / Attributes / Elements search on your host (or batch step 1) before stream calls.

