Before we dive into the process of installing Spotify display on MagicMirror, it’s essential to clarify that MagicMirror is an open-source modular smart mirror platform. It’s a Raspberry Pi powered project that is highly configurable and customizable, adapt for personal use or project demonstration, and Spotify is a digital music streaming service that gives users access to millions of songs and podcasts. Spotify installation on MagicMirror can offer users the luxury of controlling their music right from the mirror while also being able to visualize what’s playing.
Now, let’s go through the step-by-step process of installing Spotify on MagicMirror.
Step 1: Setting Up Your MagicMirror
Assuming that you already have your MagicMirror set up and running, we move to the first step of adding Spotify. If not, there are plenty of comprehensive guides available that can help you assemble and install MagicMirror.
Step 2: Installation of MagicMirror Spotify Module
To add Spotify to your MagicMirror, you’ll need a module called MMM-Spotify. This module displays the currently playing song on your MagicMirror.
Open the terminal in your Raspberry Pi and navigate to MagicMirror’s modules folder by typing the command below:
cd ~/MagicMirror/modules
This command sends you directly to the ‘modules’ folder where all other MagicMirror modules are located.
Here you want to clone the MMM-Spotify repository by typing:
git clone https://github.com/raywo/MMM-NowPlayingOnSpotify.git
Once you’ve cloned the module, the next step is to navigate into the module’s folder and install the module’s dependencies with npm. In the terminal type the following commands:
cd MMM-NowPlayingOnSpotify
npm install
Step 3: Spotify Developer Account and App Credentials
Next, you will need credentials from Spotify to connect the MagicMirror module with your Spotify account.
Visit the Spotify Developer Dashboard at https://developer.spotify.com/dashboard/. Click on ‘Log In’, then sign in with your Spotify account. This is the account that will be linked to your MagicMirror.
Once you’re logged in, click create an app. Here you can name it whatever you’d like – ‘MagicMirror Spotify’ can be a good name. For the app description, you can also fill in ‘MagicMirror App’. Then check both boxes and click ‘CREATE’.
Step 4: Getting Client ID, Client Secret, and Callback URL
In this step, you’re provided with a ‘Client ID’ and a ‘Client Secret’, necessary for the module configuration. For security reasons, ensure to keep these codes private and not share them under any circumstances.
Click on the ‘Edit Settings’ button and provide a redirect URI. For successful integration of MMM-Spotify with your MagicMirror, use ‘http://localhost:8888/callback‘ as your redirect URI. Save this URI by scroll down and click ‘SAVE’. It is crucial to note that Spotify restrictions require that the URI provided in the module configuration file must match exactly.
Step 5: Configure the MagicMirror Config File
The final step involves adding the MMM-Spotify module to your MagicMirror config file. Navigate to:
cd ~/MagicMirror/config
Open your config file using Nano or another text editor:
nano config.js
In the modules array, add an object that represents the MMM-Spotify module. You should fill in the ‘Client ID’, ‘Client Secret’ and ‘Callback URL’ in the config part.
//inside the modules array
{
module: 'MMM-NowPlayingOnSpotify',
position: 'top_right',
config: {
clientID: 'your-client-id',
clientSecret: 'your-client-secret',
accessToken: 'your-access-token',
refreshToken: 'your-refresh-token'
}
}
Exit and save the file, and you are set. Now all you have to do is restart your MagicMirror.
pm2 restart MagicMirror
Once the mirror is up and running again, you should see a Spotify module in the upper right corner. If you’re currently playing a song on your Spotify account, the mirror will display the song on your screen.
This Spotify-enabled MagicMirror will allow you to switch tracks, play, and pause using alarms or sensors, sync your playlist to create a morning routine, add elegance to your space, and so forth. There’s a certain sophistication that comes with artfully blending tech functionality into home decor. With Spotify on your MagicMirror, you’re not only bringing your mirror to life but also adding a gem to your smart home ecosystem.
Keywords:
- Spotify
- MagicMirror
- Raspberry Pi
- MMM-Spotify module
- Spotify Developer Account
- Home smart ecosystem
- NowPlayingOnSpotify.