返回顶部
w

when-clock-skill时钟技能

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
117
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

when-clock-skill

when-clock-skill (OpenClaw 技能描述)

1. 技能概述

  • - 入口脚本: when-clock-skill.py
  • 运行环境: Python 3.9+, 仅使用标准库,无需 pip 安装
  • 目标设备: WHEN / WHEN Voice 时钟(局域网 HTTP,自动检测)
  • 配置文件: 脚本目录下的 config.json(需在 devices 数组中填写 id 和 clock_ip)

2. 调用格式

python when-clock-skill.py --mode <模式> --device-id <设备ID> [选项...]

--device-id 默认为 default(为兼容单设备配置)。

3. 模式速查表

模式描述必需参数设备支持
chime语音报时仅 WHEN Voice
weather
语音播报天气 | — | 仅 WHEN Voice | | get_alarm | 查询所有闹钟 | — | 两者皆可 | | set_alarm | 添加新闹钟 | --alarm-time | 两者皆可 | | edit_alarm | 修改闹钟(部分更新) | --alarm-index | 两者皆可 | | delete_alarm | 删除闹钟 | --alarm-index | 两者皆可 | | set_timer | 倒计时定时器(单次闹钟) | --timer-offset | 两者皆可 |

4. 模式详情

4.1 chime — 语音报时(仅 WHEN Voice)

播报当前时间。WHEN 设备不支持此模式。

bash
python when-clock-skill.py --mode chime --device-id device1
python when-clock-skill.py --mode chime --device-id device1 --volume 20

可选参数:--volume 1~30(未指定时使用设备当前音量)

输出:
json
{ok: true, mode: chime, action: voiceannouncepreview, result: success, status: 0, message: succ}



4.2 weather — 天气播报(仅 WHEN Voice)

WHEN 设备不支持此模式。

注意:天气播报目前仅支持中国地区。更多地区将在后续更新中添加。

bash
python when-clock-skill.py --mode weather --device-id device1
python when-clock-skill.py --mode weather --device-id device1 --volume 20

输出:
json
{ok: true, mode: weather, action: voiceweatherpreview, result: success, status: 0, message: succ}



4.3 get_alarm — 查询闹钟列表

bash
python when-clock-skill.py --mode get_alarm --device-id device1

WHEN 设备闹钟条目不包含 volume 字段。

WHEN Voice 输出示例(含音量):
json
{
ok: true,
mode: get_alarm,
alarm_count: 2,
alarms: [
{index: 1, mode: Workday, time: 07:30:00, ring: Reveille, ringdurationlevel: 2min, volume: 20},
{index: 2, mode: Weekly, time: 09:00:00, ring: Weather(1x), ringdurationlevel: 30S, volume: 15, active_days: [Mon, Wed]}
]
}

alarms[].index 是 editalarm / deletealarm 所需的 --alarm-index 值。


4.4 set_alarm — 添加新闹钟

bash

单次(默认)


python when-clock-skill.py --mode set_alarm --device-id device1 --alarm-time 07:30

工作日

python when-clock-skill.py --mode set_alarm --device-id device1 --alarm-mode workday --alarm-time 08:00

每周特定天数

python when-clock-skill.py --mode set_alarm --device-id device1 --alarm-mode weekly --alarm-week 1,2,3,4,5 --alarm-time 08:10

WHEN Voice - 完整参数

python when-clock-skill.py --mode set_alarm --device-id device1 --alarm-time 07:30 --alarm-ring 5 --alarm-delay 6 --alarm-volume 20

WHEN - 铃声仅 1-6

python when-clock-skill.py --mode set_alarm --device-id device1 --alarm-time 07:30 --alarm-ring 3

可选参数(未指定时使用 config.json 中的 alarm_defaults):

  • - --alarm-mode:once/weekly/workday/restday/off,默认为 once
  • --alarm-week:weekly 模式必需,例如 1,2,3,4,5 或 Mon,Wed,Fri
  • --alarm-ring:铃声 ID(WHEN Voice:1~50,WHEN:1~6 beep1-beep6)
  • --alarm-delay:持续时间等级(从0开始,0~11)
  • --alarm-volume:音量 1~30(仅 WHEN Voice)

每台设备最多 10 个闹钟

输出:
json
{ok: true, mode: setalarm, action: addalarm, result: success, status: 0, message: succ, alarmcount: 3, addedalarm: {mode: Once, time: 07:30:00, ring: Reveille, ringdurationlevel: 2min, volume: 20, active_days: []}}



4.5 edit_alarm — 修改闹钟

仅更新指定字段;其他字段保持原值。

bash

仅修改时间


python when-clock-skill.py --mode edit_alarm --device-id device1 --alarm-index 1 --alarm-time 07:45

修改时间和音量(WHEN Voice)

python when-clock-skill.py --mode edit_alarm --device-id device1 --alarm-index 2 --alarm-time 08:30 --alarm-volume 25

改为工作日模式

python when-clock-skill.py --mode edit_alarm --device-id device1 --alarm-index 1 --alarm-mode workday

--alarm-index 为必需参数(先使用 get_alarm 查看索引)。

输出:
json
{ok: true, mode: editalarm, action: updatealarm, result: success, status: 0, message: succ, alarmcount: 3, updatedalarm: {index: 1, mode: Once, time: 07:45:00, ring: Reveille, ringdurationlevel: 2min, volume: 20, active_days: []}}



4.6 delete_alarm — 删除闹钟

bash
python when-clock-skill.py --mode delete_alarm --device-id device1 --alarm-index 2

--alarm-index 为必需参数。

输出:
json
{ok: true, mode: deletealarm, action: removealarm, result: success, status: 0, message: succ, alarmcount: 2, removedalarm: {index: 2, mode: Once, time: 09:00:00, ring: Weather(1x), ringdurationlevel: 30S, volume: 15, active_days: []}}



4.7 set_timer — 倒计时定时器

获取当前本地时间加上偏移量,作为单次闹钟写入设备。

bash

5分钟后(使用配置默认铃声/音量)


python when-clock-skill.py --mode set_timer --device-id device1 --timer-offset 5m

1小时30分钟后

python when-clock-skill.py --mode set_timer --device-id device1 --timer-offset 1h30m

90秒,自定义铃声和音量(WHEN Voice)

python when-clock-skill.py --mode set_timer --device-id device1 --timer-offset 90s --alarm-ring 5 --alarm-volume 20

--

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 when-clock-skill-1776073218 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 when-clock-skill-1776073218 技能

通过命令行安装

skillhub install when-clock-skill-1776073218

下载

⬇ 下载 when-clock-skill v1.0.1(免费)

文件大小: 46.26 KB | 发布时间: 2026-4-14 10:54

v1.0.1 最新 2026-4-14 10:54
when-clock-skill 2.0.0 is a major update with expanded voice and alarm clock control for WHEN/WHEN Voice LAN devices.

- Adds support for both WHEN and WHEN Voice devices with auto-detection.
- Introduces new CLI structure with `--mode` for voice time, weather, alarm CRUD, and timer.
- Full-featured alarm management: add, edit, delete, and query alarms (with ring, days, volume options).
- New countdown timer mode creates single-shot alarms with flexible offset parsing.
- Updated documentation: quick reference, detailed alarm/ring instructions, and invocation examples.
- Device-specific features: voice modes and weather only on WHEN Voice; ring/volume differences clarified.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部