Skip to content

mase1981/uc-intg-spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

42 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spotify Integration for Unfolded Circle Remote 2/3

Control Spotify playback directly from your Unfolded Circle Remote 2 or Remote 3 with full media browsing, search, Spotify Connect device switching, and real-time playback updates with album artwork.

Spotify GitHub Release License GitHub issues Community Forum Discord GitHub Downloads (all assets, all releases) Buy Me A Coffee PayPal Github Sponsors


โค๏ธ Support Development โค๏ธ

If you find this integration useful, consider supporting development:

GitHub Sponsors Buy Me A Coffee PayPal

Your support helps maintain this integration. Thank you! โค๏ธ

Features

๐ŸŽต Media Player

  • Playback Controls โ€” Play/Pause, Next, Previous, Seek, Shuffle, Repeat
  • Volume Management โ€” Precise 1% step volume control with instant UI feedback
  • Media Information โ€” Title, artist, album with high-quality artwork and live progress
  • Source Selection โ€” Switch between all Spotify Connect devices
  • Real-time Updates โ€” 10-second polling with optimistic state updates

๐Ÿ“‚ Media Browser

Browse and play your Spotify library directly from the Remote's media browser:

  • Playlists โ€” All your playlists with artwork
  • Saved Albums โ€” Your album library
  • Liked Songs โ€” Saved tracks collection
  • Top Tracks โ€” Your most-played tracks
  • Top Artists โ€” Your most-listened artists with top tracks and discography
  • Followed Artists โ€” Artists you follow
  • Recently Played โ€” Recent listening history
  • New Releases โ€” Latest album releases
  • Search โ€” Full-text search across tracks, albums, artists, and playlists

๐Ÿ”Š Spotify Connect Device Switching

  • Three-Source Discovery โ€” Devices from Spotify API + Zeroconf/mDNS + 24h cache
  • Zeroconf/mDNS โ€” Discovers devices on your local network (even when idle)
  • Smart Name Resolution โ€” Queries each device's getInfo endpoint for real friendly names
  • Device Caching โ€” Previously-seen devices remain available for 24 hours
  • Instant Switching โ€” Transfer playback between devices with one tap

๐ŸŽฎ Remote Control

  • Physical Button Mapping โ€” Play/Pause, Next, Previous, Volume Up/Down
  • Custom UI Page โ€” Playback controls with shuffle and repeat
  • Simple Commands โ€” Play, Pause, Next, Previous, Volume Up/Down, Shuffle, Repeat

๐Ÿ“Š Sensors

  • Now Playing โ€” Current track title and artist as text
  • Active Device โ€” Currently active Spotify Connect playback device

๐ŸŽ›๏ธ Select Entity

  • Active Device โ€” Browse and switch between all discovered Spotify Connect devices with next/previous cycling

Protocol & Requirements

  • Protocol: Spotify Web API (OAuth 2.0 Authorization Code Flow)
  • Account: Spotify Premium required (API no longer supports Free accounts)
  • Internet: Required for Spotify API access
  • Local Network: Required for Zeroconf device discovery
  • Polling: 10-second intervals (configurable)
  • Token Management: Automatic refresh with persistence

Installation

Option 1: Remote Web Interface (Recommended)

  1. Navigate to the Releases page
  2. Download the latest uc-intg-spotify-<version>-aarch64.tar.gz file
  3. Open your remote's web interface (http://your-remote-ip)
  4. Go to Settings โ†’ Integrations โ†’ Add Integration
  5. Click Upload and select the downloaded .tar.gz file

Option 2: Docker (Advanced Users)

Image: ghcr.io/mase1981/uc-intg-spotify:latest

Docker Compose:

services:
  uc-intg-spotify:
    image: ghcr.io/mase1981/uc-intg-spotify:latest
    container_name: uc-intg-spotify
    network_mode: host
    volumes:
      - </local/path>:/data
    environment:
      - UC_CONFIG_HOME=/data
      - UC_INTEGRATION_HTTP_PORT=9090
      - PYTHONPATH=/app
    restart: unless-stopped

Docker Run:

docker run -d --name=uc-intg-spotify --network host -v </local/path>:/data -e UC_CONFIG_HOME=/data -e UC_INTEGRATION_HTTP_PORT=9090 -e PYTHONPATH=/app --restart unless-stopped ghcr.io/mase1981/uc-intg-spotify:latest

Prerequisites

Spotify Developer App Setup

BEFORE INSTALLATION: Create a Spotify Developer App (free, 5 minutes):

  1. Go to Spotify Developer Dashboard
  2. Log in with your Premium Spotify account
  3. Click "Create App"
  4. Fill in:
    • App Name: UC Remote (or any name)
    • App Description: Unfolded Circle Remote integration
    • Redirect URI: https://example.com/callback โš ๏ธ Must be exactly this
    • API: Check "Web API"
  5. Click "Save"
  6. Note your Client ID and Client Secret (click "Show Client Secret")

Important Notes:

  • โœ… Spotify Premium required โ€” API no longer supports Free accounts
  • โœ… Redirect URI must be exactly https://example.com/callback
  • โœ… Keep credentials secure โ€” don't share them
  • โœ… No recurring costs โ€” one-time setup

Configuration

Step 1: Enter App Credentials

  1. After installation, go to Settings โ†’ Integrations โ†’ Spotify
  2. Click "Configure"
  3. Enter your Spotify Client ID
  4. Enter your Spotify Client Secret
  5. Click Next

Step 2: Authentication

  1. Click the Spotify authorization URL displayed on screen
  2. Log into your Spotify account and click Agree
  3. Browser shows "page not found" โ€” this is normal!
  4. Copy the code=... value from the browser address bar (or paste the entire URL)
  5. Paste into setup form and click Finish

Step 3: Completion

Five entities are created automatically:

  • Spotify Player โ€” Media Player with browse, search, and playback control
  • Spotify Remote โ€” Remote entity with button mappings and custom UI
  • Spotify Active Device โ€” Select entity for device switching
  • Spotify Now Playing โ€” Sensor showing current track
  • Spotify Active Device โ€” Sensor showing active playback device

Credits

  • Developer: Meir Miyara
  • Protocol: Spotify Web API with OAuth 2.0
  • Framework: Unfolded Circle ucapi-framework
  • Discovery: Zeroconf/mDNS for Spotify Connect device resolution
  • Community: Testing and feedback from UC community

License

This project is licensed under the MPL-2.0 License - see LICENSE file for details.

Legal Disclaimer

This is an independent, unofficial project using Spotify's public Web API. Not sponsored, endorsed, or affiliated with Spotify AB.

Support & Community


Made with โค๏ธ for the Unfolded Circle and Spotify Communities โ€” Thank You: Meir Miyara

About

An unfolded circle integration for Spotify Currently Playing media and controls

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors