调用海康云眸开放平台设备控制类接口,包括设备布撤防、布撤防状态查询、云台控制、远程抓图、设备 OSD 设置与查询、设备校时与 NTP 服务器配置、设备存储卡初始化与进度查询。用户提到设备序列号、通道号、布防/撤防、抓图、云台转动、OSD 设置、校时、NTP 配置、存储卡初始化等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。
按固定链路执行海康云眸开放平台设备控制类接口,优先使用 {baseDir}/scripts/hikopendevice_control.py,不要临时手写认证、URL 拼接和重试逻辑。
本技能只处理以下能力:
本技能不对外暴露 获取 access_token 操作。鉴权属于内部基础设施:脚本会自动读取凭证、获取 token、缓存 token,并在 401 时自动刷新后重试一次。
当 OpenClaw 通过 ~/.openclaw/openclaw.json 管理本技能时,使用 metadata.openclaw.skillKey 作为配置键:
json5
{
skills: {
entries: {
hik-cloud-device-control: {
enabled: true,
env: {
HIKOPENCLIENT_ID: ...,
HIKOPENCLIENT_SECRET: ...,
HIKOPENBASE_URL: https://your-custom-base-url
}
}
}
}
}
若 Session 运行在 sandbox 中,宿主环境变量不会自动继承。此时应通过 OpenClaw 的 sandbox env 配置注入凭证,而不是依赖本机 shell 的 process.env。
域名切换优先级:
需要切换环境时,可通过 HIKOPENBASE_URL 指定自定义域名。认证接口和设备接口都跟随同一个 base URL。
先准备环境变量:
bash
export HIKOPENCLIENTID=
export HIKOPENCLIENTSECRET=
切换到自定义环境域名:
bash
export HIKOPENBASE_URL=https://your-custom-base-url
设备布防:
bash
python3 {baseDir}/scripts/hikopendevice_control.py arm-set \
--device-serial K05818510 \
--is-defence 1
查询布撤防状态:
bash
python3 {baseDir}/scripts/hikopendevice_control.py arm-get \
--device-serial K05818510
开始云台控制:
bash
python3 {baseDir}/scripts/hikopendevice_control.py ptz-start \
--device-serial D20591677 \
--channel-no 1 \
--direction 9 \
--speed 2 \
--mode 0
停止云台控制:
bash
python3 {baseDir}/scripts/hikopendevice_control.py ptz-stop \
--device-serial D20591677 \
--channel-no 1 \
--direction 9
远程抓图:
bash
python3 {baseDir}/scripts/hikopendevice_control.py capture \
--device-serial D20591677 \
--channel-no 1 \
--quality 0
设备校时:
bash
python3 {baseDir}/scripts/hikopendevice_control.py time-set \
--device-serial C13032017 \
--time-mode NTP
获取设备校时配置:
bash
python3 {baseDir}/scripts/hikopendevice_control.py time-get \
--device-serial C13032017
配置 NTP 服务器:
bash
python3 {baseDir}/scripts/hikopendevice_control.py ntp-set \
--device-serial C13032017 \
--ntp-server-id 1 \
--addressing-format-type hostname \
--host-name time.windows.com \
--port-no 123 \
--synchronize-interval 1440
获取指定 NTP 服务器配置:
bash
python3 {baseDir}/scripts/hikopendevice_control.py ntp-config-get \
--device-serial C13032017 \
--ntp-server-id 1
存储卡初始化:
bash
python3 {baseDir}/scripts/hikopendevice_control.py storage-init \
--device-serial 123456
存储卡初始化进度查询:
bash
python3 {baseDir}/scripts/hikopendevice_control.py storage-init-progress \
--device-serial 123456
设置 OSD 名称:
bash
python3 {baseDir}/scripts/hikopendevice_control.py osd-set-name \
--device-serial K05818510 \
--channel-no 1 \
--osd-name 前厅1号机
查询 OSD 名称:
bash
python3 {baseDir}/scripts/hikopendevice_control.py osd-get-name \
--device-serial G29746408 \
--channel-no 1
配置 OSD:
bash
python3 {baseDir}/scripts/hikopendevice_control.py osd-config \
--device-serial K05818510 \
--channel-no 1 \
--channel-name-osd-enabled true \
--channel-name-osd-position-x 700 \
--channel-name-osd-position-y 500
通用参数:
通用环境变量:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 hik-cloud-device-control-1776063146 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 hik-cloud-device-control-1776063146 技能
skillhub install hik-cloud-device-control-1776063146
文件大小: 13.5 KB | 发布时间: 2026-4-14 12:57