360 Secure SkillHub
360 安全技能中心

Morning Wakeup

核心功能为自动获取当日天气,依据WMO天气代码映射对应Sonos预设并播放;适用于搭建每日晨间routine、闹钟式唤醒流、天气感知音乐自动化场景。支持命令行单次触发或配置定时任务执行,需指定地点、音箱等参数,输出含天气摘要与所用预设的JSON结果,可自定义预设映射。

terrycarter1985
terrycarter1985
热度 48.47
最近更新 2026-05-12 07:56:55
分类:自动化依赖:代码执行 / 第三方 API / 读写文件应用场景:自动化脚本 / 日程安排 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add morning-wakeup
Metadata
name
morning-wakeup
description
Morning wake-up automation that fetches today's weather and matches a Sonos playback preset. Use when setting up daily morning routines, alarm-style wake-up flows, or weather-aware music automation. Triggers on phrases like "morning routine", "wake up automation", "morning alarm", "weather-based music".

Morning Wake-up

Automate a daily morning wake-up: fetch weather → match preset → play on Sonos.

Prerequisites

  • Weather skill installed (Open-Meteo, no API key needed)
  • Sonos CLI (sonos) installed and speakers on the local network
  • At least one Sonos favorite configured per preset category

Preset Mapping

The script maps WMO weather codes to Sonos favorite presets:

Weather category WMO codes Default preset
Clear / Sunny 0, 1 Morning Sunshine
Cloudy 2, 3, 45, 48 Cloudy Morning
Rain / Drizzle 51–57, 61–67, 80–82 Rainy Day
Snow 71–77, 85–86 Winter Morning
Storm 95–99 Stormy Ambient

Override presets by editing scripts/presets.json in the skill directory.

Usage

One-shot run

bun scripts/morning-wakeup.ts --location "Shanghai" --speaker "Bedroom"

Scheduled (cron)

Set up a daily cron job, e.g. 7:00 AM:

# In OpenClaw cron
bun <skill-dir>/scripts/morning-wakeup.ts --location "Shanghai" --speaker "Bedroom"

Or use the OpenClaw cron tool:

{
  "schedule": { "kind": "cron", "expr": "0 7 * * *", "tz": "Asia/Shanghai" },
  "payload": { "kind": "agentTurn", "message": "Run the morning wake-up routine: fetch weather for Shanghai and play the matching Sonos preset on Bedroom speaker." }
}

Script Parameters

Param Required Default Description
--location Yes — City name or "lat,lon"
--speaker Yes — Sonos speaker name
--volume No 15 Start volume (0–100)
--units No celsius celsius or fahrenheit

Flow

  1. Fetch current weather via Open-Meteo
  2. Map weather code → preset name
  3. Set Sonos volume
  4. Open the matching Sonos favorite
  5. Output JSON result with weather summary and preset used