← 返回 Skills 市场
ezviz-open

Ezviz Open Capture Phone Detect

作者 EzvizOpenTeam · GitHub ↗ · v1.0.10 · MIT-0
cross-platform ✓ 安全检测通过
343
总下载
2
收藏
0
当前安装
11
版本数
在 OpenClaw 中安装
/install ezviz-open-capture
功能描述
通过萤石摄像头抓拍并AI检测玩手机行为,检测到则生成语音告警并下发至设备播放。
使用说明 (SKILL.md)

Phone Detection Alert (玩手机检测告警)

萤石开放平台 AI 算法 + 语音告警,检测到玩手机自动播放提醒。

快速开始

安装依赖

pip install requests edge-tts

设置环境变量(必需)

必需的环境变量:

export EZVIZ_APP_KEY="your_app_key"
export EZVIZ_APP_SECRET="your_app_secret"
export EZVIZ_DEVICE_SERIAL="dev1,dev2,dev3"

可选的环境变量:

export EZVIZ_CHANNEL_NO="1"  # 通道号,默认 1

⚠️ 重要:

  • EZVIZ_APP_KEY, EZVIZ_APP_SECRET, EZVIZ_DEVICE_SERIAL必需的环境变量
  • 技能运行前必须设置这些环境变量
  • 不需要设置 EZVIZ_ACCESS_TOKEN!技能会自动用 appKey + appSecret 获取 Token(有效期 7 天,内存缓存)

运行:

python3 {baseDir}/scripts/phone_detection_alert.py

命令行参数:

# 单个设备
python3 {baseDir}/scripts/phone_detection_alert.py appKey appSecret dev1 1

# 多个设备(逗号分隔)
python3 {baseDir}/scripts/phone_detection_alert.py appKey appSecret "dev1,dev2,dev3" 1

# 指定通道号
python3 {baseDir}/scripts/phone_detection_alert.py appKey appSecret "dev1:1,dev2:2" 1

# 测试模式(跳过检测,直接播放告警)
python3 {baseDir}/scripts/phone_detection_alert.py appKey appSecret "dev1,dev2" 1 --test

工作流程

1. 获取 Token (appKey + appSecret → accessToken, 有效期 7 天)
       ↓
2. 设备抓图 (accessToken + deviceSerial → picUrl, 有效期 2 小时)
       ↓
3. AI 分析 (accessToken + picUrl → 是否玩手机)
       ↓ [检测到]
4. TTS 语音 ("检测到有人玩手机" → audio.mp3)
       ↓
5. 上传语音 (accessToken + audio.mp3 → fileUrl)
       ↓
6. 下发播放 (accessToken + deviceSerial + fileUrl → 设备播放)

Token 自动获取说明

你不需要手动获取或配置 EZVIZ_ACCESS_TOKEN

技能会自动处理 Token 的获取和缓存:

首次运行:
  appKey + appSecret → 调用萤石 API → 获取 accessToken
  ↓
  缓存到内存(有效期 7 天)
  ↓
后续运行 (7 天内):
  使用缓存的 accessToken(无需重复获取)
  ↓
7 天后:
  自动重新获取新的 accessToken

Token 管理特性:

  • 自动获取: 首次运行时自动调用萤石 API 获取
  • 自动缓存: Token 保存在内存中,7 天内重复使用
  • 自动刷新: Token 过期后自动重新获取
  • 无需配置: 不需要手动设置 EZVIZ_ACCESS_TOKEN 环境变量
  • 安全: Token 不写入日志,不保存到磁盘

为什么这样设计:

  • 萤石 Token 有效期为 7 天,无需每次获取
  • 自动管理减少用户配置负担
  • 避免 Token 泄露风险(不暴露在环境变量中)

输出示例

============================================================
Phone Detection Alert System
============================================================
[INFO] Detected 2 device(s): [('dev1', 1), ('dev2', 1)]
[SUCCESS] Token obtained, expires: 2026-03-20 15:00:00

[Device] dev1 (Channel: 1)
[SUCCESS] Image captured: https://opencapture.ys7.com/...
[ALERT] Phone usage detected! (confidence: 0.95)
[SUCCESS] Voice uploaded: http://custom-voice-reminder-hn...
[SUCCESS] Alert sent to device dev1!

