logo

Are you need IT Support Engineer? Free Consultant

AVEVA PI Server Integration to SAP APM via thin-ed…

  • By Sanjay
  • 04/05/2026
  • 6 Views


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:

  1. Reads industrial data from AVEVA PI System via PI Web API
  2. Publishes data to a local MQTT broker
  3. Routes telemetry through thin-edge.io gateway
  4. 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:

Ericsander_1-1777564461681.Png

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
  • unzip package 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

  1. Visit the GitHub Releases page
  2. Download the latest pi_connector_{version}.zip package
  3. Skip to Option B

Option B: Build from Source

  1. Clone the repository:

    git clone https://github.com/Cumulocity-IoT/thin-edge-aveva-pi-connector
    cd thin-edge-aveva-pi-connector
  2. Create the deployable package:

    zip -r pi-historian-connector.zip \
             app.py \
             docker-compose.yaml \
             Dockerfile \
             requirements.txt

    This creates pi-historian-connector.zip excluding development files.

Step 2: Upload to Cumulocity Software Repository

  1. Log in to Cumulocity (Embedded IoT Platform as part of SAP APM)

  2. Navigate to Management → Software repository

  3. Click Add Software

  4. Fill in the details:

    Name PI Historian Connector
    Software Type container-group
    Version e.g., 1.0.0
    File Upload your .zip package
  5. 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.

  1. Edit the thin-edge configuration plugin:

    sudo nano /etc/tedge/tedge-configuration-plugin.toml
  2. 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
  3. 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:

  1. Navigate to your device in Cumulocity:

    • Go to Device Management → All devices
    • Select your thin-edge device
  2. Upload PI System configuration:

    • Click the Configuration tab
    • Click Add configuration snapshot
    • Select type: pi_config
    • Upload your pi_config.json file
    • Click Upload
  3. Upload datapoints configuration:

    • Click Add configuration snapshot again
    • Select type: pi_datapoints
    • Upload your datapoints.json file
    • Click Upload

Step 6: Deploy the Service

  1. Navigate to your thin-edge device:

    • Go to Device Management → All devices
    • Select your thin-edge device
  2. Install the software:

    • Click the Software tab
    • Click Install software
    • Search for “PI Historian Connector”
    • Select the version you uploaded
    • Click Install
  3. Monitor deployment:

    • Watch the Operations tab for deployment status
    • Wait for status to show Successful
  4. Verify the service is running:

    sudo docker ps | grep pi-historian

    You 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

  1. Navigate to your device in Cumulocity

  2. Click the Measurements tab

  3. Verify that PI tag data is appearing

    Ericsander_2-1777564461681.Png


Managing Your Deployment

Update Configuration

To modify polling intervals, add new tags, or change credentials:

  1. Edit your local pi_config.json or datapoints.json
  2. Go to Device Management → Your device → Configuration
  3. Upload the updated file
  4. The service automatically detects and applies changes without restart

Update the Service

To deploy a new version:

  1. Upload the new version to Software repository
  2. Go to Device Management → Your device → Software
  3. 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.

Additional Resources



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *