Install
openclaw skills install sonos-music-playback面向中文用户的 Sonos 音乐点播技能。支持通过 Sonos 侧搜索加队列起播的方式播放已绑定音乐服务,当前已验证兼容 网易云音乐 和 QQ音乐。通过 SoCo 将搜索结果转成 Sonos 队列项,再从队列起播,以保留 Sonos App 中的标题、歌手、专辑和封面等 metadata。
openclaw skills install sonos-music-playback这个 skill 面向中文用户,用来沉淀可复用的 Sonos 点播工作流。
当前已验证兼容的音乐服务:
This skill assumes:
sonos CLI is installed and available in PATHThis skill avoids machine-specific hardcoded paths by resolving from:
OPENCLAW_WORKSPACE_DIROPENCLAW_SONOS_VENVOPENCLAW_SONOS_NETEASE_WRAPPEROPENCLAW_SONOS_QQ_WRAPPEROPENCLAW_SONOS_NETEASE_SCRIPTOPENCLAW_SONOS_QQ_SCRIPTDefault behavior should remain simple:
$HOME/.openclaw/venvs/soco-sonos./scripts/sonos_netease_play.sh and ./scripts/sonos_qq_play.sh under the workspace./scripts/sonos_netease_play.py and ./scripts/sonos_qq_play.py under the workspacePreferred simple install:
./skills/sonos-music-playback-market/scripts/install.sh
Manual flow if needed:
./skills/sonos-music-playback-market/scripts/check_env.sh
If the check fails, run bootstrap:
./skills/sonos-music-playback-market/scripts/bootstrap_env.sh
Then use the standard playback entrypoints, for example:
./scripts/sonos_netease_play.sh --room 'Living Room' '至少还有你'
./scripts/sonos_qq_play.sh --room 'Living Room' '稻香'
Prefer scripts/install.sh when:
Run scripts/check_env.sh when:
Run scripts/bootstrap_env.sh when:
soco is missingBootstrap will:
soco if missingBootstrap does not install the sonos CLI. If sonos is missing, install or restore it separately.
Do not call the Python playback files with system python3.
Prefer the wrappers because they pin the correct Python venv and avoid interpreter drift.
When implementing or patching the playback logic, do not replace queue playback with a direct play_uri(...) rewrite.
Correct pattern:
sonos smapi searchSoCo MusicService(...)add_to_queue(...)play_from_queue(...)This preserves Sonos App metadata such as:
Search results through Sonos may contain:
Prefer a two-stage selection strategy:
sonoscli currently supports searching QQ音乐 via sonos smapi search --service 'QQ音乐', but its --open flow still behaves like a Spotify-only path and does not directly play QQ search results.
For QQ音乐, use the validated queue-based SoCo path instead of sonos smapi search --open.
First suspect linked service authorization state in Sonos App.
A reliable recovery path is usually:
This is likely an incompatibility in the current CLI auth/open flow rather than a proof that QQ音乐 itself is unavailable in Sonos.
If Sonos App already has a working QQ音乐 binding and sonos smapi search --service 'QQ音乐' returns results, prefer the SoCo queue-based playback path.
First inspect whether the playback path regressed to play_uri(...).
Inspect the actual queue metadata returned by Sonos. If the search source itself does not return the desired original version, this is a source-quality limitation, not necessarily a scoring bug.
Before publishing or distributing this skill, verify:
scripts/check_env.sh returns ready=yes in a representative environmentscripts/bootstrap_env.sh can create the venv and install soco when missingPLAYINGPLAYINGnowPlaying.title is non-empty after playback startsscripts/install.sh
scripts/check_env.sh
scripts/bootstrap_env.sh
soco, and verifies both playback entrypoints exist