agentsclimarketplace

Xiaomi cam snapshot

Skill tiancheng91/skills/skills/xiaomi-cam-snapshot

获取小米摄像头画面截图。当用户需要查看小米摄像头实时画面、获取摄像头截图、监控摄像头画面、或者提到"小米摄像头"、"摄像头截图"、"camera snapshot"、"摄像头画面"时使用此技能。支持列出摄像头、获取指定摄像头图片、自定义文件名等功能。From its SKILL.md

Install
npx -y skills add tiancheng91/skills --skill xiaomi-cam-snapshot

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.7 KB, ~1.8k tokens by cl100k_base, as published. Nobody here has run it

小米摄像头截图技能

通过 Miloco 后端服务获取小米摄像头的实时画面截图。

首次设置流程

步骤 1: 启动 Miloco 服务

docker run -d \
  --name miloco \
  --network host \
  -e BACKEND_PORT=8001 \
  ghcr.io/tiancheng91/miloco-backend:dev

步骤 2: 完成小米账号认证

服务启动后,引导用户完成以下操作:

  1. 打开浏览器访问: http://localhost:8001
  2. 登录小米账号: 使用小米账号完成登录认证
  3. 设置密码: 设置一个六位数字密码(用于后续 API 调用)

等待用户确认: 询问用户是否已完成认证和密码设置,等待用户回复"已完成"或"确认"后继续。

步骤 3: 验证配置

用户确认后,尝试获取摄像头列表验证配置是否成功:

python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password YOUR_PASSWORD \
  --list

步骤 4: 保存配置(可选)

如果获取摄像头列表成功,询问用户是否保存以下信息以便后续使用:

  1. 密码: 保存到 MILOCO_PASSWORD 环境变量或配置文件
  2. 摄像头列表: 记录摄像头 ID 和名称的对应关系

示例保存方式:

# 保存到环境变量(当前会话)
export MILOCO_PASSWORD="你的六位密码"

# 或保存到 shell 配置文件(永久保存)
echo 'export MILOCO_PASSWORD="你的六位密码"' >> ~/.zshrc

后续使用流程

完成首次设置后,后续可直接获取摄像头截图:

1. 确认服务状态

docker ps | grep miloco

如果服务未运行,先启动:

docker start miloco

2. 获取摄像头截图

# 使用已保存的密码环境变量
python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password $MILOCO_PASSWORD \
  --camera-id "CAMERA_ID" \
  --output ./images

脚本功能说明

脚本位于 scripts/camera_client.py,支持以下功能:

列出所有摄像头

python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password YOUR_PASSWORD \
  --list

输出示例:

摄像头列表:
--------------------------------------------------------------------------------
  ID: 1036201996
  名称: 客厅摄像头
  在线: 是
  位置: 我家 - 客厅
--------------------------------------------------------------------------------

获取指定摄像头截图

# 使用默认文件名 (日期_did_时分秒.jpg)
python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password YOUR_PASSWORD \
  --camera-id "1036201996" \
  --output ./images

# 指定自定义文件名
python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password YOUR_PASSWORD \
  --camera-id "1036201996" \
  --output ./images \
  --filename "living_room_snapshot"

持续获取截图(监控模式)

# 每30秒获取一次
python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password YOUR_PASSWORD \
  --camera-id "1036201996" \
  --output ./images \
  --loop

# 每60秒获取一次,自动清理1天前的图片
python scripts/camera_client.py \
  --server http://localhost:8001 \
  --password YOUR_PASSWORD \
  --camera-id "1036201996" \
  --output ./images \
  --loop --interval 60 --cleanup

参数说明

参数短参数说明必填
--server-sMiloco 服务器地址
--password-p密码(也可通过 MILOCO_PASSWORD 环境变量设置)
--username-u用户名,默认 admin
--list-l列出所有摄像头
--camera-id-c摄像头设备ID (did)否*
--output-o输出目录,默认当前目录
--filename-f自定义文件名(不含扩展名)
--loop持续获取图片
--interval-i循环间隔秒数,默认30
--cleanup自动清理过期图片
--cleanup-days清理多少天前的图片,默认1
--debug-d启用调试日志

* 获取截图时必填

工作流程总结

首次使用:
┌─────────────────┐
│ 1. 启动 Docker  │
└────────┬────────┘
         ▼
┌─────────────────────────────────┐
│ 2. 引导用户访问 localhost:8001  │
│    完成小米账号认证 + 设置密码   │
└────────┬────────────────┘
         ▼
┌─────────────────────────────────┐
│ 3. 等待用户确认完成             │
└────────┬────────────────┘
         ▼
┌─────────────────────────────────┐
│ 4. 尝试获取摄像头列表           │
└────────┬────────────────┘
         ▼
┌─────────────────────────────────┐
│ 5. 询问是否保存密码和摄像头信息 │
└────────┬────────────────┘
         ▼
┌─────────────────────────────────┐
│ 6. 完成,可随时获取截图         │
└─────────────────────────────────┘

后续使用:
┌─────────────────┐
│ 确认服务运行    │
└────────┬────────┘
         ▼
┌─────────────────┐
│ 直接获取截图    │
└─────────────────┘

注意事项

  • 确保摄像头设备在线才能获取截图
  • 截图文件名默认格式:日期_did_时分秒.jpg
  • 支持的图片格式:JPG、PNG(根据响应自动判断)
  • 如果认证失败会自动重试登录一次
  • 密码为六位数字,在 Miloco Web 界面设置

项目信息

What ships with it: 1 file

12.4 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 326,852. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.