Sonos Netease Playback
by @huacius
Portable Sonos + Netease playback skill for OpenClaw environments. Use when an agent needs a standard reusable workflow to search and play a specific song to...
clawhub install sonos-netease-playbackπ About This Skill
name: sonos-netease-playback description: Portable Sonos + Netease playback skill for OpenClaw environments. Use when an agent needs a standard reusable workflow to search and play a specific song to a Sonos room, preserve Sonos App metadata display, bootstrap the Python SoCo dependency, or restore the environment after migration. Suitable for packaging or sharing because it avoids machine-specific hardcoded paths and uses environment variables for workspace, wrapper, script, and venv resolution. metadata: { "openclaw": { "requires": { "bins": ["sonos"] }, "install": [ { "id": "soco-python-venv", "kind": "message", "label": "Run the skill bootstrap script to create the Sonos Python venv and install soco", }, ], }, }
Sonos Netease Playback
> Deprecated: this skill has been superseded by sonos-music-playback, which covers both η½ζδΊι³δΉ and QQι³δΉ.
> Prefer the newer skill for fresh installs and future updates.
Overview
Use this skill as the portable, shareable version of the Sonos η½ζδΊηΉζ workflow.
This skill assumes:
sonos CLI is installed and available in PATHThis skill should be designed toward simple installation:
This skill avoids machine-specific hardcoded paths by resolving from:
OPENCLAW_WORKSPACE_DIROPENCLAW_SONOS_VENVOPENCLAW_SONOS_WRAPPEROPENCLAW_SONOS_SCRIPTDefault behavior should remain simple:
$HOME/.openclaw/venvs/soco-sonos./scripts/sonos_netease_play.sh under the workspace./scripts/sonos_netease_play.py under the workspaceQuick Start
Preferred simple install:
./skills/sonos-netease-playback-market/scripts/install.sh
Manual flow if needed:
./skills/sonos-netease-playback-market/scripts/check_env.sh
If the check fails, run bootstrap:
./skills/sonos-netease-playback-market/scripts/bootstrap_env.sh
Then use the standard playback entrypoint, for example:
./scripts/sonos_netease_play.sh --room 'Living Room' 'θ³ε°θΏζδ½ '
Workflow
1. Prefer one-command install
Prefer scripts/install.sh when:
2. Check environment
Run scripts/check_env.sh when:
3. Bootstrap if needed
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.
4. Play through the standard wrapper
Do not call the Python playback file with system python3.
Prefer the wrapper because it pins the correct Python venv and avoids interpreter drift.
Important implementation contract
Preserve metadata by playing from queue
When implementing or patching the playback logic, do not replace queue playback with a direct play_uri(...) rewrite.
Correct pattern:
add_to_queue(...)play_from_queue(...)This preserves Sonos App metadata such as:
Do not trust search titles alone
Netease search results through Sonos may contain:
Prefer a two-stage selection strategy: 1. title-based initial filtering 2. queue-metadata-based rescoring using actual Sonos metadata
Troubleshooting
Can search but cannot play
First suspect linked service authorization state in Sonos App.
A reliable recovery path is usually:
Plays but metadata is blank
First inspect whether the playback path regressed to play_uri(...).
Still chooses the wrong version
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.
Release Checklist
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 missingPLAYINGnowPlaying.title is non-empty after playback startsResources
scripts/
scripts/install.shscripts/check_env.shscripts/bootstrap_env.shsoco, and can generate a default playback wrapper when absent
π‘ Examples
Preferred simple install:
./skills/sonos-netease-playback-market/scripts/install.sh
Manual flow if needed:
./skills/sonos-netease-playback-market/scripts/check_env.sh
If the check fails, run bootstrap:
./skills/sonos-netease-playback-market/scripts/bootstrap_env.sh
Then use the standard playback entrypoint, for example:
./scripts/sonos_netease_play.sh --room 'Living Room' 'θ³ε°θΏζδ½ '
π Tips & Best Practices
Can search but cannot play
First suspect linked service authorization state in Sonos App.
A reliable recovery path is usually:
Plays but metadata is blank
First inspect whether the playback path regressed to play_uri(...).
Still chooses the wrong version
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.