Hour Meter (TARDIS on ClawHub)
Life event tracker with three modes, milestone notifications, and tamper-evident verification.
ClawHub Note: This skill is published as TARDIS on ClawHub after the original hour-meter listing was lost due to a repository sync issue.
Three Modes
COUNT UP — Time since an event
CODEBLOCK0
COUNT DOWN — Time until an event
CODEBLOCK1
COUNT BETWEEN — Journey from start to end
CODEBLOCK2
Tamper-Evident Persistence
When you lock a meter, you get a paper code — a short, checksummed code you can write on paper:
CODEBLOCK3
Four Ways to Save (Non-Technical)
1️⃣ PAPER — Write the code on paper/sticky note
- - 20 characters with dashes, easy to copy
- Built-in checksum catches typos when verifying
- Keep in wallet, safe, or taped to equipment
2️⃣ PHOTO — Screenshot or photograph the lock screen
- - Store in camera roll, cloud photos
- Visual backup, no typing required
3️⃣ WITNESS FILE — Auto-saved to ~/.openclaw/meter-witness.txt
- - Append-only log of all locked meters
- Sync folder to Dropbox/iCloud/Google Drive for cloud backup
- Contains paper code + full hash + timestamp
4️⃣ EMAIL TO SELF — Click the mailto: link or copy the one-liner
- - Opens your email client with pre-filled subject and body
- Or copy the compact message: INLINECODE2
- Send to yourself, search inbox later to verify
5️⃣ SENDGRID EMAIL — Auto-send verification email on lock
# Set your SendGrid API key
export SENDGRID_API_KEY=SG.xxxxx
export SENDGRID_FROM_EMAIL=verified@yourdomain.com
# Lock and email in one command
meter.py lock my-meter --email you@example.com
- - Sends a beautifully formatted HTML email with paper code
- Requires a verified sender in SendGrid (see SendGrid docs)
- Great for automated workflows
Verifying Later
CODEBLOCK5
Milestones
CODEBLOCK6
Email Milestone Notifications (v1.3.0)
Get milestone notifications sent directly to your email:
CODEBLOCK7
Email includes:
- - 🎯 Milestone message
- ⏱️ Current elapsed time
- 📝 Meter description
Requires SENDGRID_API_KEY environment variable.
Milestone Notifications: Heartbeat vs Cron
Recommended: HEARTBEAT (~30 min resolution)
- - Add to
HEARTBEAT.md: INLINECODE5 - Batches with other periodic checks
- Cost-efficient: shares token usage with other heartbeat tasks
- Good for most use cases (quit tracking, career milestones, etc.)
Milestone Messages
Milestones post their message text to the configured notification channel when triggered:
CODEBLOCK8
Configure in HEARTBEAT.md:
CODEBLOCK9
Advanced: Milestone messages prefixed with ACTION: can optionally be treated as agent instructions by your heartbeat config. This is an opt-in feature — see README.md for security considerations.
Alternative: CRON (precise timing)
- - Use when exact timing matters (e.g., countdown to event)
- ⚠️ Cost warning: Cron at 1-minute intervals = 1,440 API calls/day = expensive!
- If using cron, keep intervals ≥15 minutes to manage costs
- Best for one-shot reminders, not continuous monitoring
Rule of thumb: If 30-minute resolution is acceptable, use heartbeat. Save cron for precision timing.
Quick Reference
CODEBLOCK10
SendGrid Email Webhook Server
Receive real-time notifications when recipients open, click, bounce, or unsubscribe from your meter verification emails.
Setup
CODEBLOCK11
Discord Webhook Setup (Recommended)
- 1. In your Discord channel, go to Settings > Integrations > Webhooks
- Click New Webhook, copy the URL
- Pass to
--discord-webhook or set DISCORD_WEBHOOK_URL env var
SendGrid Setup
- 1. Go to SendGrid > Settings > Mail Settings > Event Webhook
- Click "Create new webhook" (or edit existing)
- Set HTTP POST URL to: INLINECODE9
- Select all event types under Actions to be posted:
-
Engagement data: Opened, Clicked, Unsubscribed, Spam Reports, Group Unsubscribes, Group Resubscribes
-
Deliverability Data: Processed, Dropped, Deferred, Bounced, Delivered
-
Account Data: Account Status Change
- 5. Click "Test Integration" to verify - this fires all event types to your webhook
- Important: Click Save to enable the webhook!
- (Optional) Enable Signed Event Webhook for security and set INLINECODE10

