← 返回 Skills 市场
liunian1010

Hik Cloud Device Channel Management

作者 hik-cloud-open · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
137
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hik-cloud-device-channel-management
功能描述
调用海康云眸开放平台设备通道管理接口,包括查询设备下通道列表、同步设备下通道、修改通道名称和同步设备通道名称。用户提到通道列表、通道同步、通道重命名、channelNo、channelName 等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。
使用说明 (SKILL.md)

海康云眸设备通道管理

Overview

按固定链路执行海康云眸开放平台设备通道管理接口,优先使用 {baseDir}/scripts/hik_open_device_channel_management.py,不要临时手写认证、URL 拼接和重试逻辑。

本技能只处理以下能力:

  • 查询设备下通道列表
  • 同步设备下通道
  • 修改通道名称
  • 同步设备通道名称

本技能不对外暴露 “获取 access_token” 操作。鉴权属于内部基础设施:脚本会自动读取凭证、获取 token、缓存 token,并在 401 时自动刷新后重试一次。

OpenClaw 配置

当 OpenClaw 通过 ~/.openclaw/openclaw.json 管理本技能时,使用 metadata.openclaw.skillKey 作为配置键:

{
  skills: {
    entries: {
      "hik-cloud-device-channel-management": {
        enabled: true,
        env: {
          HIK_OPEN_CLIENT_ID: "...",
          HIK_OPEN_CLIENT_SECRET: "...",
          HIK_OPEN_BASE_URL: "https://your-custom-base-url"
        }
      }
    }
  }
}

若 Session 运行在 sandbox 中,宿主环境变量不会自动继承。此时应通过 OpenClaw 的 sandbox env 配置注入凭证,而不是依赖本机 shell 的 process.env

域名切换优先级:

  1. --base-url
  2. HIK_OPEN_BASE_URL
  3. 默认正式环境:https://api2.hik-cloud.com

执行规则

  1. 认证固定使用 Authorization: Bearer \x3Caccess_token>
  2. token 来源优先级:
    • --access-token
    • HIK_OPEN_ACCESS_TOKEN
    • token cache
    • HIK_OPEN_CLIENT_ID + HIK_OPEN_CLIENT_SECRET 自动换取
  3. 域名来源优先级:
    • --base-url
    • HIK_OPEN_BASE_URL
    • 默认正式环境 https://api2.hik-cloud.com
  4. 若业务接口返回 HTTP 401,自动刷新 token 并重试一次。
  5. 若接口返回非成功状态,直接返回真实错误,不臆造结果。
  6. 修改通道名称时,若 --sync-local 1,设备需在线才能同步成功。
  7. 通道列表中的 channelStatus=-1 一般表示该通道未关联设备。
  8. 用户若要求“展示 token / 返回 token 原文”,说明这不属于本技能的主要职责;仅在明确要求调试认证链路时再解释。

快速开始

先准备环境变量:

export HIK_OPEN_CLIENT_ID="\x3CYOUR_CLIENT_ID>"
export HIK_OPEN_CLIENT_SECRET="\x3CYOUR_CLIENT_SECRET>"

查询设备下通道列表:

python3 {baseDir}/scripts/hik_open_device_channel_management.py list \
  --device-serial E05426006 \
  --page-no 1 \
  --page-size 50

同步设备下通道:

python3 {baseDir}/scripts/hik_open_device_channel_management.py sync \
  --device-serial E05426006

修改通道名称:

python3 {baseDir}/scripts/hik_open_device_channel_management.py rename \
  --device-serial D20591677 \
  --channel-no 1 \
  --channel-name "修改xxx" \
  --sync-local 0

同步设备通道名称:

python3 {baseDir}/scripts/hik_open_device_channel_management.py sync-names \
  --device-serial E05426006

子命令说明

  • list:查询设备下通道列表
  • sync:同步设备下通道
  • rename:修改通道名称
  • sync-names:同步设备通道名称

字段提示:

  • channelType = 通道类型,重点看 list 返回里的 channelType,常见值是 10300 视频通道、10302 报警输入
  • channelStatus = 通道状态,重点看 list 返回里的 channelStatus0 离线、1 在线、-1 未上报/未关联设备
  • syncLocal = 是否同步到设备本地,重点看 rename 请求里的 syncLocal0 不同步、1 同步到本地;channelName 普通情况下最多 50 个字符,syncLocal=1 时最多 32 个字符,且 syncLocal=1 时设备需在线

