Install any skill in seconds. Free to start, no credit card required.
Get Started Free →萤石开放平台云台设备控制技能。支持设备列表查询、设备状态查询、云台控制 (PTZ)、预置点管理等功能。 Use when: 需要控制萤石云台设备、调整摄像头角度、设置预置点。 ⚠️ 安全要求:必须设置 EZVIZ_APP_KEY 和 EZVIZ_APP_SECRET 环境变量,使用最小权限凭证。
.claude/skills/leoyeai-ezviz-open-ptz-control/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-22 | ✗→✓ | ▲ Improved | 403% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 490% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 225% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 445% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 251% | 0% |
萤石开放平台云台设备控制,支持设备查询、云台控制、预置点管理等功能。
在使用此技能前,请完成以下安全检查:
| # | 检查项 | 状态 | 说明 | |---|--------|------|------| | 1 | 凭证权限 | ⚠️ 必需 | 使用最小权限的 AppKey/AppSecret,不要用主账号凭证 | | 2 | Token 缓存 | ⚠️ 注意 | Token 缓存在 /tmp/ezviz_global_token_cache/ (权限 600) | | 3 | API 域名 | ✅ 已验证 | openai.ys7.com 是萤石官方 API 端点(openai = Open API,不是 AI) | | 4 | 代码审查 | ✅ 推荐 | 审查 scripts/main.py 和 lib/token_manager.py |
凭证获取优先级(从高到低):
┌─────────────────────────────────────────────────────────────┐
│ 1. 环境变量 (最高优先级 - 推荐) │
│ ├─ EZVIZ_APP_KEY │
│ └─ EZVIZ_APP_SECRET │
│ ✅ 优点:不读取配置文件,完全隔离 │
├─────────────────────────────────────────────────────────────┤
│ 2. 命令行参数 (最低优先级) │
│ python3 main.py appKey appSecret <command> │
└─────────────────────────────────────────────────────────────┘安全建议:
重要: openai.ys7.com 是萤石官方 API 域名(openai = Open API,不是人工智能)
bash# 验证 API 域名连通性 curl -I https://openai.ys7.com/api/lapp/token/get # 验证 SSL 证书 curl -vI https://openai.ys7.com/api/lapp/token/get 2>&1 | grep -A5 "SSL certificate" # 验证域名所有权 whois ys7.com
官方文档: https://open.ys7.com/
bash# 1. 使用环境变量(优先级最高,避免配置文件意外使用) export EZVIZ_APP_KEY="your_dedicated_app_key" export EZVIZ_APP_SECRET="your_dedicated_app_secret" # 2. 高安全环境:禁用 Token 缓存 export EZVIZ_TOKEN_CACHE=0 # 3. 测试凭证(推荐先用测试账号) # 登录 https://openai.ys7.com/ 创建专用应用,仅开通云台控制相关权限
技能按以下顺序获取凭证(优先级从高到低):
EZVIZ_APP_KEY, EZVIZ_APP_SECRET) ← 推荐bashpip install requests
bashexport EZVIZ_APP_KEY="your_app_key" export EZVIZ_APP_SECRET="your_app_secret"
可选环境变量:
bashexport EZVIZ_TOKEN_CACHE="1" # Token 缓存:1=启用 (默认), 0=禁用
Token 缓存说明:
EZVIZ_TOKEN_CACHE=0 每次重新获取 Token/tmp/ezviz_global_token_cache/global_token_cache.json注意:
EZVIZ_ACCESS_TOKEN!技能会自动获取 Tokenbashpython3 {baseDir}/scripts/main.py
命令行参数:
bash# 查询设备列表 python3 {baseDir}/scripts/main.py appKey appSecret list # 查询设备状态 python3 {baseDir}/scripts/main.py appKey appSecret status BF6985110 # 查询设备能力集 python3 {baseDir}/scripts/main.py appKey appSecret capacity BF6985110 # 云台控制(向上) python3 {baseDir}/scripts/main.py appKey appSecret ptz_start BF6985110 1 0 1 # 停止云台 python3 {baseDir}/scripts/main.py appKey appSecret ptz_stop BF6985110 1 # 调用预置点 python3 {baseDir}/scripts/main.py appKey appSecret preset_move BF6985110 1 1
1. 获取 Token (appKey + appSecret → accessToken)
↓
2. 执行操作 (根据命令调用对应 API)
↓
3. 输出结果 (JSON + 控制台)你不需要手动获取或配置 EZVIZ_ACCESS_TOKEN!
技能会自动处理 Token 的获取:
首次运行:
appKey + appSecret → 调用萤石 API → 获取 accessToken (有效期 7 天)
↓
保存到缓存文件(系统临时目录)
↓
后续运行:
检查缓存 Token 是否过期
├─ 未过期 → 直接使用缓存 Token ✅
└─ 已过期 → 重新获取新 TokenToken 管理特性:
EZVIZ_ACCESS_TOKEN 环境变量EZVIZ_TOKEN_CACHE=0 可禁用缓存(每次运行重新获取)======================================================================
Ezviz Open PTZ Control (萤石开放平台云台设备控制)
======================================================================
[Time] 2026-03-19 10:00:00
[INFO] Command: list
======================================================================
[Step 1] Getting access token...
======================================================================
[INFO] Using cached global token, expires: 2026-03-26 10:00:00
[SUCCESS] Using cached token, expires: 2026-03-26 10:00:00
======================================================================
[Step 2] Executing command...
======================================================================
[INFO] Calling API: https://openai.ys7.com/api/lapp/device/list
[SUCCESS] Device list retrieved
======================================================================
RESULT
======================================================================
Status: success
Total devices: 3
Devices:
- dev1 (Status: online)
- dev2 (Status: online)
- dev3 (Status: offline)
======================================================================| 命令 | 功能 | API 文档 | |------|------|----------| | list | 查询设备列表 | https://openai.ys7.com/help/680 | | status [dev] | 查询设备状态 | https://openai.ys7.com/help/681 | | capacity [dev] | 查询设备能力集 | https://openai.ys7.com/help/683 | | ptz_start [dev] [ch] [dir] [spd] | 开始云台控制 | https://openai.ys7.com/help/690 | | ptz_stop [dev] [ch] | 停止云台控制 | https://openai.ys7.com/help/691 | | preset_add [dev] [ch] | 添加预置点 | https://openai.ys7.com/help/692 | | preset_move [dev] [ch] [idx] | 调用预置点 | https://openai.ys7.com/help/694 | | preset_clear [dev] [ch] [idx] | 清除预置点 | https://openai.ys7.com/help/693 | | mirror [dev] [ch] [cmd] | 镜像翻转 | https://openai.ys7.com/help/695 |
方向参数 (direction):
| 值 | 方向 | 值 | 方向 | |----|------|----|------| | 0 | 上 | 1 | 下 | | 2 | 左 | 3 | 右 | | 4 | 左上 | 5 | 左下 | | 6 | 右上 | 7 | 右下 | | 8 | 物理放大 | 9 | 物理缩小 | | 10 | 调整近焦距 | 11 | 调整远焦距 | | 16 | 自动控制 | | |
速度参数 (speed):
0 - 慢速1 - 适中(推荐)2 - 快速镜像命令 (command):
0 - 上下翻转1 - 左右翻转2 - 中心翻转| 接口 | URL | 文档 | |------|-----|------| | 获取 Token | POST /api/lapp/token/get | https://openai.ys7.com/help/81 | | 设备列表 | POST /api/lapp/device/list | https://openai.ys7.com/help/680 | | 设备状态 | POST /api/lapp/device/info | https://openai.ys7.com/help/681 | | 设备能力集 | POST /api/lapp/device/capacity | https://openai.ys7.com/help/683 | | 云台启动 | POST /api/lapp/device/ptz/start | https://openai.ys7.com/help/690 | | 云台停止 | POST /api/lapp/device/ptz/stop | https://openai.ys7.com/help/691 | | 预置点管理 | POST /api/lapp/device/preset/* | https://openai.ys7.com/help/692 |
| 域名 | 用途 | |------|------| | openai.ys7.com | 萤石开放平台 API(Token、云台控制) |
设备状态:
online - 设备在线offline - 设备离线error - 状态查询失败错误码:
200 - 操作成功10002 - accessToken 过期20007 - 设备不在线20008 - 设备响应超时60020 - 不支持该命令 (设备不支持此功能)ptz_start 启动,再调用 ptz_stop 停止⚠️ 设备支持: 不是所有设备都支持云台控制,请先确认设备能力集
⚠️ 权限要求: 需要设备控制权限,子账户需要 Permission: Config
⚠️ 操作谨慎: 云台控制会影响摄像头角度,请谨慎操作
⚠️ Token 安全: Token 会缓存到系统临时目录(自动管理),不写入日志,不发送到非萤石端点
默认行为:
/tmp/ezviz_global_token_cache/global_token_cache.json)为什么缓存 Token:
如果您不希望 Token 被持久化,可以通过以下方式禁用缓存:
方法 1: 环境变量
bashexport EZVIZ_TOKEN_CACHE=0 python3 scripts/main.py ...
方法 2: 修改代码
pythonfrom token_manager import get_cached_token # 禁用缓存 token_result = get_cached_token(app_key, app_secret, use_cache=False)
| 系统 | 路径 | |------|------| | macOS | /var/folders/xx/xxxx/T/ezviz_global_token_cache/ | | Linux | /tmp/ezviz_global_token_cache/ | | Windows | C:\Users\{user}\AppData\Local\Temp\ezviz_global_token_cache\ |
查看缓存:
bash# macOS/Linux ls -la /tmp/ezviz_global_token_cache/ cat /tmp/ezviz_global_token_cache/global_token_cache.json # 清除缓存 rm -rf /tmp/ezviz_global_token_cache/
bash# 1. 验证缓存文件权限 ls -la /tmp/ezviz_global_token_cache/global_token_cache.json # 应该显示:-rw------- (600) # 2. 验证缓存内容 cat /tmp/ezviz_global_token_cache/global_token_cache.json | python3 -m json.tool # 3. 验证禁用缓存 export EZVIZ_TOKEN_CACHE=0 python3 scripts/main.py ... # 应该显示 "Getting access token from Ezviz API" 而不是 "Using cached global token"
bash# 推荐:使用 .env 文件(不要提交到版本控制) echo "EZVIZ_APP_KEY=your_key" >> .env echo "EZVIZ_APP_SECRET=your_secret" >> .env chmod 600 .env # 加载环境变量 source .env
如果您在共享计算机或高安全环境中使用:
bashexport EZVIZ_TOKEN_CACHE=0 # 禁用缓存 python3 scripts/main.py ...
bash# 清除所有缓存的 Token rm -rf /tmp/ezviz_global_token_cache/
bash# 验证 Python 语法 python3 -m py_compile scripts/main.py lib/token_manager.py # 验证 AST(确保无截断) python3 -c "import ast; ast.parse(open('scripts/main.py').read()); ast.parse(open('lib/token_manager.py').read()); print('✅ Code integrity verified')" # 检查文件行数(应 > 300 行) wc -l scripts/main.py lib/token_manager.py
根据安全审计建议,请在安装前完成以下检查:
scripts/main.py 和 lib/token_manager.pyopenai.ys7.com 是萤石官方端点(openai = Open API,不是 AI)python3 -m py_compile 检查语法,确认无截断/tmp/ezviz_global_token_cache/ 可接受EZVIZ_APP_KEY 等环境变量EZVIZ_TOKEN_CACHE=0wc -l 检查行数)| 场景 | 命令 | 说明 | |------|------|------| | 📋 查看设备 | list | 获取所有设备列表 | | 🔍 检查状态 | status [dev] | 查看设备是否在线 | | 🎮 云台控制 | ptz_start / ptz_stop | 调整摄像头角度 | | 📍 保存位置 | preset_add | 保存当前位置为预置点 | | 🎯 调用位置 | preset_move [idx] | 移动到预置点 | | 🔄 镜像翻转 | mirror [cmd] | 翻转摄像头画面 |
为什么是 openai.ys7.com 而不是 open.ys7.com?
| 域名 | 用途 | 说明 | |------|------|------| | openai.ys7.com | ✅ API 接口 | 萤石开放平台 API 专用域名(openai = Open API,不是人工智能) | | open.ys7.com | 🌐 官方网站 | 萤石开放平台 官网/文档 入口 |
官方文档: https://open.ys7.com/
安全提示:
openai.ys7.com 是萤石官方 API 域名| 日期 | 版本 | 变更 | 说明 | |------|------|------|------| | 2026-03-19 | 1.0.5 | 添加代码完整性验证 | 回应审核关切,添加语法验证和代码完整性检查 | | 2026-03-19 | 1.0.5 | 添加 API 域名验证说明 | 明确 openai.ys7.com 是萤石官方 API(Open API) | | 2026-03-19 | 1.0.5 | 完善安全审计清单 | 添加代码审查和完整性验证步骤 | | 2026-03-19 | 1.0.4 | 参考设备抓图技能格式 | 统一 metadata 格式、安全警告、凭证优先级说明 | | 2026-03-19 | 1.0.3 | 整合元数据到 SKILL.md | 移除单独文件,所有信息整合到 SKILL.md | | 2026-03-19 | 1.0.2 | 添加 Token 缓存支持 | 使用全局 Token 管理器,与设备抓图技能一致 |
最后更新: 2026-03-19 版本: 1.0.5 (代码完整性验证版)
作者: EzvizOpenTeam 主页: https://openai.ys7.com/ 许可证: MIT-0
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | fail→pass | 5,992 | 3,914 | -35% | 1 | 1 | 0% | 1,137 | 5,720 | +403% | 0 | 0 | — |
case-01 | fail→pass | 16,675 | 15,658 | -6% | 1 | 1 | 0% | 1,183 | 6,979 | +490% | 0 | 0 | — |
case-02 | fail→fail | 5,647 | 6,332 | +12% | 1 | 1 | 0% | 978 | 5,394 | +452% | 0 | 0 | — |
case-03 | fail→fail | 4,350 | 6,882 | +58% | 1 | 1 | 0% | 701 | 5,603 | +699% | 0 | 0 | — |
case-04 | fail→fail | 10,561 | 10,726 | +2% | 1 | 1 | 0% | 2,188 | 7,216 | +230% | 0 | 0 | — |
case-05 | pass→pass | 4,068 | 4,657 | +14% | 1 | 1 | 0% | 832 | 6,012 | +623% | 0 | 0 | — |
case-06 | fail→fail | 15,141 | 12,918 | -15% | 1 | 1 | 0% | 2,624 | 7,259 | +177% | 0 | 0 | — |
case-07 | pass→pass | 10,327 | 3,837 | -63% | 1 | 1 | 0% | 2,285 | 5,972 | +161% | 0 | 0 | — |
case-08 | pass→pass | 7,239 | 4,634 | -36% | 1 | 1 | 0% | 1,450 | 5,888 | +306% | 0 | 0 | — |
case-09 | pass→pass | 10,666 | 5,115 | -52% | 1 | 1 | 0% | 2,164 | 6,024 | +178% | 0 | 0 | — |
case-10 | pass→pass | 5,735 | 2,701 | -53% | 1 | 1 | 0% | 1,290 | 5,541 | +330% | 0 | 0 | — |
case-11 | pass→pass | 6,766 | 2,012 | -70% | 1 | 1 | 0% | 1,253 | 5,431 | +333% | 0 | 0 | — |
case-12 | pass→pass | 10,855 | 3,483 | -68% | 1 | 1 | 0% | 2,024 | 5,672 | +180% | 0 | 0 | — |
case-13 | fail→pass | 9,414 | 3,253 | -65% | 1 | 1 | 0% | 1,730 | 5,628 | +225% | 0 | 0 | — |
case-14 | fail→pass | 4,927 | 4,155 | -16% | 1 | 1 | 0% | 1,077 | 5,868 | +445% | 0 | 0 | — |
case-15 | fail→pass | 8,406 | 1,892 | -77% | 1 | 1 | 0% | 1,517 | 5,329 | +251% | 0 | 0 | — |
case-16 | fail→pass | 10,070 | 3,857 | -62% | 1 | 1 | 0% | 2,112 | 5,843 | +177% | 0 | 0 | — |
case-17 | fail→pass | 9,369 | 1,764 | -81% | 1 | 1 | 0% | 2,006 | 5,237 | +161% | 0 | 0 | — |
case-23 | pass→pass | 7,105 | 2,830 | -60% | 1 | 1 | 0% | 1,510 | 5,587 | +270% | 0 | 0 | — |
case-18 | pass→pass | 10,969 | 4,181 | -62% | 1 | 1 | 0% | 2,416 | 5,921 | +145% | 0 | 0 | — |
case-19 | fail→pass | 9,459 | 2,472 | -74% | 1 | 1 | 0% | 2,151 | 5,411 | +152% | 0 | 0 | — |
case-20 | fail→pass | 7,210 | 3,486 | -52% | 1 | 1 | 0% | 1,339 | 5,631 | +321% | 0 | 0 | — |
case-21 | fail→pass | 7,257 | 2,427 | -67% | 1 | 1 | 0% | 1,321 | 5,435 | +311% | 0 | 0 | — |
case-24 | fail→pass | 11,996 | 1,397 | -88% | 1 | 1 | 0% | 2,695 | 5,195 | +93% | 0 | 0 | — |
case-25 | pass→pass | 4,989 | 2,173 | -56% | 1 | 1 | 0% | 1,142 | 5,440 | +376% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 22 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +44 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.