Spotify controller for MagicMirror
- Showing Current playback on any devices
- Playing Controllable by Notification & touch (Play, pause, next, previous, volume)
- Spotify Controllable by Notification (change device, search and play)
-
Added :
SPOTIFY_TOGGLEnotification for toggling Play/Pause -
How to update from older version
cd ~/MagicMirror/modules/MMM-Spotify
git pullcd ~/MagicMirror/modules
git clone https://github.com/eouia/MMM-Spotify
cd MMM-Spotify
npm install- You should be a premium member of Spotify
- Go to https://developer.spotify.com
- Navigate to DASHBOARD > Create an app (fill information as your thought)
- Setup the app created, (EDIT SETTINGS)
- Redirect URIs. :
http://localhost:8888/callback - That's all you need. Just save it.
- Redirect URIs. :
- Now copy your Client ID and Client Secret to any memo
cd ~/MagicMirror/modules/MMM-Spotify
cp spotify.config.json.example spotify.config.json
nano spotify.config.jsonOr any editor as your wish be ok. Open the spotify.config.json then modify it. You need to just fill CLIENT_ID and CLIENT_SECRET. Then, save it.
{
"CLIENT_ID" : "YOUR_CLIENT_ID",
"CLIENT_SECRET" : "YOUR_CLIENT_SECRET",
"AUTH_DOMAIN" : "http://localhost",
"AUTH_PATH" : "/callback",
"AUTH_PORT" : "8888",
"SCOPE" : "user-read-private playlist-read-private streaming user-read-playback-state user-modify-playback-state",
"TOKEN" : "./token.json"
}cd ~/MagicMirror/modules/MMM-Spotify
node first_auth.jsThen, Allowance dialog popup will be opened. Log in(if it is needed) and allow it.
That's all. token.json will be created, if success.
cd ~/MagicMirror/modules/MMM-Spotify
npm install open{
module: "MMM-Spotify",
position: "bottom_left",
config: {
}
}{
module: "MMM-Spotify",
position: "bottom_left",
config: {
style: "default", // "default" or "mini" available
control: "default", //"default", "hidden" available
updateInterval: 1000,
onStart: null, // disable onStart feature with `null`
allowDevices: [], //If you want to limit devices to display info, use this.
// allowDevices: ["RASPOTIFY", "My iPhoneX", "My Home speaker"],
}
}You can control Spotify on start of MagicMirror (By example; Autoplay specific playlist when MM starts)
onStart: {
deviceName: "RASPOTIFY", //if null, current(last) activated device will be.
spotifyUri: "spotify:track:3ENXjRhFPkH8YSH3qBXTfQ"
//when search is set, sportifyUri will be ignored.
search: {
type: "playlist", // `artist`, track`, `album`, `playlist` and its combination(`artist,playlist,album`) be available
keyword: "death metal",
random:true,
}
}When search field exists, spotifyUri will be ignored.
SPOTIFY_SEARCH: search items with query and play it.type,query,randombe payloads
this.sendNotification("SPOTIFY_SEARCH", {type:"artist,playlist", query:"michael+jackson", random:false})
SPOTIFY_PLAY: playing specific SpotifyUri.
this.sendNotification("SPOTIFY_PLAY", "spotify:track:3ENXjRhFPkH8YSH3qBXTfQ")
The SPOTIFY_PLAY notification can also be used as resume feature of stopped/paused player, when used without payloads
SPOTIFY_PAUSE: pausing current playback.
this.sendNotification("SPOTIFY_PAUSE")
SPOTIFY_TOGGLE: toggling for playing/pausing
this.sendNotification("SPOTIFY_TOGGLE")
SPOTIFY_NEXT: next track of current playback.
this.sendNotification("SPOTIFY_NEXT")
SPOTIFY_PREVIOUS: previous track of current playback.
this.sendNotification("SPOTIFY_PREVIOUS")
SPOTIFY_VOLUME: setting volume of current playback. payload will be volume (0 - 100)
this.sendNotification("SPOTIFY_VOLUME", 50)
SPOTIFY_TRANSFER: change device of playing with device name (e.g: RASPOTIFY)
this.sendNotification("SPOTIFY_TRANSFER", "RASPOTIFY")
SPOTIFY_SHUFFLE: toggle shuffle mode.
this.sendNotification("SPOTIFY_SHUFFLE")
SPOTIFY_REPEAT: change repeat mode. (off->track->context)
this.sendNotification("SPOTIFY_REPEAT")
See the wiki
- Added : CSS variable for easy adjusting size. (Adjust only --sp-width to resize)
- Added : Hiding module when current playback device is inactivated. (More test might be needed, but...)
- Added: touch(click) interface
- Device Limitation : Now you can allow or limit devices to display its playing on MM.
- Some CSS structure is changed.
- Now this module can emit
SPOTIFY_*notifications for other module.
Special thanks to @ejay-ibm so much for taking the time to cowork to make this module.