Event Types
| Event | Emoji | Description |
|---|
| delivered | ✅ | Email reached recipient |
| open |
👀 | Recipient opened email |
| click | 🔗 | Recipient clicked a link |
| bounce | ⚠️ | Email bounced |
| unsubscribe | 🔕 | Recipient unsubscribed |
| spamreport | 🚨 | Marked as spam |
Environment Variables
CODEBLOCK12
The 80,000 Hours Concept
Career as finite inventory: 40 years × 2,000 hrs/year = 80,000 hours.
CODEBLOCK13
小时计 (ClawHub上的TARDIS)
具有三种模式、里程碑通知和防篡改验证的生活事件追踪器。
ClawHub说明: 此技能在原始hour-meter列表因仓库同步问题丢失后,以TARDIS名称发布在ClawHub上。
三种模式
正向计时 — 事件发生以来的时间
bash
戒烟追踪器
meter.py create smoke-free --start 2025-06-15T08:00:00Z -d 最后一支烟
meter.py milestone smoke-free -t hours -v 720 -m 🎉 戒烟30天!
meter.py lock smoke-free # → 提供纸质验证码供保存
倒计时 — 距离事件发生的时间
bash
宝宝预产期
meter.py create baby --start 2026-01-15 --end 2026-10-15 --mode down -d 宝宝要来了!
meter.py milestone baby -t percent -v 33 -m 👶 孕早期完成!
区间计时 — 从起点到终点的旅程
bash
职业生涯跨度
meter.py create career --start 1998-05-15 --end 2038-05-15 -d 40年职业生涯
meter.py milestone career -t percent -v 50 -m 📊 职业生涯过半!
meter.py career --meter career --rate 85 --raise-pct 2.5
防篡改持久化
当你锁定一个计时器时,会得到一个纸质验证码——一个简短、带校验和的代码,可以写在纸上:
╔══════════════════════════════════════════════════════════════╗
║ 纸质验证码(请记下此码): ║
║ 318B-3229-C523-2F9C-V ║
╚══════════════════════════════════════════════════════════════╝
五种保存方式(非技术向)
1️⃣ 纸质 — 将验证码写在纸/便签上
- - 20个字符带连字符,易于抄写
- 内置校验和可在验证时发现输入错误
- 可放在钱包、保险箱或贴在设备上
2️⃣ 照片 — 截图或拍摄锁定屏幕
3️⃣ 见证文件 — 自动保存至~/.openclaw/meter-witness.txt
- - 所有锁定计时器的仅追加日志
- 同步文件夹至Dropbox/iCloud/Google Drive进行云备份
- 包含纸质验证码 + 完整哈希值 + 时间戳
4️⃣ 邮件发送给自己 — 点击mailto:链接或复制单行内容
- - 打开邮件客户端,主题和正文已预填
- 或复制紧凑消息:🔒 my-meter | 验证码: XXXX-XXXX-XXXX-XXXX-C | 锁定时间: 2026-02-02
- 发送给自己,稍后搜索收件箱验证
5️⃣ SENDGRID邮件 — 锁定时自动发送验证邮件
bash
设置SendGrid API密钥
export SENDGRID
APIKEY=SG.xxxxx
export SENDGRID
FROMEMAIL=verified@yourdomain.com
一条命令完成锁定和发送邮件
meter.py lock my-meter --email you@example.com
- - 发送格式精美的HTML邮件,包含纸质验证码
- 需要在SendGrid中验证发件人(参见SendGrid文档)
- 适合自动化工作流
后续验证
bash
使用纸质验证码(可发现输入错误!)
meter.py verify my-meter 318B-3229-C523-2F9C-V
→ ✅ 验证通过!纸质验证码匹配。
→ ⚠️ 校验和错误!(如果输入有误)
→ ❌ 不匹配!(如果被篡改)
里程碑
bash
meter.py milestone <名称> --type hours --value 1000 --message 1000小时!
meter.py milestone <名称> --type percent --value 50 --message 过半了!
meter.py check-milestones # 输出JSON格式,便于自动化
邮件里程碑通知 (v1.3.0)
将里程碑通知直接发送到你的邮箱:
bash
创建带邮件通知的计时器
meter.py create my-meter \
--notify-email you@example.com \
--from-email verified@yourdomain.com \
-d 我追踪的事件
照常添加里程碑
meter.py milestone my-meter -t hours -v 24 -m 🎉 完成24小时!
当check-milestones运行时,如果里程碑触发,邮件会自动发送
meter.py check-milestones
→ 触发里程碑并发送邮件通知
邮件包含:
- - 🎯 里程碑消息
- ⏱️ 当前已过时间
- 📝 计时器描述
需要设置SENDGRIDAPIKEY环境变量。
里程碑通知:心跳 vs 定时任务
推荐:心跳模式(约30分钟精度)
- - 在HEARTBEAT.md中添加:运行 meter.py check-milestones 并通知触发的里程碑
- 与其他周期性检查批量执行
- 成本效益高:与其他心跳任务共享令牌使用量
- 适用于大多数使用场景(戒烟追踪、职业里程碑等)
里程碑消息
里程碑在触发时会将其消息文本发布到配置的通知渠道:
bash
里程碑触发时发布消息
meter.py milestone my-meter -t hours -v 24 -m 🎉 完成24小时!
在HEARTBEAT.md中配置:
markdown
- - 运行 meter.py check-milestones 并将触发的里程碑消息发布到配置的渠道
高级: 以ACTION:为前缀的里程碑消息可选地可由心跳配置作为代理指令处理。这是一个可选功能——安全考虑请参见README.md。
备选方案:定时任务(精确计时)
- - 当精确时间很重要时使用(例如,事件倒计时)
- ⚠️ 成本警告: 1分钟间隔的定时任务 = 每天1,440次API调用 = 成本高昂!
- 如果使用定时任务,保持间隔≥15分钟以控制成本
- 最适合一次性提醒,而非持续监控
经验法则: 如果30分钟精度可接受,使用心跳模式。将定时任务保留给需要精确计时的场景。
快速参考
bash
meter.py create <名称> [--start T] [--end T] [--mode up|down|between] [-d 描述]
meter.py lock <名称> # 密封 + 获取纸质验证码
meter.py verify <名称> <验证码> # 验证纸质验证码
meter.py check <名称> # 状态 + 进度
meter.py milestone <名称> -t hours|percent -v N -m ...
meter.py check-milestones # 所有里程碑(JSON格式)
meter.py witness [--show] [--path] # 见证文件
meter.py list # 所有计时器
meter.py career [--meter M] [--rate R] [--raise-pct P]
meter.py export [名称] # JSON导出
SendGrid邮件Webhook服务器
当收件人打开、点击、退订或退回你的计时器验证邮件时,接收实时通知。
设置
bash
启动带Discord Webhook的Webhook服务器(推荐)
python sendgrid_webhook.py --port 8089 --discord-webhook https://discord.com/api/webhooks/xxx/yyy
或手动处理事件(供代理发布)
python sendgrid_webhook.py --process-events
python sendgrid_webhook.py --process-events --json
Discord Webhook设置(推荐)
- 1. 在Discord频道中,进入设置 > 集成 > Webhooks
- 点击新建Webhook,复制URL
- 传递给--discord-webhook或设置DISCORDWEBHOOKURL环境变量
SendGrid设置
- 1. 进入SendGrid > 设置 > 邮件设置 > 事件Webhook
- 点击创建新Webhook(或编辑现有)
- 设置HTTP POST URL为:https://your-domain.com/webhooks/sendgrid
- 在要发布的操作下选择所有事件类型:
-
互动数据: 已打开、已点击、已退订、垃圾邮件报告、群组退订、群组重新订阅
-
投递数据: 已处理、已丢弃、已延迟、已退回、已投递
-
账户数据: 账户状态变更
- 5. 点击测试集成进行验证——这将