Manage ThingsBoard devices, dashboards, telemetry, and users via the ThingsBoard REST API.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install thingsboard-skill或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install thingsboard-skill⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/thingsboard-skill/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: thingsboard description: Manage ThingsBoard devices, dashboards, telemetry, and users via the ThingsBoard REST API. homepage: https://thingsboard.io metadata: {"clawdbot":{"emoji":"📊","requires":{"bins":["jq","curl"],"env":["TB_URL","TB_USERNAME","TB_PASSWORD"]}}} ---
Manage ThingsBoard IoT platform resources including devices, dashboards, telemetry data, and users.
credentials.json:```json [ { "name": "Server Thingsboard", "url": "http://localhost:8080", "account": [ { "sysadmin": { "email": "[email protected]", "password": "sysadmin" } }, { "tenant": { "email": "[email protected]", "password": "tenant" } } ] } ] ```
```bash export TB_URL="http://localhost:8080" export TB_USERNAME="[email protected]" export TB_PASSWORD="tenant" ```
```bash export TB_TOKEN=$(curl -s -X POST "$TB_URL/api/auth/login" \ -H "Content-Type: application/json" \ -d "{\"username\":\"$TB_USERNAME\",\"password\":\"$TB_PASSWORD\"}" | jq -r '.token') ```
All commands use curl to interact with the ThingsBoard REST API.
Login and get token:
curl -s -X POST "$TB_URL/api/auth/login" \
-H "Content-Type: application/json" \
-d "{\"username\":\"$TB_USERNAME\",\"password\":\"$TB_PASSWORD\"}" | jq -r '.token'
Refresh token (when expired):
curl -s -X POST "$TB_URL/api/auth/token" \
-H "Content-Type: application/json" \
-d "{\"refreshToken\":\"$TB_REFRESH_TOKEN\"}" | jq -r '.token'
Get current user info:
curl -s "$TB_URL/api/auth/user" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
List all tenant devices:
curl -s "$TB_URL/api/tenant/devices?pageSize=100&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[] | {name, id: .id.id, type}'
Get device by ID:
curl -s "$TB_URL/api/device/{deviceId}" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get device credentials:
curl -s "$TB_URL/api/device/{deviceId}/credentials" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get telemetry keys:
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/keys/timeseries" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get latest telemetry:
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/values/timeseries?keys=temperature,humidity" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get timeseries data with time range:
START_TS=$(($(date +%s)*1000 - 3600000)) # 1 hour ago
END_TS=$(($(date +%s)*1000)) # now
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/values/timeseries?keys=temperature&startTs=$START_TS&endTs=$END_TS&limit=100" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get attribute keys:
# Client scope
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/keys/attributes/CLIENT_SCOPE" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
# Shared scope
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/keys/attributes/SHARED_SCOPE" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
# Server scope
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/keys/attributes/SERVER_SCOPE" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get attributes by scope:
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/values/attributes/CLIENT_SCOPE?keys=attribute1,attribute2" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Save device attributes:
curl -s -X POST "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/attributes/SERVER_SCOPE" \
-H "X-Authorization: Bearer $TB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"attribute1":"value1","attribute2":"value2"}' | jq
Delete timeseries keys:
curl -s -X DELETE "$TB_URL/api/plugins/telemetry/DEVICE/{deviceId}/timeseries/delete?keys=oldKey1,oldKey2&deleteAllDataForKeys=true" \
-H "X-Authorization: Bearer $TB_TOKEN"
List all dashboards:
curl -s "$TB_URL/api/tenant/dashboards?pageSize=100&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[] | {name, id: .id.id}'
Get dashboard info:
curl -s "$TB_URL/api/dashboard/{dashboardId}" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Make dashboard public:
curl -s -X POST "$TB_URL/api/customer/public/dashboard/{dashboardId}" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
Get public dashboard info (no auth required):
curl -s "$TB_URL/api/dashboard/info/{publicDashboardId}" | jq
Remove public access:
curl -s -X DELETE "$TB_URL/api/customer/public/dashboard/{dashboardId}" \
-H "X-Authorization: Bearer $TB_TOKEN"
List tenant users:
curl -s "$TB_URL/api/tenant/users?pageSize=100&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[] | {email, firstName, lastName, id: .id.id}'
List customers:
curl -s "$TB_URL/api/customers?pageSize=100&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[] | {title, id: .id.id}'
Get customer users:
curl -s "$TB_URL/api/customer/{customerId}/users?pageSize=100&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[]'
List all assets:
curl -s "$TB_URL/api/tenant/assets?pageSize=100&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[] | {name, type, id: .id.id}'
Get asset by ID:
curl -s "$TB_URL/api/asset/{assetId}" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
{entityType: "DEVICE", id: "uuid"}. Use the id field for API calls.pageSize and page parameters (default: 100 items per page, max: 1000). - CLIENT_SCOPE: Client-side attributes (set by devices) - SHARED_SCOPE: Shared between server and devices - SERVER_SCOPE: Server-side only (not visible to devices)
startTs and endTs parameters.https://demo.thingsboard.io).# Complete workflow: Login, list devices, get telemetry
export TB_URL="http://localhost:8080"
export TB_USERNAME="[email protected]"
export TB_PASSWORD="tenant"
# Get token
export TB_TOKEN=$(curl -s -X POST "$TB_URL/api/auth/login" \
-H "Content-Type: application/json" \
-d "{\"username\":\"$TB_USERNAME\",\"password\":\"$TB_PASSWORD\"}" | jq -r '.token')
# List all devices
curl -s "$TB_URL/api/tenant/devices?pageSize=10&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq '.data[] | {name, type, id: .id.id}'
# Get first device ID
DEVICE_ID=$(curl -s "$TB_URL/api/tenant/devices?pageSize=1&page=0" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq -r '.data[0].id.id')
# Get telemetry keys for device
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/$DEVICE_ID/keys/timeseries" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
# Get latest telemetry values
curl -s "$TB_URL/api/plugins/telemetry/DEVICE/$DEVICE_ID/values/timeseries?keys=temperature,humidity" \
-H "X-Authorization: Bearer $TB_TOKEN" | jq
...安装 ThingsBot 后,可以对 AI 说这些话来触发它
Help me get started with ThingsBot
Explains what ThingsBot does, walks through the setup, and runs a quick demo based on your current project
Use ThingsBot to manage ThingsBoard devices, dashboards, telemetry, and users via th...
Invokes ThingsBot with the right parameters and returns the result directly in the conversation
What can I do with ThingsBot in my developer & devops workflow?
Lists the top use cases for ThingsBot, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/thingsboard-skill/ 目录(个人级,所有项目可用),或 .claude/skills/thingsboard-skill/(项目级)。重启 AI 客户端后,用 /thingsboard-skill 主动调用,或让 AI 根据上下文自动发现并使用。
ThingsBot 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
ThingsBot 可免费安装使用。请查阅仓库了解许可证信息。
Manage ThingsBoard devices, dashboards, telemetry, and users via the ThingsBoard REST API.
ThingsBot 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using ThingsBot
Identifies repetitive steps in your workflow and sets up ThingsBot to handle them automatically