[Device] dev2 (Channel: 1)
[SUCCESS] Image captured: https://opencapture.ys7.com/...
[INFO] No phone usage detected

============================================================
DETECTION SUMMARY
============================================================
  Total devices:     2
  Phone detected:    1
  Not detected:      1
  Failed:            0
  Alerts sent:       1
============================================================

API 接口

接口 URL 文档
获取 Token POST /api/lapp/token/get https://open.ys7.com/help/81
设备抓图 POST /api/lapp/device/capture https://open.ys7.com/help/687
玩手机检测 POST /api/service/intelligence/algo/analysis/play_phone_detection https://open.ys7.com/help/3956
语音上传 POST /api/lapp/voice/upload https://open.ys7.com/help/1241
语音下发 POST /api/lapp/voice/send https://open.ys7.com/help/1253

网络端点

域名 用途
open.ys7.com 萤石开放平台 API
aidialoggw.ys7.com 萤石 AI 智能体
aliyuncs.com 萤石语音存储(阿里云 OSS)

格式代码

检测返回:

  • images: null - 图片中没有人
  • label: "play_phone" - 检测到玩手机行为
  • labelWeight: 0.95 - 置信度 95%

错误码:

  • 200 - 操作成功
  • 10002 - accessToken 过期
  • 10028 - 抓图次数超限
  • 20007 - 设备不在线
  • 20008 - 设备响应超时

Tips

  • 多设备: 逗号分隔 dev1,dev2,dev3
  • 指定通道: 冒号分隔 dev1:1,dev2:2
  • Token 有效期: 7 天,自动缓存
  • 图片有效期: 2 小时
  • 频率限制: 建议间隔 ≥4 秒
  • 定时任务: 建议 ≥5 分钟

注意事项

⚠️ 频率限制: 萤石抓图接口建议间隔 4 秒以上,频繁调用可能触发限流(错误码 10028)

⚠️ 隐私合规: 使用摄像头监控可能涉及隐私问题,确保符合当地法律法规

