sonos-control

Control Sonos speakers on Tim's home network. Use when the user wants to (1) play, pause, or stop music on Sonos speakers, (2) change volume on speakers, (3) skip tracks, (4) check what's playing, (5) see speaker status, (6) group or ungroup speakers, (7) any Sonos or music/audio playback task involving home speakers. Triggers on "sonos", "speakers", "play music", "what's playing", "volume", "turn up", "turn down", "pause music", "stop music".

6 stars

Best use case

sonos-control is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Control Sonos speakers on Tim's home network. Use when the user wants to (1) play, pause, or stop music on Sonos speakers, (2) change volume on speakers, (3) skip tracks, (4) check what's playing, (5) see speaker status, (6) group or ungroup speakers, (7) any Sonos or music/audio playback task involving home speakers. Triggers on "sonos", "speakers", "play music", "what's playing", "volume", "turn up", "turn down", "pause music", "stop music".

Teams using sonos-control should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sonos-control/SKILL.md --create-dirs "https://raw.githubusercontent.com/tdhopper/dotfiles2.0/main/.claude/skills/sonos-control/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sonos-control/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sonos-control Compares

Feature / Agentsonos-controlStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Control Sonos speakers on Tim's home network. Use when the user wants to (1) play, pause, or stop music on Sonos speakers, (2) change volume on speakers, (3) skip tracks, (4) check what's playing, (5) see speaker status, (6) group or ungroup speakers, (7) any Sonos or music/audio playback task involving home speakers. Triggers on "sonos", "speakers", "play music", "what's playing", "volume", "turn up", "turn down", "pause music", "stop music".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Sonos Speaker Control

Control Tim's 12 Sonos speakers via the `sonos-ctl` CLI tool at `~/.local/bin/sonos-ctl`.

Read [references/speaker-inventory.md](references/speaker-inventory.md) for the full speaker list, IPs, and network details.

## Quick Reference

```bash
sonos-ctl status                # Show all speakers with volume, state, now playing
sonos-ctl play <speaker>        # Play/resume
sonos-ctl pause <speaker>       # Pause
sonos-ctl stop <speaker>        # Stop
sonos-ctl vol <speaker>         # Get current volume
sonos-ctl vol <speaker> <0-100> # Set volume
sonos-ctl next <speaker>        # Next track
sonos-ctl prev <speaker>        # Previous track
```

Speaker names use **case-insensitive partial matching**: `office`, `patio`, `kitchen`, `gravity`, `porch`, `mezzanine`, etc.

## Network Architecture

The Sonos speakers are on the IoT VLAN (`10.20.1.x`), separate from Tim's Mac (`10.20.4.x`). The `sonos-ctl` script uses `curl --interface en0` to bypass the corporate VPN (which would otherwise route traffic through the tunnel instead of the local gateway).

**If `sonos-ctl` stops working**, the likely causes are:
1. **VPN routing changed** - verify `curl --interface en0 -m 3 http://10.20.1.43:1400/xml/device_description.xml` still works
2. **Speaker IPs changed** - re-discover with `dns-sd -B _sonos._tcp local.` then resolve IPs with `dns-sd -L "<instance>" _sonos._tcp local.`
3. **New speakers added** - same discovery process, then update the SPEAKERS map in `~/.local/bin/sonos-ctl`

## Common Patterns

### Check what's playing everywhere
```bash
sonos-ctl status
```

### Play/pause a specific room
```bash
sonos-ctl play office
sonos-ctl pause office
```

### Adjust volume
```bash
sonos-ctl vol office        # check current
sonos-ctl vol office 20     # set to 20
```

### Bulk operations
Loop over speakers with bash:
```bash
for spk in office kitchen patio; do sonos-ctl pause "$spk"; done
for spk in office kitchen patio; do sonos-ctl vol "$spk" 15; done
```

## Direct UPnP API (Advanced)

The `sonos-ctl` script wraps UPnP SOAP calls. For operations not covered by the script, you can make raw SOAP calls. Always use `curl --interface en0` to bypass the VPN.

### Get device info
```bash
curl -s --interface en0 -m 3 "http://<IP>:1400/xml/device_description.xml"
```

### SOAP call pattern
```bash
curl -s --interface en0 -m 3 "http://<IP>:1400/<endpoint>" \
  -H "Content-Type: text/xml; charset=utf-8" \
  -H 'SOAPAction: "urn:schemas-upnp-org:service:<Service>:1#<Action>"' \
  -d '<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:Body>
    <u:<Action> xmlns:u="urn:schemas-upnp-org:service:<Service>:1">
      <body params here>
    </u:<Action>>
  </s:Body>
</s:Envelope>'
```

### Key UPnP endpoints

| Endpoint | Service | Common Actions |
|----------|---------|----------------|
| `/MediaRenderer/AVTransport/Control` | AVTransport | Play, Pause, Stop, Next, Previous, GetTransportInfo, GetPositionInfo, SetAVTransportURI |
| `/MediaRenderer/RenderingControl/Control` | RenderingControl | GetVolume, SetVolume, GetMute, SetMute |
| `/ZoneGroupTopology/Control` | ZoneGroupTopology | GetZoneGroupState (discover all speakers and groups) |
| `/MediaServer/ContentDirectory/Control` | ContentDirectory | Browse (queue, favorites) |

