Introduction
SAP Asset Performance Management (APM) automatically comes with Embedded IoT capabilities powered by Cumulocity. In our first post, we (the topic experts from Cumulocity) showed you how to get started by simply connecting your smartphone sensors. Then we proceeded to show how to connect an OPC-UA server. Today, we want to go the next step and present an integration to AVEVA PI Server, one of the most popular industrial data historians.
AVEVA PI Connector for Cumulocity
Industrial historians like AVEVA PI System are the backbone of operational data in many manufacturing and energy environments, storing decades of high-frequency time-series data from sensors, PLCs, and SCADA systems. However, that data often remains siloed — inaccessible to modern IoT platforms, cloud analytics, and digital twin solutions.
Unlocking this data opens the door to an entirely new class of use cases. Until now, many teams have been unable to act on the full potential of their Historian data simply because it never left the plant floor. Bringing AVEVA PI System data into Cumulocity changes that — enabling use cases that were previously out of reach:
- Predictive process optimization — Feed live and historical tag data directly into ML models to anticipate process deviations before they impact production.
- Richer operational insights — Surface time-series data in real-time dashboards and anomaly detection pipelines to give operators and engineers a clearer picture of what’s happening across their assets.
- ML model training & inference — Use decades of high-fidelity sensor data to train models, then keep those models accurate with a continuous stream of live input signals.
- Predictive maintenance & quality control — Drive maintenance scheduling and quality decisions from actual equipment behavior rather than fixed intervals or manual inspection.
- OT/IT convergence — Break down the barrier between operational and enterprise systems, creating a unified data foundation for cross-functional teams.
This guide walks you through connecting an AVEVA PI System (Historian) to Cumulocity using a Python-based microservice and thin-edge. The integration works by running a lightweight Python microservice alongside thin-edge.io — Cumulocity’s open-source edge agent — which handles secure northbound communication, local buffering, and device management out of the box. Together, they bridge your PI Server’s Web API endpoint with Cumulocity’s cloud platform, translating PI tag data into Cumulocity measurements in real time.
By the end of this guide, you’ll have real-time industrial data flowing from your AVEVA PI System into Cumulocity, enabling dashboards, alerts, analytics, and integration with downstream IT systems — without disrupting your existing OT infrastructure.
Use Cases
This solution is ideal for:
- Industrial IoT data ingestion – Bridge legacy AVEVA PI Systems to modern IoT platforms
- Edge gateway integration – Deploy at the edge for local processing
- SCADA to IoT bridging – Connect operational technology (OT) to IT systems
- Real-time plant monitoring – Stream live process data to the cloud
- Predictive maintenance – Feed AVEVA PI System data into analytics pipelines
What You’ll Build
A complete data pipeline that:
- Reads industrial data from AVEVA PI System via PI Web API
- Publishes data to a local MQTT broker
- Routes telemetry through thin-edge.io gateway
- Delivers data to Cumulocity IoT platform
Key Benefits:
- Live configuration updates without service restarts
- Edge-friendly deployment via Cumulocity Software Management
- Remote configuration management from the cloud
- Automatic configuration reload on changes
Architecture Overview
Here’s how the components work together:
The thin-edge Connector for AVEVA PI is deployed to a docker environment and is acting as a bridge between the PI Web API and MQTT Broker of thin-edge.io. thin-edge.io itself can be installed locally on the machine or also run as a container. It bridges the communication from MQTT to Cumulocity.
With Cumulocity Device Management thin-edge.io and the connector is fully remote managed including installation/deinstallation, software updates and configuration management.
Prerequisites
Before you begin, ensure you have:
Infrastructure Requirements
- A VM or edge device running on Linux
- Docker installed and running
unzippackage installed
thin-edge.io Requirements
- thin-edge.io agent installed and running
- Device connected to Cumulocity
- Device registered as a thin-edge device
- thin-edge Mosquitto MQTT broker running and accessible
- thin-edge container plugin installed
AVEVA PI System Requirements
- Access credentials for PI Web API
- Network connectivity from edge device to AVEVA PI System
- List of AVEVA PI tags/datapoints you want to monitor
Step-by-step Guide
Step 1: Prepare the Software Package
You have two options to obtain the software:
Option A: Download Pre-built Package
- Visit the GitHub Releases page
- Download the latest
pi_connector_{version}.zippackage - Skip to Option B
Option B: Build from Source
-
Clone the repository:
git clone https://github.com/Cumulocity-IoT/thin-edge-aveva-pi-connector cd thin-edge-aveva-pi-connector -
Create the deployable package:
zip -r pi-historian-connector.zip \ app.py \ docker-compose.yaml \ Dockerfile \ requirements.txtThis creates
pi-historian-connector.zipexcluding development files.
Step 2: Upload to Cumulocity Software Repository
-
Log in to Cumulocity (Embedded IoT Platform as part of SAP APM)
-
Navigate to Management → Software repository
-
Click Add Software
-
Fill in the details:
Name PI Historian Connector Software Type container-groupVersion e.g., 1.0.0File Upload your .zippackage -
Click Add Software to save
Step 3: Configure thin-edge.io
Register Configuration Files
The service uses two configuration files that need to be registered with thin-edge.io for remote management.
-
Edit the thin-edge configuration plugin:
sudo nano /etc/tedge/tedge-configuration-plugin.toml -
Add the following configuration entries:
[[files]] path = "/etc/tedge/tedge.toml" type = "tedge.toml" [[files]] group = "tedge" mode = 444 path = "/etc/tedge/plugins/tedge-log-plugin.toml" type = "tedge-log-plugin" user = "tedge" [[files]] path = "/etc/tedge/c8y/datapoints.json" type = "pi_datapoints" user = "tedge" group = "tedge" mode = 0o644 [[files]] path = "/etc/tedge/c8y/pi_config.json" type = "pi_config" user = "tedge" group = "tedge" mode = 0o644 -
Restart thin-edge services:
sudo systemctl restart tedge-agent
Step 4: Create Configuration Files
4.1 Create PI System Configuration
Create a file named pi_config.json with your PI System connection details:
{
"RECORDING_AT_TIME": "?time=",
"POLL_INTERVAL": 90,
"PI_USER": "your_pi_username",
"PI_PASSWORD": "your_base64_encoded_password",
"PI_URL": "https://pi-webapi.your-domain.com/piwebapi"
}
Configuration Parameters:
| Parameter | Description | Example |
RECORDING_AT_TIME |
PI API query parameter for time-based data | "?time=" |
POLL_INTERVAL |
Data polling interval in seconds | 90 |
PI_USER |
PI Web API username | "pi_readonly_user" |
PI_PASSWORD |
PI Web API password (base64-encoded) | "cGFzc3dvcmQxMjM=" |
PI_URL |
PI Web API endpoint URL | "https://pi-server.local/piwebapi" |
Tip: To encode your password in base64:
echo -n "your_password" | base64
4.2 Create Datapoints Configuration
Create a file named datapoints.json listing the PI tags you want to collect:
[
"78FIQ301.A",
"78FIC102.A",
"REACTOR_TEMP_01",
"FLOW_METER_MAIN"
]
Each entry should be a valid PI tag name from your PI System.
Step 5: Upload Configurations to Cumulocity
Now upload both configuration files to your thin-edge device:
-
Navigate to your device in Cumulocity:
- Go to Device Management → All devices
- Select your thin-edge device
-
Upload PI System configuration:
- Click the Configuration tab
- Click Add configuration snapshot
- Select type:
pi_config - Upload your
pi_config.jsonfile - Click Upload
-
Upload datapoints configuration:
- Click Add configuration snapshot again
- Select type:
pi_datapoints - Upload your
datapoints.jsonfile - Click Upload
Step 6: Deploy the Service
-
Navigate to your thin-edge device:
- Go to Device Management → All devices
- Select your thin-edge device
-
Install the software:
- Click the Software tab
- Click Install software
- Search for “PI Historian Connector”
- Select the version you uploaded
- Click Install
-
Monitor deployment:
- Watch the Operations tab for deployment status
- Wait for status to show Successful
-
Verify the service is running:
sudo docker ps | grep pi-historianYou should see the container running.
Step 7: Verify Data Flow
Check Service Logs
sudo docker logs -f
Look for messages indicating:
- Successful connection to PI Web API
- Data retrieval from PI tags
- MQTT message publishing
Monitor MQTT Messages
mosquitto_sub -t 'te/device/main/#' -v
You should see telemetry data being published.
Check Cumulocity Measurements
-
Navigate to your device in Cumulocity
-
Click the Measurements tab
-
Verify that PI tag data is appearing
Managing Your Deployment
Update Configuration
To modify polling intervals, add new tags, or change credentials:
- Edit your local
pi_config.jsonordatapoints.json - Go to Device Management → Your device → Configuration
- Upload the updated file
- The service automatically detects and applies changes without restart
Update the Service
To deploy a new version:
- Upload the new version to Software repository
- Go to Device Management → Your device → Software
- Select the new version and click Update
Troubleshooting
Service not starting:
sudo docker logs
Check thin-edge connectivity:
sudo tedge connect c8y
sudo systemctl status tedge-agent
Verify MQTT broker:
sudo systemctl status mosquitto
Check configuration files:
cat /etc/tedge/c8y/pi_config.json
cat /etc/tedge/c8y/datapoints.json
Advanced Topics
Data Flow Example
PI Tag: REACTOR_TEMP_01 = 127.5°C
│
▼
PI Historian Service
│ (polls every 90s)
▼
MQTT Topic: te/device/main/m/reactor_temp
│ {"temperature": 127.5}
▼
Cumulocity Measurement
│
▼
Dashboard Visualization
Custom Tag Mapping
You can extend datapoints.json to include friendly names:
[
{
"tag": "78FIQ301.A",
"name": "Flow Rate - Inlet 301",
"unit": "m³/h"
},
{
"tag": "78FIC102.A",
"name": "Temperature - Reactor 102",
"unit": "°C"
}
]
Future Enhancements
Planned improvements include:
- Batch data ingestion for high-frequency tags
- Local buffering during network outages
- Advanced tag transformations and calculations
- Built-in metrics and observability
- Kubernetes-native deployment options
Contributing
We welcome contributions! Visit the repository: GitHub – Cumulocity-IoT/thin-edge-aveva-pi-connector: This repository contains a thinege plugin that…
Ways to contribute:
- Improve documentation – Help others understand better
- Add features – Extend functionality
- Fix bugs – Report or resolve issues
- Enhance performance – Optimize code
Please open an issue or submit a pull request.



