← 返回 Skills 市场
liunian1010

Hik Cloud Device Alarm Capability Management

作者 hik-cloud-open · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
138
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hik-cloud-device-alarm-capability-management
功能描述
调用海康云眸开放平台设备报警能力管理接口,包括获取常规报警能力列表、修改报警能力状态和设置智能检测开关。用户提到报警能力、移动侦测、视频遮挡、区域入侵、智能检测开关等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。
使用说明 (SKILL.md)

海康云眸设备报警能力管理

Overview

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

本技能只处理以下能力:

  • 获取设备常规报警能力列表
  • 修改报警能力状态
  • 设备智能检测开关状态

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

OpenClaw 配置

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

{
  skills: {
    entries: {
      "hik-cloud-device-alarm-capability-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. 报警能力状态修改使用 channelId,不是 channelNo
  7. 智能检测开关接口仅适用于萤石设备。
  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_alarm_capability_management.py list \
  --device-serial 123456789

修改报警能力状态:

python3 {baseDir}/scripts/hik_open_device_alarm_capability_management.py update-status \
  --channel-id 4da6ac157d61421999b82d4aa6e1e64e \
  --ability-code 10600 \
  --status 1

设置智能检测开关:

python3 {baseDir}/scripts/hik_open_device_alarm_capability_management.py intelligence-switch \
  --device-serial 123456 \
  --enable 1 \
  --channel-no 1 \
  --type 302

子命令说明

  • list:获取设备常规报警能力列表
  • update-status:修改报警能力状态
  • intelligence-switch:设置设备智能检测开关

返回结果重点:

  • list 重点看顶层 code / messagedata[].abilityCode / data[].status
  • update-status 重点看 channelId + abilityCode + status,返回后看顶层 code / message
  • intelligence-switch 重点看 deviceSerial + enable + type,返回后看 code / successmessage 为可选提示字段

字段选择:

  • abilityCode 是常规报警能力编码,适用于 list / update-status
  • status 是常规报警能力状态,适用于 list / update-status
  • type 是智能检测开关类型,适用于 intelligence-switch
  • abilityCodetype 不能混用

通用参数:

  • --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_alarm_capability_management.py:主脚本,负责认证、缓存和报警能力接口调用
  • {baseDir}/references/auth.md:认证与 token 自动刷新规则
  • {baseDir}/references/device-alarm-capability-management.md:设备报警能力管理文档摘要
安全使用建议
This skill appears to do exactly what it says: call Hik-Cloud APIs to list and modify alarm capabilities. Before installing, consider: (1) you must supply HIK_OPEN_CLIENT_ID and HIK_OPEN_CLIENT_SECRET — the skill will use these to obtain OAuth tokens and call the Hik-Cloud API; (2) an access token will be cached on disk at ~/.cache/hik_open/token.json — if you are concerned about token persistence, change the --token-cache-file or secure that path and rotate credentials after use; (3) if you run sessions in a sandbox, inject credentials via the sandbox config rather than relying on host env vars; (4) verify the base URL if you need to target a test environment (use --base-url or HIK_OPEN_BASE_URL); (5) avoid pasting secrets into chat — use environment variables. Overall the footprint is coherent and proportionate to the stated purpose.
功能分析
Type: OpenClaw Skill Name: hik-cloud-device-alarm-capability-management Version: 1.0.0 The skill bundle is a legitimate tool for managing Hik-Cloud device alarm capabilities. The Python script (hik_open_device_alarm_capability_management.py) implements standard OAuth2 authentication and interacts with official Hikvision endpoints (api2.hik-cloud.com) using only Python standard libraries. It handles credentials via environment variables and local caching in a standard directory (~/.cache/hik_open/), with no evidence of data exfiltration, malicious execution, or harmful prompt injection.
能力评估
Purpose & Capability
Name/description match the requested artifacts: python3, HIK_OPEN_CLIENT_ID, and HIK_OPEN_CLIENT_SECRET are appropriate for calling Hik-Cloud OAuth and the documented APIs. No unrelated services or credentials are requested.
Instruction Scope
SKILL.md instructs running the included Python script, documents the exact endpoints and parameters, and limits operations to listing/setting alarm capabilities and intelligence switch. It does not instruct reading unrelated files or sending data to third-party endpoints.
Install Mechanism
No install script or remote downloads; this is instruction+embedded script only. The runtime relies on system python3 and included code, which is low-risk compared with remote installs.
Credentials
Requested env vars (client id/secret) are proportionate for OAuth. The skill optionally reads HIK_OPEN_ACCESS_TOKEN and will cache tokens to ~/.cache/hik_open/token.json — this is expected but means an access token will be persisted on disk. Consider whether you want tokens stored locally and ensure appropriate file permissions.
Persistence & Privilege
always:false (normal). The script persists a token cache under the user's home (~/.cache/hik_open/token.json) and may create that directory; this is reasonable for token reuse but is persistent state to be aware of.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hik-cloud-device-alarm-capability-management
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hik-cloud-device-alarm-capability-management 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of hik-cloud-device-alarm-capability-management skill. - Supports listing, modifying, and setting intelligent detection switches for Hikvision cloud device alarm capabilities. - Handles access token retrieval, caching, and refreshing automatically; token management is not exposed to users. - Flexible endpoint/domain and token source configuration via command-line or environment variables. - Provides structured output for both text and JSON formats. - Includes clear usage, parameter, and result documentation for all supported commands.
元数据
Slug hik-cloud-device-alarm-capability-management
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Hik Cloud Device Alarm Capability Management 是什么?

调用海康云眸开放平台设备报警能力管理接口,包括获取常规报警能力列表、修改报警能力状态和设置智能检测开关。用户提到报警能力、移动侦测、视频遮挡、区域入侵、智能检测开关等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 138 次。

如何安装 Hik Cloud Device Alarm Capability Management?

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

Hik Cloud Device Alarm Capability Management 是免费的吗?

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

Hik Cloud Device Alarm Capability Management 支持哪些平台?

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

谁开发了 Hik Cloud Device Alarm Capability Management?

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

💬 留言讨论