Subscribe to sensor feeds and publish commands to IoT devices via MQTT. OE Runtime lets you run a local AI agent that monitors device data, evaluates thresholds, and publishes automated responses — no IoT platform subscription required.
Create a folder called iot-messaging/ and add these two files:
Create SKILL.md inside an iot-messaging/ directory. This is the portable skill — it follows the agentskills.io format and runs unchanged on Claude, Cursor, Windsurf, or OE Runtime:
--- name: iot-messaging description: Publish commands and read sensor data via MQTT license: Apache-2.0 metadata: author: Open Enthrium version: "1.0" --- You are an IoT agent. Subscribe to sensor data feeds and publish commands to devices via MQTT. Format all messages as JSON. Always read current state before publishing any commands. Complete all steps fully before writing your report. ## Step 1: Read Sensor Data Subscribe to the sensor data topic and read the latest 5 messages. Extract: device ID, sensor type, value, unit, and timestamp for each message. ## Step 2: Evaluate and Publish Command Analyze the sensor readings: - If any temperature reading exceeds 30°C, publish a cooling command to the control topic - If any humidity reading exceeds 80%, publish a ventilation command - Otherwise publish a status check ping to the control topic All commands must be JSON with fields: action, device_id, timestamp, triggered_by. ## Step 3: Report Summarize IoT activity: - Sensor readings received (device, value, unit) - Any threshold breaches detected - Commands published (topic, payload) - Current system status (normal / alert)
Create agent.yaml in the same directory to wire the skill to your connector:
name: IoT Agent description: Publish commands and read sensor data via MQTT connectors: - connection_name: MQTT Broker connection_type: mqtt skills: - path: ./ trigger_type: auto
Create oe-config.json in the same directory:
{
"llm": {
"provider": "openai",
"model": "gpt-4o",
"apiKey": "YOUR_OPENAI_API_KEY"
},
"server": {
"enabled": false,
"port": 3333,
"apiKey": "your-secret-api-key"
},
"connectors": [
{
"connection_name": "MQTT Broker",
"connection_type": "mqtt",
"broker": "mqtt://localhost:1883",
"clientId": "oe-runtime",
"topic": "devices/#",
"username": "YOUR_MQTT_USER",
"password": "YOUR_MQTT_PASSWORD"
}
]
}Replace the broker URL with your MQTT broker address. This works with any MQTT broker including Mosquitto, HiveMQ, AWS IoT Core, and Azure IoT Hub. Remove username/password fields if your broker does not require authentication.
From the parent folder containing your skill directory:
| Method | Best for | Download | |
|---|---|---|---|
| 1 | npx recommended | No install needed — always runs the latest version | — |
| 2 | Windows .exe | Download once, run offline on Windows | ⊞ Windows (.exe) |
| 3 | macOS binary | Download once, run offline on Mac | macOS |
| 4 | Linux binary | Server deployments, cron jobs, Docker | 🐧 Linux |
| 5 | API Server integration | Call from any app, webhook, or automation pipeline | 📮 Postman Collection |
npx -y @openenthrium/oe-runtime@latest ./iot-messaging
oe-runtime-win.exe ./iot-messaging
chmod +x oe-runtime-macos
./oe-runtime-macos ./iot-messaging
First run blocked? System Settings → Privacy & Security → Allow Anyway.
chmod +x oe-runtime-linux
./oe-runtime-linux ./iot-messaging
Add a "server" block to oe-config.json, then start with --serve:
{
"llm": { ... },
"server": { "enabled": true, "port": 3333, "apiKey": "your-secret-key" },
"connectors": [ ... ]
}
npx -y @openenthrium/oe-runtime@latest --serve --config oe-config.json
Run with inline YAML:
curl -X POST http://localhost:3333/run \
-H "Content-Type: application/json" \
-H "X-API-Key: your-secret-key" \
-d '{"yaml": "...", "params": {}}'
Or run from a file on the server:
curl -X POST http://localhost:3333/run-file \
-H "Content-Type: application/json" \
-H "X-API-Key: your-secret-key" \
-d '{"file": "/path/to/agent.yaml", "params": {}}'
Download OE Runtime and run any AI agent locally or as a server — no cloud required.
Get OE Runtime →