Complete setup instructions for the Koa Sonos StreamDeck controller.
- Elgato StreamDeck+ (with dials and touchscreen)
- Sonos speaker (on same network)
- Raspberry Pi or computer running Linux/macOS
- Python 3.9 or higher
- pip (Python package manager)
- git
git clone <your-repo-url>
cd koa-sonospip3 install -r requirements.txtOr with virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtAdd your white noise audio file:
# Place your MP3 file in the music directory
cp /path/to/your/whitenoise.mp3 music/white_noise.mp3See music/README.md for audio sources and requirements.
Add icon images for your StreamDeck buttons:
# Add icon for white noise button (120x120 pixels recommended)
cp /path/to/whitenoise-icon.png icons/white_noise.png
# Add podcast icons
cp /path/to/mb-icon.png icons/mb.png
cp /path/to/sc-icon.png icons/sc.pngSee icons/README.md for icon creation tips.
Edit config.yaml to match your setup:
sonos:
speaker_name: "Your Speaker Name" # Change to your Sonos speaker name
podcasts:
feeds:
your-podcast:
name: "Your Podcast"
rss: "https://example.com/feed.xml"
icon: "icons/your-podcast.png"
button: 1See CONFIG_README.md for full configuration options.
python3 fetch_podcasts.pyThis will:
- Download the latest episodes from your configured podcasts
- Store them in the
podcasts/directory - Keep the most recent episodes (configurable)
python3 -c "import soco; print([s.player_name for s in soco.discover()])"Update config.yaml with the exact name shown.
python3 sonos_streamdeck.pyYou should see:
[HTTP] Serving /path/to/koa-sonos on port 8000
[Sonos] Connected to Speaker Name @ 192.168.x.x
[Deck] connected with 8 keys
[Main] Ready.
koa-sonos/
├── config.yaml # Your configuration
├── sonos_streamdeck.py # Main application
├── fetch_podcasts.py # Podcast downloader
├── music/
│ ├── README.md
│ └── white_noise.mp3 # YOUR FILE (not in git)
├── icons/
│ ├── README.md
│ ├── white_noise.png # YOUR FILE (not in git)
│ ├── mb.png # YOUR FILE (not in git)
│ └── sc.png # YOUR FILE (not in git)
├── podcasts/ # Downloaded episodes (not in git)
│ ├── million-bazillion/
│ │ └── *.mp3
│ └── short-and-curly/
│ └── *.mp3
└── tests/ # Test suite
- Ensure StreamDeck is connected via USB
- Check USB permissions (may need udev rules on Linux)
- Try:
lsusbto see if device is detected
- Verify Sonos speaker is on and connected to network
- Check speaker name matches exactly (case-sensitive)
- Ensure computer and Sonos are on same network
- Ensure all dependencies are installed:
pip3 install -r requirements.txt - Check Python version:
python3 --version(should be 3.9+)
- Verify icon files exist in
icons/directory - Check file permissions (should be readable)
- Ensure filenames match
config.yamlexactly
- Verify
music/white_noise.mp3exists - Check file is a valid MP3
- Try playing directly:
mpv music/white_noise.mp3
Create a systemd service:
sudo nano /etc/systemd/system/koa-sonos.service[Unit]
Description=Koa Sonos StreamDeck Controller
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/koa-sonos
ExecStart=/usr/bin/python3 /home/pi/koa-sonos/sonos_streamdeck.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable koa-sonos
sudo systemctl start koa-sonos
sudo systemctl status koa-sonosAdd to crontab to download new episodes daily:
crontab -eAdd:
0 6 * * * cd /home/pi/koa-sonos && /usr/bin/python3 fetch_podcasts.py
This downloads new episodes at 6am daily.
# Run all tests
python3 -m pytest -v
# Run specific test file
python3 -m pytest tests/test_sonos_streamdeck.py -v
# Run with coverage (requires pytest-cov)
python3 -m pytest --cov=. --cov-report=html- Tests are in
tests/directory - Run tests before and after changes
- Update documentation if adding features
- Check
TEST_README.mdfor testing guide
.gitignoreprevents committing binary files- Don't commit personal audio or images
config.yamlis tracked - don't put sensitive data there- Consider
config.local.yamlfor personal overrides (ignored by git)
- Check documentation files:
CONFIG_README.md- Configuration optionsTEST_README.md- Testing guideSTREAMDECK_CONTROLS.md- Control referenceTOUCHSCREEN_LAYOUT.md- Display layout
- Run tests to verify setup:
python3 -m pytest - Check console output for error messages
After setup is complete:
- Test white noise: Press button 0 or push dial 0
- Test volume: Turn dial 0
- Play a podcast: Press button 1 or 2
- Try scrubbing: Turn dial 1 during playback
- Adjust brightness: Turn dial 3
See STREAMDECK_CONTROLS.md for complete control reference.