### Grouping speakers (not yet in sonos-ctl)

To group a speaker with a coordinator, set the speaker's AVTransport URI to the coordinator's URI:
```bash
# Get coordinator's URI: x-rincon:<COORDINATOR_UUID>
# Then on the speaker to join:
curl -s --interface en0 -m 3 "http://<JOINER_IP>:1400/MediaRenderer/AVTransport/Control" \
  -H "Content-Type: text/xml; charset=utf-8" \
  -H 'SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"' \
  -d '...SetAVTransportURI...<CurrentURI>x-rincon:RINCON_COORDINATOR_UUID</CurrentURI>...'
```

To ungroup, call `BecomeCoordinatorOfStandaloneGroup` on the speaker.

Related Skills

stop-slop

6
from tdhopper/dotfiles2.0

Use this skill when writing or editing prose to eliminate predictable AI writing patterns. Helps make writing more direct, authentic, and human.

slack-message

6
from tdhopper/dotfiles2.0

Draft and send Slack messages in Tim's natural voice. Use when the user wants to (1) post an update to a channel, (2) draft a Slack message, (3) share something on Slack, (4) send a DM, (5) reply in a thread. Applies Tim's Slack writing style and prose principles automatically.

skill-creator

6
from tdhopper/dotfiles2.0

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

sending-to-codex

6
from tdhopper/dotfiles2.0

Delegate tasks or ask questions to OpenAI's Codex CLI from within Claude Code. Use this skill when the user says "ask codex", "send to codex", "delegate to codex", "have codex do this", "get codex's opinion", "run this in codex", or wants to offload a coding task or question to the Codex agent. Supports both fire-and-forget coding tasks (fix bugs, add features, refactor) and research questions (analyze code, explain behavior, get a second opinion).

reviewing-writing

6
from tdhopper/dotfiles2.0

Review and critique writing using Michael Nielsen's principles on craft. Analyzes text for purpose focus, brevity, danger words, opening strength, originality, reader psychology, truthfulness, and title impact. Use when the user says "review my writing", "nielsen review", "writing review", "review this writing", "critique my writing", or asks for feedback on prose quality.

reviewing-code

6
from tdhopper/dotfiles2.0

Review pull requests, branch changes, or code diffs. Triggers on "review this PR", "review my changes", "code review", "review branch", or GitHub PR URLs. Focuses on bugs, tests, complexity, and performance - not linting.

resend-email

6
from tdhopper/dotfiles2.0

Send emails via Resend.com API. Use when the user wants to (1) send an email, (2) email someone, (3) send a message to an email address, (4) send email with attachments, (5) schedule an email for later. Requires RESEND_API_KEY environment variable.

refresh-dotfiles

6
from tdhopper/dotfiles2.0

Full sync of personal (yadm) and work (yadm-work) dotfiles. Pulls remote changes, commits and pushes local changes, and audits for untracked files that should be tracked. Use when the user says 'refresh yadm', 'sync dotfiles', 'dotfiles sync', or 'update dotfiles'.

omnifocus

6
from tdhopper/dotfiles2.0

Interact with OmniFocus task manager via the command-line interface (@stephendolan/omnifocus-cli). Use when the user wants to: (1) Add tasks or projects to OmniFocus, (2) List, view, or search tasks/projects, (3) Update or complete tasks, (4) Manage inbox items, (5) Work with tags and analyze tag usage, (6) Process or organize their OmniFocus database from the command line.

omnifocus-triage

6
from tdhopper/dotfiles2.0

Interactively process OmniFocus inbox items using AskUserQuestion. Use when the user wants to (1) triage their inbox, (2) process inbox items, (3) organize their OmniFocus inbox, (4) clear out their inbox, (5) do a GTD-style inbox review. Triggers on "triage inbox", "process inbox", "organize inbox", "clear inbox", "inbox zero".

Nightshift

6
from tdhopper/dotfiles2.0

Manage and interact with Nightshift, an AI-powered development automation tool that runs coding tasks during off-hours.

modal

6
from tdhopper/dotfiles2.0

Run code on Modal's cloud infrastructure via `uvx modal run`. Use whenever the user wants to (1) validate handbook tutorial shell commands on a fresh Debian container from scratch (uv, pip, build tooling, etc. with no cached state from Tim's laptop), (2) test GPU-specific Python code (torch, CUDA, cupy, transformers, CUDA wheels) on real hardware, or (3) reproduce a "does this actually work from zero?" check. Trigger on phrases like "run this on modal", "test on a fresh machine", "try this on a GPU", "validate from scratch", "does the tutorial work end-to-end", "test this without my venv state", or any mention of modal.com / cloud GPUs / ephemeral containers for verification. Also trigger when the user is writing a handbook tutorial that involves GPU installs (PyTorch, CUDA wheels) and they want to confirm the commands work.