← Back to Skills Marketplace
closeli-open

Closeli Open Device status Query

by CloseliOpenTeam · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ Security Clean
138
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install api-device-status
Description
Closeli Device Status Query API. Used to query the current status of specified devices and supports determining whether a device is online, offline, or sleep...
README (SKILL.md)

Device Status Query API

POST /api/device/status is used to batch query the online/offline status of devices.

⚠️ Display Rules (MUST be strictly followed)

The script outputs structured data in JSON format, which is the expected behavior. The display rules below are formatting instructions for the agent: the agent MUST parse the JSON output from the script, convert it into a user-friendly format according to the following rules before displaying it, and MUST NOT display the raw JSON directly.

The script output includes the _device_names field (device_id → device_name mapping), which is used to display device names.

  1. When code == 0 and data is not empty, display it as a table:
Device Name MAC Address Status
Living Room Camera aabbccddeeff 🟢 Online
Front Door Camera 112233445566 🔴 Offline

Key rules:

  • Look up the device name corresponding to device_id from _device_names; if not found, display "Unknown Device"
  • device_id MUST be displayed as the MAC address after removing the xxxxS_ prefix
  • Status mapping: "online"🟢 Online, "offline"🔴 Offline
  1. When data is an empty {}, reply: "None of the requested devices belong to the current user. No queryable devices are available."
  2. When code != 0, reply: "API call failed, error code {code}, reason: {message}"

Prerequisites

The script depends on httpx. If it is not installed, the script will prompt python3 -m pip install httpx.

Configuration Declaration

This skill depends on the following configuration items. The agent and user MUST confirm that they are correctly configured before running.

Required Configuration

Configuration Item Delivery Method Description
AI_GATEWAY_API_KEY Environment variable (recommended), ~/.openclaw/.env (fallback), command line --api-key API key used for API authentication. The script automatically retrieves it according to this priority order

Optional Configuration

Configuration Item Delivery Method Default Value Description
AI_GATEWAY_HOST Environment variable, ~/.openclaw/.env https://ai-open.icloseli.com Gateway address
AI_GATEWAY_VERIFY_SSL Environment variable true Set to false to disable TLS certificate verification (development environments only)
AI_GATEWAY_NO_ENV_FILE Environment variable false Set to true to disable fallback reading from ~/.openclaw/.env (recommended for production environments)

Fallback Configuration Path

By default, the script reads the ~/.openclaw/.env file as the fallback configuration source. This file is shared by all skills and uses the format KEY=VALUE (one per line). In production environments, you MUST set AI_GATEWAY_NO_ENV_FILE=true to disable this fallback and instead pass all configuration directly through environment variables.

Security Notes

  • The shared credential file ~/.openclaw/.env can be read by all skills under the same user. In production environments, you MUST pass API_KEY through environment variables and MUST NOT rely on the shared credential file
  • TLS certificate verification is enabled by default. You MUST NOT disable it in production environments (disabling it introduces man-in-the-middle attack risks, and attackers may intercept API_KEY and device data)
  • Before use, you MUST confirm that AI_GATEWAY_HOST points to a trusted domain
  • You MUST use a least-privilege API_KEY to avoid reusing high-privilege credentials. This skill only requires device status query permission

Network Access Declaration

This skill only accesses the following endpoints (all under AI_GATEWAY_HOST):

Endpoint Method Purpose
/api/device/list POST Obtain device name mapping
/api/device/status POST Query device online/offline status

The script does not access any other network resources.

Quick Start

python3 check_status.py --device-ids "xxxxS_aabbccddeeff"

Query multiple devices (comma-separated):

python3 check_status.py --device-ids "xxxxS_aabbccddeeff,xxxxS_112233445566"

Request Format

Request Body

Parameter Name Type Required Description
device_ids string[] Yes Device ID list, cannot be an empty array. Format: xxxxS_\x3Cmac>

Response Format

{
  "code": 0,
  "message": "success",
  "request_id": "\x3C32-character request trace ID>",
  "data": {
    "xxxxS_aabbccddeeff": { "status": "online" },
    "xxxxS_112233445566": { "status": "offline" }
  },
  "_device_names": {
    "xxxxS_aabbccddeeff": "Living Room Camera",
    "xxxxS_112233445566": "Front Door Camera"
  }
}

data Field (Map Structure)

The key is device_id, and the value is the status object:

Parameter Name Type Description
status string Device status, value is "online" or "offline"

Error Codes

Error Code HTTP Status Code Description
1001 401 api_key not provided
1002 401 api_key is invalid or disabled
2001 400 Missing required parameter (device_ids is an empty array)
3001 502 Internal gateway service call failed
3002 502 Internal gateway service call failed
3004 502 Internal gateway service call failed
5000 500 Internal error

