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
π Full Home Assistant Guide β
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! π΅π‘β¨