š Home Music OpenClaw Skill - ClawHub
Do you want your AI agent to automate Home Music workflows? This free skill from ClawHub helps with smart home & iot tasks without building custom tools from scratch.
What this skill does
Control whole-house music scenes combining Spotify playback with Airfoil speaker routing. Quick presets for morning, party, chill modes.
Install
npx clawhub@latest install home-musicFull SKILL.md
Open original| name | description | homepage |
|---|---|---|
| home-music | Control whole-house music scenes combining Spotify playback with Airfoil speaker routing. Quick presets for morning, party, chill modes. | local |
āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā«
š H O M E M U S I C šµ
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Whole-House Music Scenes ā
ā One command. All speakers. Perfect. ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā« āŖ ā«
"Why click 17 times when one command does the job?" ā Owen šø
šÆ What Does This Skill Do?
Home Music combines Spotify + Airfoil into magical music scenes. One command ā and the right playlist plays on the right speakers at the perfect volume.
Imagine:
- You wake up ā
home-music morningā Gentle tunes in the bathroom - Friends arrive ā
home-music partyā All speakers blasting rock - Time to relax ā
home-music chillā Lounge vibes everywhere - Done for the day ā
home-music offā Silence. Peace. Serenity.
š Dependencies
| What | Why | Link |
|---|---|---|
| š macOS | This skill uses AppleScript | ā |
| š¢ Spotify Desktop App | The music source! Must be running. | spotify.com |
| š” Airfoil | Routes audio to AirPlay speakers | rogueamoeba.com |
| šµ spotify-applescript | Clawdbot skill for Spotify control | skills/spotify-applescript/ |
ā ļø Important: Both Spotify and Airfoil must be running before you start any scenes!
š¬ Scenes
š Morning
A gentle start to your day
home-music morning
- Speaker: Sonos Move
- Volume: 40%
- Playlist: Morning Playlist
- Vibe: ā Coffee + good vibes
š Party
Time to celebrate!
home-music party
- Speaker: ALL (Computer, MacBook, Sonos Move, Living Room TV)
- Volume: 70%
- Playlist: Rock Party Mix
- Vibe: š¤ Neighbors hate this one trick
š Chill
Pure relaxation
home-music chill
- Speaker: Sonos Move
- Volume: 30%
- Playlist: Chill Lounge
- Vibe: š§ Om...
š Off
Silence
home-music off
- Pauses Spotify
- Disconnects all speakers
- Vibe: 𤫠Finally, peace and quiet
š Status
What's playing right now?
home-music status
Shows:
- Current Spotify track
- Connected speakers
š§ Installation
# Make the script executable
chmod +x ~/clawd/skills/home-music/home-music.sh
# Symlink for global access
sudo ln -sf ~/clawd/skills/home-music/home-music.sh /usr/local/bin/home-music
Now home-music works from anywhere in your terminal! š
šØ Custom Playlists & Scenes
Changing Playlists
Open home-music.sh and find the playlist configuration:
# === PLAYLIST CONFIGURATION ===
PLAYLIST_MORNING="spotify:playlist:19n65kQ5NEKgkvSAla5IF6"
PLAYLIST_PARTY="spotify:playlist:37i9dQZF1DXaXB8fQg7xif"
PLAYLIST_CHILL="spotify:playlist:37i9dQZF1DWTwnEm1IYyoj"
How to find Playlist URIs:
- Right-click on a playlist in Spotify
- "Share" ā "Copy Spotify URI"
- Or copy the URL and extract the
/playlist/part
Adding a New Scene
Add a new case in the main block:
# In home-music.sh after the "scene_chill" function:
scene_workout() {
echo "šŖ Starting Workout scene..."
airfoil_set_source_spotify
airfoil_connect "Sonos Move"
sleep 0.5
airfoil_volume "Sonos Move" 0.8
"$SPOTIFY_CMD" play "spotify:playlist:YOUR_WORKOUT_PLAYLIST"
"$SPOTIFY_CMD" volume 100
echo "ā
Workout: Sonos Move @ 80%, Pump it up!"
}
# And in the case block:
workout)
scene_workout
;;
Available Speakers
ALL_SPEAKERS=("Computer" "Andy's M5 Macbook" "Sonos Move" "Living Room TV")
You can add any AirPlay speaker ā they just need to be visible in Airfoil.
š Troubleshooting
ā "Speaker won't connect"
Check 1: Is Airfoil running?
pgrep -x Airfoil || echo "Airfoil is not running!"
Check 2: Is the speaker on the network?
- Open the Airfoil app
- Check if the speaker appears in the list
- Try connecting manually
Check 3: Is the name exactly correct?
- Speaker names are case-sensitive!
- Open Airfoil and copy the exact name
ā "No sound"
Check 1: Is Spotify playing?
~/clawd/skills/spotify-applescript/spotify.sh status
Check 2: Is the Airfoil source correct?
- Open Airfoil
- Check if "Spotify" is selected as the audio source
- If not: Click "Source" ā Select Spotify
Check 3: Speaker volume?
# Manually check volume
osascript -e 'tell application "Airfoil" to get volume of (first speaker whose name is "Sonos Move")'
ā "Spotify won't start"
Is Spotify open?
pgrep -x Spotify || open -a Spotify
Is spotify-applescript installed?
ls ~/clawd/skills/spotify-applescript/spotify.sh
ā "Permission denied"
chmod +x ~/clawd/skills/home-music/home-music.sh
š Direct Airfoil Commands
If you want to control Airfoil manually:
# Connect a speaker
osascript -e 'tell application "Airfoil" to connect to (first speaker whose name is "Sonos Move")'
# Set speaker volume (0.0 - 1.0)
osascript -e 'tell application "Airfoil" to set (volume of (first speaker whose name is "Sonos Move")) to 0.5'
# Disconnect a speaker
osascript -e 'tell application "Airfoil" to disconnect from (first speaker whose name is "Sonos Move")'
# List connected speakers
osascript -e 'tell application "Airfoil" to get name of every speaker whose connected is true'
# Set audio source
osascript -e 'tell application "Airfoil"
set theSource to (first application source whose name contains "Spotify")
set current audio source to theSource
end tell'
š Files
skills/home-music/
āāā SKILL.md # This documentation
āāā home-music.sh # The main script
š” Pro Tips
-
Set aliases for even faster access:
alias mm="home-music morning" alias mp="home-music party" alias mc="home-music chill" alias mo="home-music off" -
Use with Clawdbot:
"Hey, start party mode" "Put on some chill music" "Stop the music"
-
Combine scenes: Create a
dinnerscene with a jazz playlist at 25% ā perfect for guests!
šø Credits
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā®
ā ā
ā Crafted with š by Owen the Frog šø ā
ā ā
ā "Ribbit. Music makes everything better." ā
ā ā
ā°āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāÆ
Author: Andy Steinberger (with help from his Clawdbot Owen the Frog šø)
Version: 1.0.0
License: MIT
Pond: The one with the water lilies šŖ·
Did this skill improve your life? Owen appreciates flies. šŖ°