通用参数:

  • --base-url:显式指定接口域名,优先级高于环境变量
  • --access-token:显式指定 access token
  • --timeout:请求超时秒数,默认 20
  • --token-cache-file:token 缓存文件,默认 ~/.cache/hik_open/token.json
  • --formattextjson

通用环境变量:

  • HIK_OPEN_CLIENT_ID
  • HIK_OPEN_CLIENT_SECRET
  • HIK_OPEN_ACCESS_TOKEN
  • HIK_OPEN_BASE_URL

输出约定

  • --format text:输出简要结果摘要和关键字段
  • --format json:输出结构化结果,包含请求上下文和原始响应数据

资源说明

  • {baseDir}/scripts/hik_open_device_channel_management.py:主脚本,负责认证、缓存和设备通道接口调用
  • {baseDir}/references/auth.md:认证与 token 自动刷新规则
  • {baseDir}/references/device-channel-management.md:设备通道管理接口摘要
安全使用建议
This skill appears to do what it says: call Hik Cloud device-channel APIs using the provided Python helper. Before installing, verify you are willing to provide HIK_OPEN_CLIENT_ID and HIK_OPEN_CLIENT_SECRET (or an access token) and accept that the tool will store an access_token cache at ~/.cache/hik_open/token.json. Do not set a custom --base-url or HIK_OPEN_BASE_URL to untrusted endpoints (that would redirect API calls to arbitrary servers). If you share the machine or environment, restrict access to the cache file (and avoid putting secrets in global shell profiles). If you want extra assurance, review the included script file; it is small and readable and implements the token flow and API calls described.
功能分析
Type: OpenClaw Skill Name: hik-cloud-device-channel-management Version: 1.0.0 The skill bundle provides a legitimate tool for managing Hik-Cloud device channels via the official Hikvision cloud API (api2.hik-cloud.com). The main script, `scripts/hik_open_device_channel_management.py`, implements standard OAuth2 authentication with local token caching and provides subcommands for listing, syncing, and renaming channels. No evidence of malicious intent, data exfiltration, or prompt injection was found; the code uses standard libraries and adheres strictly to its stated purpose.
能力评估
Purpose & Capability
Name/description match the requested binaries and env vars (python3, HIK_OPEN_CLIENT_ID, HIK_OPEN_CLIENT_SECRET). The script implements token fetch, caching, and the four device-channel APIs described; there are no unrelated cloud providers or extraneous credentials requested.
Instruction Scope
SKILL.md instructs running the included Python script to list/sync/rename channels and documents token resolution priorities. The script accesses network endpoints, environment variables (HIK_*), and reads/writes a token cache (~/.cache/hik_open/token.json). This behavior is expected for an API helper, but it means the skill will store tokens on disk and may be pointed at an arbitrary base URL if overridden.
Install Mechanism
No install spec — the skill is instruction + bundled script and requires an existing python3 binary. No downloads or external installers are performed.
Credentials
Declared env vars (client id/secret, optional access token, optional base URL) are proportional to the Hik OpenAPI purpose. The script caches the fetched access_token to a file in the user's home directory in plaintext; this is functional but a sensitive artifact users should protect (file permissions, shared environments).
Persistence & Privilege
always is false and the skill does not request system-wide privileges or modify other skills. Its persistent side-effect is only the token cache file and optional OpenClaw skill config entries as documented.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hik-cloud-device-channel-management
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hik-cloud-device-channel-management 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the hik-cloud-device-channel-management skill: - Supports querying device channel lists, synchronizing device channels, modifying channel names, and syncing device channel names via Hikvision Cloud Open Platform. - Handles access_token retrieval, caching, and automatic refresh internally; tokens are never exposed to users. - Provides detailed execution rules, configuration guidance, and command-line usage examples. - Prioritizes script-based execution and consistent authentication mechanisms. - Offers both text and JSON output formats for results.
元数据
Slug hik-cloud-device-channel-management
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Hik Cloud Device Channel Management 是什么?

调用海康云眸开放平台设备通道管理接口,包括查询设备下通道列表、同步设备下通道、修改通道名称和同步设备通道名称。用户提到通道列表、通道同步、通道重命名、channelNo、channelName 等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 137 次。

如何安装 Hik Cloud Device Channel Management?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hik-cloud-device-channel-management」即可一键安装,无需额外配置。

Hik Cloud Device Channel Management 是免费的吗?

是的,Hik Cloud Device Channel Management 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Hik Cloud Device Channel Management 支持哪些平台?

Hik Cloud Device Channel Management 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Hik Cloud Device Channel Management?

由 hik-cloud-open(@liunian1010)开发并维护,当前版本 v1.0.0。

💬 留言讨论