Bring your music to life! SpotifyToWLED syncs the color palette of your Spotify album covers with your WLED LEDs for a vibrant, immersive experience.
- 🔐 Fixed Docker Spotify authentication - No more "Address already in use" errors
- 🔗 OAuth callback route for seamless Spotify login in Docker/headless environments
- 💾 Token caching - No need to re-authenticate on every restart
- 🏠 Home Assistant integration mode - Connect to external Docker servers
- 🔄 Proxy mode for lightweight HA addon deployment
- 📝 Enhanced documentation for all deployment scenarios
- 🏗️ Restructured codebase with proper modular architecture
- 🎨 Modern web UI with Bootstrap 5 and real-time updates
- ⚡ Performance improvements with caching and async operations
- 🔧 Enhanced configuration management with validation
- 📊 Color history tracking and visualization
- 🛡️ Better error handling with automatic retries
- 🔍 Multiple color extraction modes (vibrant, dominant, average)
- 💡 Advanced WLED controls (brightness, effects)
- 📡 Health monitoring for devices and API connections
- 📝 Comprehensive logging for debugging
- 🐳 Docker support with easy Portainer deployment
- 🏠 Home Assistant add-on for seamless smart home integration
Choose your deployment method:
Quick start:
docker run -d \
--name spotifytowled \
-p 5000:5000 \
-v $(pwd)/config:/config \
-v $(pwd)/data:/data \
--restart unless-stopped \
ghcr.io/raphaelbleier/spotifytowled:latestOr with Docker Compose:
docker-compose up -d📖 Full Docker & Portainer Guide →
- Add repository:
https://github.com/raphaelbleier/SpotifyToWled - Install SpotifyToWLED add-on
- Configure and start
- Open Web UI
Prerequisites:
- Python 3.9 or higher
- A Spotify Developer App (free): Create one here
- One or more WLED devices on your network
Installation:
-
Clone the repository:
git clone https://github.com/raphaelbleier/SpotifyToWled.git cd SpotifyToWled -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python run.py
-
Open your browser and navigate to:
http://localhost:5000 -
Configure the application:
- Get your Spotify credentials from Spotify Developer Dashboard
- In Spotify Dashboard, add redirect URI:
http://localhost:5000/callback(or your server IP) - Enter your Spotify Client ID and Client Secret
- Click Save Configuration
- Click Authenticate with Spotify button and log in
- Add your WLED device IP addresses
- Adjust refresh interval if needed
- Choose your preferred color extraction method
-
Start syncing and enjoy the light show! 🎶✨
- Vibrant (Recommended): Extracts the most saturated, vivid color from the album
- Dominant: Uses the most prevalent color in the album art
- Average: Calculates an average color from the palette
- Multiple device support
- Device health monitoring
- Brightness control
- Effect selection
- Automatic retry on connection failures
- Real-time status updates
- Color history visualization
- Device management
- Configuration management
- Responsive design for mobile and desktop
SpotifyToWled/
├── app/
│ ├── core/
│ │ ├── config.py # Configuration management
│ │ └── sync_engine.py # Main sync orchestrator
│ ├── utils/
│ │ ├── color_extractor.py # Color extraction with caching
│ │ ├── spotify_manager.py # Spotify API wrapper
│ │ └── wled_controller.py # WLED device controller
│ ├── routes/
│ │ └── web.py # Web routes and API endpoints
│ ├── templates/
│ │ ├── base.html # Base template
│ │ └── index.html # Main dashboard
│ ├── static/
│ │ ├── css/
│ │ │ └── style.css # Custom styles
│ │ └── js/
│ │ └── app.js # Client-side JavaScript
│ └── main.py # Application factory
├── run.py # Application entry point
├── requirements.txt # Python dependencies
└── config.json # Configuration file (auto-generated)
Configuration is stored in config.json (auto-generated on first run). You can also edit it directly:
{
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret",
"SPOTIFY_REDIRECT_URI": "http://localhost:5000/callback",
"SPOTIFY_SCOPE": "user-read-currently-playing",
"WLED_IPS": ["192.168.1.100", "192.168.1.101"],
"REFRESH_INTERVAL": 30,
"CACHE_DURATION": 5,
"MAX_RETRIES": 3,
"RETRY_DELAY": 2
}Perfect for home servers and NAS devices. Includes health checks and automatic restarts.
- Docker Deployment Guide - Complete guide for Docker and Portainer
- Pre-built images available on GitHub Container Registry
- Simple volume mapping for configuration persistence
Native integration with Home Assistant supervisor.
- Home Assistant Guide - Complete integration guide
- Official add-on available
- Ingress support for seamless UI access
- Automation examples included
Traditional installation for development or custom setups.
- Full control over environment
- Easy debugging and development
- See Quick Start section above
- Ensure your Client ID and Secret are correct
- Check that the redirect URI matches:
http://localhost:5000/callback - Make sure you've authorized the app in your browser
- Verify WLED devices are on the same network
- Check IP addresses are correct
- Use the health check button to test connectivity
- Ensure WLED firmware is up to date
- Increase the refresh interval for slower networks
- Reduce the number of WLED devices
- Clear the color cache if needed
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- WLED - Amazing LED control software
- Spotipy - Spotify Web API wrapper
- ColorThief - Color extraction library
Enjoy your synchronized light show! 🎵💡✨