Agent Skills
AIIOTLayer
IoT platform integration (ThingsBoard-based) for managing devices, assets, and telemetry
AIIOTLayer Integration Setup Guide
The AIIOTLayer integration provides IoT device management capabilities for AINexLayer agents using the ThingsBoard platform.
Overview
Agents can:
- Get all devices in aiiotlayer
- Get device details and telemetry data
- Get water meter readings (temperature, water flow, water level)
- List all dashboards
- Query device-specific telemetry values
- Manage devices, assets, customers, alarms, and users
Setup
Step 1: Copy Files
Copy the integration files to the active plugins directory:
# Linux/Mac
mkdir -p backend/storage/plugins/agent-skills/aiiotlayer
cp -r path/to/aiiotlayer/* backend/storage/plugins/agent-skills/aiiotlayer/
# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "backend\storage\plugins\agent-skills\aiiotlayer"
Copy-Item -Path "path\to\aiiotlayer\*" -Destination "backend\storage\plugins\agent-skills\aiiotlayer\" -Recurse -ForceStep 2: Get API Key
- Log in to aiiotlayer UI at
http://localhost:8080 - Navigate to System Settings → Security Settings → API Keys
- Click "+" or "Add API Key" to create a new API key
- Enter a name (e.g., "AINexLayer Integration")
- Select TENANT_ADMIN scope (minimum)
- Copy the API key (starts with
tb_)
Important: This plugin only works with API keys (starting with tb_), not JWT tokens.
Step 3: Configure in AINexLayer
- Navigate to Workspace Settings → Agent Skills
- Find AIIOTlayer in the list
- Configure:
- TB_BASE_URL: Base URL of your aiiotlayer instance (e.g.,
http://localhost:8080) - TB_API_KEY: Your API key (must start with
tb_)
- TB_BASE_URL: Base URL of your aiiotlayer instance (e.g.,
- Save configuration
Step 4: Restart AINexLayer
Restart your AINexLayer server for changes to take effect.
Usage Examples
User: "Show me all devices in aiiotlayer"
AI: [Calls get_devices and displays list]
User: "What is the current temperature?"
AI: [Calls get_temperature and displays value]
User: "Show me water meter readings"
AI: [Calls get_water_meter_readings and displays all readings]
User: "What is the water flow?"
AI: [Calls get_water_flow and displays value]
User: "List all dashboards"
AI: [Calls get_dashboards and displays list]Available Operations
Devices (Full CRUD)
get_devices- List all devicesget_device- Get specific device details by IDcreate_device- Create a new deviceupdate_device- Update an existing devicedelete_device- Delete a device
Assets (Full CRUD)
get_assets- List all assetsget_asset- Get specific asset details by IDcreate_asset- Create a new assetupdate_asset- Update an existing assetdelete_asset- Delete an asset
Customers (Full CRUD)
get_customers- List all customersget_customer- Get specific customer details by IDcreate_customer- Create a new customerupdate_customer- Update an existing customerdelete_customer- Delete a customer
Telemetry (Read-only)
get_device_telemetry- Get telemetry data for a deviceget_water_meter_readings- Get all water meter readingsget_temperature- Get current temperature readingget_water_flow- Get current water flow readingget_water_level- Get current water level reading
Alarms
get_alarms- List all alarms (can filter by entity type, entity ID, status)get_alarm- Get specific alarm detailscreate_alarm- Create a new alarm for an entityack_alarm- Acknowledge an alarmclear_alarm- Clear an alarm
Dashboards (Read-only)
get_dashboards- List all dashboards in aiiotlayer
Troubleshooting
Error: "aiiotlayer base URL is not configured"
- Check that
TB_BASE_URLis set in the plugin configuration - Verify the URL is correct (no trailing slash)
- Ensure the URL is accessible from AINexLayer server
Error: "aiiotlayer API key is not configured"
- Make sure
TB_API_KEYis set in the plugin configuration - Verify the API key is correct (must start with
tb_) - This plugin only works with API keys, not JWT tokens
- Get a new API key from: System Settings → Security Settings → API Keys
Error: "Device not found"
- Check that the device ID is correct
- Verify the device exists in aiiotlayer
- Ensure the API key has permissions to view the device
Authentication Errors (401/403)
- Verify API key is correct and starts with
tb_ - Check API key permissions in aiiotlayer
- Ensure API key has TENANT_ADMIN scope
- Try creating a new API key