Notes

  • device_ids cannot be an empty array, otherwise error code 2001 is returned
  • IMPORTANT: device_id is case-sensitive. The prefix MUST be lowercase xxxxS_, NOT uppercase XXXXS_. The script will auto-correct the case, but the agent SHOULD always pass the correct lowercase format
  • Devices that do not belong to the current user are silently filtered and do not return an error
  • Global request timeout is 120 seconds
Usage Guidance
This skill appears to do what it says: query device status from a gateway using an API key. Before installing: (1) Supply a least-privilege AI_GATEWAY_API_KEY (only device-status permission). (2) Verify AI_GATEWAY_HOST is a trusted domain. (3) In production set AI_GATEWAY_NO_ENV_FILE=true so the script does not read the shared ~/.openclaw/.env (that file can contain other skills' secrets). (4) Pre-install httpx or allow the script to prompt you to pip-install it. Note: the registry metadata in the summary lists no required config path, but the SKILL.md and script do read ~/.openclaw/.env as a fallback — confirm how your deployment will handle that file if you proceed.
Capability Analysis
Type: OpenClaw Skill Name: api-device-status Version: 1.0.2 The skill is a legitimate tool for querying IoT device status via the Closeli API. The Python script (check_status.py) and documentation (SKILL.md) are well-structured, align with the stated purpose, and include explicit security warnings regarding the use of shared credential files (~/.openclaw/.env). No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The skill is a Python script that queries device status via a gateway API; requiring python3 and an API key (AI_GATEWAY_API_KEY) matches the described purpose. Declared network endpoints (/api/device/list and /api/device/status) align with the description.
Instruction Scope
SKILL.md and check_status.py are consistent: the script fetches a device-name map and status and prints JSON. The SKILL.md display rules instruct the agent to format that JSON for users. The instructions do not ask the agent to read unrelated files or send data to unexpected endpoints. They do require the agent to parse and render the script output rather than showing raw JSON.
Install Mechanism
This is an instruction-only skill with no install spec (lowest install risk). The script depends on the third-party Python package httpx; the script prompts the user to pip-install it if missing. There is no packaged install step or remote download of code.
Credentials
The single required credential (AI_GATEWAY_API_KEY) is appropriate for querying the gateway. However, the script will fallback to reading ~/.openclaw/.env unless AI_GATEWAY_NO_ENV_FILE=true; that shared file may contain other skills' credentials. SKILL.md explicitly documents this fallback and recommends disabling it in production. Also optional env vars (AI_GATEWAY_HOST, AI_GATEWAY_VERIFY_SSL, AI_GATEWAY_NO_ENV_FILE) are documented and used by the script.
Persistence & Privilege
The skill does not request persistent/always-on inclusion and does not modify other skills or system-wide settings. It only reads configuration and uses the provided API key at runtime.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install api-device-status
  3. After installation, invoke the skill by name or use /api-device-status
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
- SKILL.md updated from Chinese to English for broader accessibility. - Gateway default domain changed from `ai-open-gateway.closeli.cn` to `ai-open.icloseli.com`. - Explicit note added: device_id is case-sensitive, prefix must be lowercase (`xxxxS_`); the script auto-corrects case but agent should pass correct format. - Minor clarifications in configuration priority and security practices. - No functional or file changes detected in this version.
v1.0.1
- 更新了描述,强调环境变量和安全要求,说明 AI_GATEWAY_API_KEY 需从 APP 获取并使用最小权限 - 适当精简说明用途与场景,明确适合在使用设备前判断其可用状态 - 展示规则、配置项、安全事项等核心内容无变动 - 文件整体更简洁,聚焦设备状态查询及相关安全合规信息
v1.0.0
Initial release of device status checking skill: - Provides batch device online/offline status query via POST /api/device/status. - Added script check_status.py for status checks; removed get_live_url.py. - New output formatting: online/offline results shown in a user-friendly table. - Updated instructions for querying multiple device IDs at once. - Requires AI_GATEWAY_API_KEY; supports optional config overrides. - Only necessary endpoints are accessed for name and status lookups.
Metadata
Slug api-device-status
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Closeli Open Device status Query?

Closeli Device Status Query API. Used to query the current status of specified devices and supports determining whether a device is online, offline, or sleep... It is an AI Agent Skill for Claude Code / OpenClaw, with 138 downloads so far.

How do I install Closeli Open Device status Query?

Run "/install api-device-status" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Closeli Open Device status Query free?

Yes, Closeli Open Device status Query is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Closeli Open Device status Query support?

Closeli Open Device status Query is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Closeli Open Device status Query?

It is built and maintained by CloseliOpenTeam (@closeli-open); the current version is v1.0.2.

💬 Comments