⚠️ 设备要求: 设备必须在线且支持语音对讲功能(support_talk=13

⚠️ Token 安全: Token 仅在内存中使用,不写入日志,不发送到非萤石端点

数据流出说明

⚠️ 重要:本技能会向以下第三方服务发送数据

数据类型 发送到 用途 是否必需 隐私影响
摄像头抓拍图片 open.ys7.com (萤石) AI 玩手机行为分析 ✅ 必需 🔴 包含监控画面
TTS 文本 edge-tts.microsoft.com (Microsoft Azure) 生成语音文件 ✅ 必需 🟢 仅文本
语音文件 aliyuncs.com (阿里云 OSS) 临时存储,供设备下载 ✅ 必需 🟡 临时存储 2 小时
appKey/appSecret open.ys7.com (萤石) 获取访问 Token ✅ 必需 🔴 凭据
设备序列号 open.ys7.com (萤石) 设备控制 ✅ 必需 🟡 设备标识

数据流出详细说明:

  1. 萤石开放平台 (open.ys7.com, aidialoggw.ys7.com):

    • 发送:摄像头抓拍图片、appKey/appSecret、设备序列号
    • 用途:Token 获取、AI 玩手机行为分析、设备控制
    • 隐私:🔴 包含监控画面和凭据
  2. Microsoft Azure TTS (edge-tts.microsoft.com):

    • 发送:TTS 文本("检测到有人玩手机,请立即停止使用手机!")
    • 用途:生成语音文件
    • 隐私:🟢 仅固定文本,不包含个人信息
  3. 阿里云 OSS (aliyuncs.com):

    • 发送:生成的语音文件(.mp3)
    • 用途:临时存储,供萤石设备下载播放
    • 隐私:🟡 临时存储 2 小时,自动过期
    • 存储位置:萤石合作的阿里云 OSS 存储桶

数据不流出:

  • ❌ 不会发送数据到技能作者或任何个人
  • ❌ 不会发送到 ClawHub 或 OpenClaw
  • ❌ 不会永久存储任何数据

凭证安全建议:

  • 使用最小权限的 appKey/appSecret(仅需设备控制和 AI 分析权限)
  • 定期轮换凭据
  • 不要使用主账号凭据
  • 限制凭据的 IP 访问范围(如果萤石支持)

凭证权限建议:

  • 使用最小权限的 appKey/appSecret
  • 仅开通必要的 API 权限(设备抓图、AI 分析、语音)
  • 定期轮换凭证
  • 不要使用主账号凭证

本地处理:

  • ✅ Token 缓存于内存,不写入磁盘
  • ✅ 不记录完整 API 响应
  • ✅ 不保存抓拍图片到本地(除非手动指定下载路径)
安全使用建议
This skill appears to do what it says: capture Ezviz camera images, send them to Ezviz for phone-use detection, generate TTS via edge-tts, upload audio via Ezviz/OSS and trigger device playback. Before installing: 1) Verify you will supply EZVIZ_APP_KEY, EZVIZ_APP_SECRET, and device serial(s) (the package metadata omitted these but SKILL.md and the script require them). 2) Accept the privacy implications: camera frames are sent to Ezviz for analysis and TTS text is sent to Microsoft; ensure you have legal/organizational consent for surveillance. 3) Use least-privilege appKey/appSecret and avoid using main account credentials; rotate keys regularly. 4) Test in a controlled environment first (rate limits and device requirements are noted in SKILL.md). 5) If you need stronger guarantees about data handling, review the full script to confirm it truly avoids logging credentials or writing tokens to disk and confirm network endpoints are only those documented (open.ys7.com, aidialoggw.ys7.com, edge-tts.microsoft.com, aliyuncs.com). 6) If the top-level metadata mismatch worries you, ask the publisher to correct packaging so required env vars are visible in registry metadata.
功能分析
Type: OpenClaw Skill Name: ezviz-open-capture Version: 1.0.10 The skill bundle implements a legitimate phone detection and voice alert system using the Ezviz (萤石) Open Platform. The Python script (phone_detection_alert.py) follows a documented workflow: authenticating with Ezviz, capturing camera snapshots, analyzing them for phone usage via Ezviz AI APIs, and playing a TTS alert on the device. While the skill handles sensitive credentials (APP_SECRET) and camera data, all network traffic is directed to official service endpoints (open.ys7.com, edge-tts.microsoft.com, and aliyuncs.com), and the documentation (SKILL.md) provides transparent disclosure of data flows and privacy implications.
能力评估
Purpose & Capability
The skill is an Ezviz-based phone-usage detection + voice-alert tool. It legitimately needs Ezviz appKey/appSecret and device serials, calls Ezviz capture/detection/voice APIs, and uses edge-tts for TTS — all consistent with the described functionality. Note: the registry metadata at the top-level showed no required env vars, while SKILL.md and the script declare EZVIZ_APP_KEY, EZVIZ_APP_SECRET and EZVIZ_DEVICE_SERIAL as required; this is a packaging/metadata mismatch to be aware of.
Instruction Scope
SKILL.md and the script limit actions to Ezviz APIs and edge-tts; they do not request unrelated system files or unrelated cloud credentials. The instructions explicitly state image/TTS/voice flows and list third-party endpoints. Important privacy behavior: camera images are sent to open.ys7.com for AI analysis, TTS text is sent to edge-tts.microsoft.com, and generated audio is stored via Alibaba OSS (aliyuncs.com). This is expected for the stated purpose but has significant privacy implications (camera frames leave the local environment).
Install Mechanism
No install spec is bundled; this is effectively an instruction+script package. Dependencies are typical (requests, edge-tts). No arbitrary downloads, custom binaries, or extract/install steps are present in the package metadata — lower install risk. The script relies on pip-installable libraries as documented.
Credentials
The required environment variables declared in SKILL.md (EZVIZ_APP_KEY, EZVIZ_APP_SECRET, EZVIZ_DEVICE_SERIAL, optional EZVIZ_CHANNEL_NO) are appropriate and proportionate for Ezviz API usage. There are no unrelated secrets requested. However, the top-level registry metadata lists 'Required env vars: none' which contradicts the SKILL.md; verify the runtime will receive the declared env vars. The SKILL.md also marks EZVIZ_APP_KEY as primaryEnv — that is logical for the service.
Persistence & Privilege
The skill does not request always:true or system-wide privileges. It caches accessToken in memory per SKILL.md/script and claims not to write tokens to disk. It does not attempt to modify other skills or global agent config.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ezviz-open-capture
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ezviz-open-capture 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.10
- Clarified which environment variables are required and emphasized that they must be set before running the skill. - Improved security and privacy section: enhanced tables explaining all data flows to third parties, added explicit privacy impact symbols, and highlighted that no data is sent to the skill author, ClawHub, or OpenClaw. - Minor adjustments in metadata: removed unused optionalEnv config, but no behavioral change. - Updated documentation for clarity on credential usage, privacy, and security best practices. - No code changes; documentation only.
v1.0.9
- Metadata updated to declare EZVIZ_CHANNEL_NO as an optional environment variable. - No code or functional changes; only metadata in SKILL.md has changed.
v1.0.8
- Removed "install" instructions from SKILL.md metadata. - Reformatted the "快速开始" section for clarity, including installation as a dedicated sub-section. - No functional or code changes; documentation only.
v1.0.7
### ezviz-open-capture v1.0.7 - No code or documentation changes detected in this release. - Version bump only; functionality and usage remain unchanged.
v1.0.6
ezviz-open-capture v1.0.6 - No code or documentation changes detected in this version. - Functionality, usage, installation steps, and API references remain unchanged.
v1.0.5
Version 1.0.5 - Simplified environment variable configuration: no longer requires EZVIZ_ACCESS_TOKEN; it is now automatically fetched and cached based on EZVIZ_APP_KEY and EZVIZ_APP_SECRET. - Updated documentation to highlight the automatic, in-memory token management; users do not need to configure, rotate, or expose the access token manually. - Added detailed explanation about data flow and external services, clarifying what data is sent and to which third-party services. - Improved instructions and security recommendations in the usage guide. - No code changes; documentation only.
v1.0.4
- Updated metadata to require additional environment variables (EZVIZ_ACCESS_TOKEN, EZVIZ_CHANNEL_NO). - Clarified step-by-step quick start and workflow, including more concise environment/config explanations. - Added explicit command line usage patterns and support for test mode. - Improved interface/API documentation, including direct links to official docs and common error codes. - Added best practices on rate limits, privacy, and device requirements. - Enhanced output and summary examples for easier understanding of detection results.
v1.0.3
- Added metadata section specifying required environment variables and pip dependencies (requests, edge-tts) - Provided explicit Python and dependency installation instructions - Updated configuration table to clarify which environment variables are required - No code or logic changes; documentation and metadata enhancements only
v1.0.2
新增“玩手机检测告警”流程和多设备支持: - 全面重命名与重构:由“设备抓图”升级为“玩手机检测告警”技能 - 新增玩手机检测功能,并集成 AI 算法分析与自动语音告警流程 - 替换抓图脚本为支持检测+告警的 phone_detection_alert.py - 更新、替换 API 参考文档,详述完整抓拍-分析-TTS-下发流程 - 支持摄像头批量检测,设备与通道号配置方式更灵活 - 新增与 OpenClaw 工具集成说明,丰富使用与扩展建议
v1.0.1
**Device capture skill now supports batch snapshot for multiple Ezviz devices.** - Renamed and refocused the skill from "phone-detection-alert" to "device-capture", now dedicated to batch camera snapshots. - Added script: `scripts/device_capture.py` for multi-device capture with optional local image download and JSON output. - Updated documentation for simplified setup—only appKey and appSecret needed; supports flexible device:channel configurations. - Replaced the old phone usage detection flow and scripts with a new focus on image capture and management. - New sample API reference and detailed usage instructions included.
v1.0.0
ezviz first capture no phone detect
元数据
Slug ezviz-open-capture
版本 1.0.10
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 11
常见问题

Ezviz Open Capture Phone Detect 是什么?

通过萤石摄像头抓拍并AI检测玩手机行为,检测到则生成语音告警并下发至设备播放。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 343 次。

如何安装 Ezviz Open Capture Phone Detect?

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

Ezviz Open Capture Phone Detect 是免费的吗?

是的,Ezviz Open Capture Phone Detect 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ezviz Open Capture Phone Detect 支持哪些平台?

Ezviz Open Capture Phone Detect 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ezviz Open Capture Phone Detect?

由 EzvizOpenTeam(@ezviz-open)开发并维护,当前版本 v1.0.10。

💬 留言讨论