Why Connect Sensors & Telemetry to an AI Agent?
Industrial environments generate gigabytes of telemetry — temperature, pressure, vibration, energy consumption. Raw data is just numbers; it becomes valuable when you can detect anomalies, predict failures, and trigger instant alerts. That's where ASI Biont steps in. It's an AI agent that writes and executes Python code from a simple chat conversation. Instead of building a dashboard, you just ask: "Alert me if pump #3 temperature exceeds 80°C" — and the AI does the wiring between your sensors and your chats.
This article shows how to connect sensors and telemetry systems to ASI Biont using the most common industrial protocols — MQTT, Modbus, OPC-UA — and how the universal execute_python tool makes any device possible.
Which Connection Protocol Should You Use?
| Protocol | Typical Sensors/Devices | ASI Biont Library |
|---|---|---|
| MQTT | ESP32, Raspberry Pi, IoT gateways | paho-mqtt |
| Modbus/TCP | PLCs, energy meters, RTUs | pymodbus |
| OPC-UA | Siemens, Beckhoff, modern factory equipment | opcua-asyncio |
| HTTP API | Smart sensors, weather stations | aiohttp |
| CAN bus | Vehicle telemetry, robotics | python-can |
| RS-232/485 | Legacy industrial transmitters | Hardware Bridge + pyserial |
The AI agent picks the right library based on your chat description. No need to configure anything manually.
Example 1: ESP32 Temperature Sensor → Telegram Alerts
Hardware: ESP32 dev board + DHT22 sensor (data pin → GPIO4, VCC → 3.3V, GND → GND).
MicroPython firmware on ESP32 — reads DHT22 and publishes every 10 seconds to an MQTT broker:
import machine, dht, utime, ubinascii, ujson
from umqtt.simple import MQTTClient
sensor = dht.DHT22(machine.Pin(4))
client = MQTTClient("esp32_" + ubinascii.hexlify(machine.unique_id()).decode(),
"192.168.1.100", user="biont", password="secret")
client.connect()
while True:
sensor.measure()
payload = ujson.dumps({"temp": sensor.temperature(), "hum": sensor.humidity()})
client.publish("factory/sensors/room1", payload)
utime.sleep(10)
Connecting ASI Biont — you simply type in chat:
Connect to MQTT broker at 192.168.1.100, topic
factory/sensors/room1. Parse JSON, and if temperature > 30°C, send me a Telegram alert.
The AI generates and runs a Python script using paho-mqtt. But since loop_forever() would exceed the 30-second sandbox timeout, the AI sets up a short-lived subscriber that polls for a few seconds or schedules the check via the system's task API. The generated code looks like this (simplified):
import paho.mqtt.client as mqtt
import json, requests
def on_message(client, userdata, msg):
data = json.loads(msg.payload)
if data["temp"] > 30:
requests.post(f"https://api.telegram.org/bot{TOKEN}/sendMessage",
data={"chat_id": CHAT_ID, "text": f"Temp {data['temp']}°C!"})
client = mqtt.Client()
client.username_pw_set("biont", "secret")
client.on_message = on_message
client.connect("192.168.1.100")
client.subscribe("factory/sensors/room1")
client.loop_start()
# ... runs for a short window, then closes
Because the AI writes the code, you don't need to worry about the exact implementation. You just state the logic.
Example 2: Modbus/TCP Industrial Controller
Many factories still rely on Modbus. Let's say you have a temperature transmitter on a PLC at 192.168.1.50:502, holding register 0x0001 with a scale factor of 0.1.
In the ASI Biont chat:
Read holding register 0x0001 from Modbus device at 192.168.1.50, unit 1. Scale by 0.1 and tell me the current temperature.
The AI runs:
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient("192.168.1.50", port=502)
client.connect()
result = client.read_holding_registers(0x0001, 1, unit=1)
temp = result.registers[0] * 0.1
client.close()
print(f"Temperature: {temp}°C")
For RS-485 Modbus, you'd use the Hardware Bridge to expose the COM port, then tell the AI the port name. The bridge is downloaded from the ASI Biont dashboard, not GitHub.
Example 3: OPC-UA for Modern Smart Sensors
OPC-UA is the backbone of Industry 4.0. ASI Biont supports it via opcua-asyncio. You describe a node address:
Connect to opc.tcp://192.168.1.200:4840 and read the value of
ns=2;i=5.
The AI handles the sys calls automatically and returns the current value, often in the middle of a broader analysis (e.g., "Historize temperature every minute and compute the average over the last hour").
The Universal execute_python Fallback
Don't see your protocol in the table? ASI Biont's execute_python tool lets the AI write any Python script — using pyserial for a custom GPS logger, paramiko to SSH into a Linux gateway I/O, or aiohttp for a REST sensor API. The user never has to write a single line of code. Just describe the device, the IP, the baud rate, API key, or whatever is needed, and the AI builds the integration in seconds. This means almost any sensor or telemetry system can be connected today — no waiting for vendor SDKs.
Why This Integration Matters
- No dashboards to build — just ask questions in chat.
- Immediate alerting — Telegram, email, or webhooks directly from sensor thresholds.
- Protocol agnostic — from RS-232 to gRPC, the AI adapts.
- Scalable — add new devices by describing them, not by writing code.
Industry analysts have noted that AI-driven telemetry management is shifting from dashboard-based monitoring to conversational AI. ASI Biont embodies this shift, enabling engineers and operators to interact with their sensor data as if talking to a colleague.
Try It Yourself
Connecting your own sensors and telemetry to ASI Biont takes less than a minute. Just open the chat on asibiont.com, write something like "Read the temperature from my Modbus device at 192.168.1.50", and the AI handles the rest. It's the fastest way from raw data to intelligent decisions.
Comments