Note: for using this app you need a Spotify premium account and create your own Spotify app via their developer platform. Setting up the Spotify app is easy and eliminates any possible issues with the Spotify API rate limit.
Install the app (testversion)
What does this app get you?
This app adds the driver and device for Spotify Connect speakers. While it looks the same as the official Spotify app there’s a few benefits to using this one: it supports speaker capabilities. This means you can fully control the speaker from your devices tab or from a dashboard speaker widget
Features
- Setup access to your Spotify account using OAuth2
- Connect your Spotify Connect devices (they need to be online and connected to your account)
- Sync player state (track info & art, volume, repeat, shuffle and playing) every second
- Skip tracks (previous & next)
- Control volume (increase, decrease, slide and mute)
- Cycle repeat modes (off, track, placklist)
- Set shuffle mode (on or off)
Installation instructions
As mentioned earlier, this app requires you to create a Spotify app to isolate the usage to just your account. This prevents hitting rate limits in the Spotify API. After you’ve created the Spotify app following the instructions below you can proceed by adding the app to your Homey.
Create a Spotify app
- Go to the Spotify developer dashboard and login if needed
- Click the create app button
- Name your app, for example
Spotify Connect
- Enter a description, for example
Spotify Connect driver for Homey
- As redirect URI add at least
https://callback.athom.com/oauth2/callback
- For used APIs select
Web API
- You can leave all other fields blank
- Save the app and on the following page you can view your Client ID and Client Secret. You can copy these now or go back here later
- Go to the User Management tab and add your own Spotify e-mailaddress as user that is allowed to access this app
Your app will be in “Development mode” which is fine as the rate limit in this mode provides enough flexibility for the usage of a single (active) speaker.
Install Spotify Connect app
- Go to the Spotify Connect app store page and install the app
- Use the Homey app or web interface to managed the installed apps, find Spotify Connect, go to settings and edit the app settings. You need to add the Client ID and secret codes here.
- Go back to your Homey devices and click the add button, use the Spotify Connect driver and follow the steps of accepting the OAuth request and allowing the app to access your Spotify data. As soon as the OAuth has succeeded, the driver will show the available devices to you.
After setting up your device the device card allows access to basic speaker capabilities and the media widgets of Homey dashboard (note: dashboard is currently a beta feature for Homey) allow you to control the speaker and see it’s active state!
Known limitations
- You are only able to connect a Spotify Connect device as long as it’s actively connected to the Spotify account used to setup the app with on your Homey. If a speaker is shared by 2 different accounts (f.e. using the Spotify iOS app), it will be actively connected to the user that last used the device (see this post)
- Sonos devices are not supported as these speakers can only be controlled using Sonos’ platform / api and this app is limited to the capabilities of the Spotify API
- Google devices have the same limitation and are therefor not supported!
Source code
I’ve open-source the source code of this app. It can be found in the Github repository below. Feel free to contribute.