SCADA API Integration with ASI Biont: Turn Your Industrial Control System into an AI-Powered Monitoring Hub

Introduction

SCADA (Supervisory Control and Data Acquisition) systems are the backbone of industrial automation, monitoring everything from power plants to water treatment facilities. However, traditional SCADA platforms often require extensive manual configuration, custom scripting, and dedicated engineering teams to implement advanced analytics or automated responses. Enter ASI Biont — an AI agent that connects directly to your SCADA system via its REST API, reads live data from controllers (PLCs, RTUs), and executes commands without any dashboard or drag-and-drop interface. This article is a practical guide to integrating SCADA API with ASI Biont, covering real connection methods, a concrete use case with Python code, and automation scenarios that become possible. Whether you're an automation engineer or a plant manager, you'll see how to transform your SCADA into an AI-controlled center with minimal effort.

What Is SCADA API and Why Connect It to an AI Agent?

A SCADA system typically exposes a REST API that allows external applications to read tag values (e.g., temperature, pressure, flow rate) and write setpoints or commands. Connecting an AI agent to this API brings several benefits:

  • Real-time anomaly detection: AI continuously monitors streaming data and flags abnormal patterns faster than rule-based alarms.
  • Predictive maintenance: By analyzing historical trends, AI can forecast equipment failures and schedule maintenance before breakdowns occur.
  • Automated response: AI can send commands back to the SCADA system—e.g., shut down a valve if pressure exceeds a threshold—without human intervention.
  • Unified monitoring: The same AI agent can also connect to other devices (MQTT sensors, Modbus PLCs, OPC UA servers) and correlate data across silos.

ASI Biont supports multiple integration methods, but for SCADA API the most natural approach is HTTP API via aiohttp (inside execute_python). The AI agent writes a Python script that runs in a sandbox environment on the cloud (Railway), makes authenticated HTTP requests to your SCADA's REST endpoints, parses JSON responses, and logs or analyzes data. No local bridge or hardware setup is required—just a reachable API endpoint.

How ASI Biont Connects to SCADA API: Architecture Overview

The connection flow is straightforward:

  1. User describes the task in chat: "Connect to my SCADA at https://scada.example.com/api with API key abc123, read tags 'Tank1_Temp' and 'Tank1_Pressure' every 30 seconds, and alert me on Telegram if pressure exceeds 5 bar."
  2. AI agent generates a Python script using aiohttp for asynchronous HTTP requests. The script includes authentication headers, polling logic (with time.sleep to respect rate limits), and conditional branching.
  3. The script runs in the sandbox (execute_python), which has a 30-second timeout. For long-running polling, the AI uses a loop with asyncio.run() and asyncio.sleep() to stay within limits or sets up a scheduled task via the tool industrial_command with an interval parameter.
  4. Results are returned to the user: The AI displays the current values in the chat, sends a Telegram message if the threshold is exceeded, and can also write back to the SCADA API (e.g., send a command to close a valve).

Below is a simplified architecture diagram (conceptual):

+-------------------+       HTTP long polling       +-------------------+

| User's SCADA API  | <----------------------------> | ASI Biont Sandbox |
| (REST endpoints)  |       requests/commands        | (execute_python)  |
+-------------------+                                +-------------------+
        ^                                                    ^

        |                                                    |
        | (user provides URL, API key)                       | (AI writes script)

        |                                                    |
+-------------------+                                +-------------------+

| User describes    |                                | AI agent          |
| task in chat      | -----------------------------> | generates code    |
+-------------------+                                +-------------------+

Important: ASI Biont does not have a built-in SCADA adapter. Instead, it uses the universal execute_python mechanism, allowing connection to any device that has an HTTP API. This means you don't have to wait for a vendor-specific integration—just describe your device in the chat, and the AI writes the code on the fly.

Concrete Use Case: Monitor and Control a Water Tank with SCADA API

Let's walk through a real example. Suppose you have a SCADA system managing a water storage tank. The SCADA exposes these API endpoints:

  • GET /api/tags/Tank1_Temp → returns {"value": 22.5, "unit": "°C", "timestamp": "2026-07-14T10:00:00Z"}
  • GET /api/tags/Tank1_Pressure → returns {"value": 4.2, "unit": "bar", "timestamp": "2026-07-14T10:00:00Z"}
  • POST /api/commands → accepts {"tag": "Valve_Outlet", "value": 0} to close a valve

You want the AI to:
- Read pressure every 30 seconds.
- Send a Telegram alert if pressure exceeds 5 bar.
- Automatically close the outlet valve if pressure exceeds 5.5 bar (emergency).
- Log all readings to a CSV file for later analysis.

Step 1: Prepare the SCADA API Connection

Ensure the API is reachable from the internet (or use a secure tunnel like ngrok for testing). Have your API key ready.

Step 2: Describe the Task in ASI Biont Chat

Paste something like this:

"Connect to my SCADA API at https://scada.example.com/api. Use API key 'sk-abc123'. Read tags 'Tank1_Temp' and 'Tank1_Pressure' every 30 seconds. If pressure > 5 bar, send me a Telegram message to @mybot with alert. If pressure > 5.5 bar, POST to /api/commands with {"tag": "Valve_Outlet", "value": 0} to close the valve. Log all data to a CSV file named tank_log.csv."

Step 3: AI Generates and Runs the Code

The AI will produce a Python script using aiohttp and telegram (via python-telegram-bot or requests to a bot API). Here's a simplified version of what the code might look like:

import asyncio
import aiohttp
import csv
from datetime import datetime

API_BASE = "https://scada.example.com/api"
HEADERS = {"Authorization": "Bearer sk-abc123"}
TELEGRAM_BOT_TOKEN = "YOUR_BOT_TOKEN"
TELEGRAM_CHAT_ID = "YOUR_CHAT_ID"

async def send_telegram(message):
    async with aiohttp.ClientSession() as session:
        url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
        payload = {"chat_id": TELEGRAM_CHAT_ID, "text": message}
        async with session.post(url, json=payload) as resp:
            return await resp.json()

async def read_tag(session, tag_name):
    url = f"{API_BASE}/tags/{tag_name}"
    async with session.get(url, headers=HEADERS) as resp:
        data = await resp.json()
        return data["value"]

async def write_command(session, tag, value):
    url = f"{API_BASE}/commands"
    payload = {"tag": tag, "value": value}
    async with session.post(url, json=payload, headers=HEADERS) as resp:
        return await resp.json()

async def main():
    async with aiohttp.ClientSession() as session:
        while True:
            # Read tags
            temp = await read_tag(session, "Tank1_Temp")
            pressure = await read_tag(session, "Tank1_Pressure")
            timestamp = datetime.utcnow().isoformat()

            # Log to CSV
            with open("tank_log.csv", "a", newline="") as f:
                writer = csv.writer(f)
                writer.writerow([timestamp, temp, pressure])

            # Check thresholds
            if pressure > 5.5:
                await write_command(session, "Valve_Outlet", 0)
                await send_telegram(f"🚨 EMERGENCY: Pressure {pressure} bar exceeded 5.5 bar. Valve closed.")
            elif pressure > 5.0:
                await send_telegram(f"⚠️ Alert: Pressure {pressure} bar above 5 bar.")

            await asyncio.sleep(30)

if __name__ == "__main__":
    asyncio.run(main())

Note: In practice, the sandbox timeout is 30 seconds, so a while True loop will be stopped. For continuous monitoring, the AI can use a scheduled task (via industrial_command with interval parameter) or a lightweight cron-like approach. The above example illustrates the logic; the actual generated code would handle scheduling externally.

Step 4: AI Executes and Monitors

The AI runs the script, starts polling, and reports back in the chat:

"Connected to SCADA API. Reading Tank1_Temp: 22.5°C, Tank1_Pressure: 4.2 bar. Next check in 30 seconds. I'll alert you if pressure exceeds 5 bar."

If the pressure later rises above 5.5 bar, you'll receive a Telegram message automatically, and the valve will be closed without any manual action.

Alternative Connection Methods for SCADA Systems

While HTTP API is the most direct, SCADA systems often support other protocols that ASI Biont can use:

Protocol How ASI Biont Connects Typical SCADA Exposure Best For
Modbus TCP industrial_command with protocol='modbus_tcp' PLCs with Modbus interface Direct register reading without API layer
OPC UA industrial_command with protocol='opcua' Unified server aggregating multiple tags Enterprise SCADA with OPC UA support
MQTT industrial_command with protocol='mqtt' or execute_python with paho-mqtt SCADA publishing to broker Distributed sensor networks
SSH execute_python with paramiko SCADA running on Linux server Running scripts on the SCADA host

For most modern SCADA systems, HTTP API is the simplest to set up—no special drivers, just a REST client.

Automation Scenarios Beyond Simple Monitoring

Once your SCADA is connected to ASI Biont, you can implement sophisticated automations:

  • Predictive maintenance: The AI aggregates historical pressure and temperature data, trains a simple anomaly detection model using scikit-learn (available in sandbox), and flags deviations that precede pump failure.
  • Cross-system correlation: Combine SCADA data with weather API (e.g., rain forecast) to preemptively adjust tank levels.
  • Multi-channel alerts: Send critical alarms to Telegram, email (via SMTP library), or even Slack using slack_sdk.
  • Remote control via chat: Ask the AI "Close the outlet valve for 2 hours" and it writes the command to the SCADA API.

All without writing a single line of boilerplate—the AI generates the code and runs it instantly.

Why ASI Biont Is a Game-Changer for SCADA Integration

Traditional SCADA integration requires:

  • A dedicated developer or system integrator.
  • Custom scripts in Python, JavaScript, or a proprietary language.
  • Testing, debugging, and deployment cycles.

With ASI Biont, you simply describe what you want in natural language. The AI agent:

  • Understands your SCADA API structure (you can provide a Swagger/OpenAPI spec or just describe endpoints).
  • Writes production-ready Python code using aiohttp with error handling, authentication, and logging.
  • Executes the code in a secure sandbox and returns results in real time.
  • Adapts to changes instantly—if you add a new tag, just tell the AI.

This approach reduces integration time from days to minutes, democratizes industrial automation, and lets engineers focus on optimization rather than coding.

Conclusion

Integrating your SCADA system with an AI agent like ASI Biont opens a new level of industrial intelligence. By connecting via HTTP API (or Modbus, OPC UA, MQTT—whatever your system supports), you gain real-time anomaly detection, automated emergency responses, and predictive analytics—all without complex programming. The AI writes the integration code on the fly, right in the chat, so you can start monitoring and controlling your plant in seconds.

Ready to turn your SCADA into an AI-powered hub? Go to asibiont.com, start a chat with the AI agent, and describe your SCADA API. Watch as it connects, reads data, and takes actions—all automatically. No dashboard, no waiting. Try it now.

← All posts

Comments