Only a small two weeks ago, I acquired an Amazon Echo Dot, together with a Bose SoundTouch 10. An amazing combination for music playback! However, few possibilities for music services are currently available. Standard support for Amazon Music Unlimited and Spotify is provided. There is also a skill available for music playback from SoundCloud, called and a developer called Steve Gattuso is actively updating his project, enabling playback from Music. Magic Jukebox geemusic Google As a developer, I wanted to broaden the spectrum a bit by giving Alexa users access to their own Plex Music Player. As I previously wrote an in on how to create your own Alexa Skills, I will not be going into much of the details here. This time, is used for the deployment of the application, but almost any platform can be used. Do keep in mind that deployment on PythonAnywhere will not work for this application, as their whitelist does not allow access to the Plex servers. depth tutorial Heroku The Code The project is provided on GitHub and will be updated in the future. The purpose of this project is to give Alexa users a way to playback music, using their own Plex server. However, it is also a way to show developers a method to integrate Plex into Alexa as a music service. The application does however not enable remote control of Plex instances, nor does it (as for this moment) include a global technique of authentication. However, a detailed overview on how to setup this application is provided in the next section. PlexMusicPlayer The Setup As previously mentioned, I deployed this project using Heroku. Their free tier allows a single web application to be run upon a free However, keep in mind that this dyno is limited to 550 usage hours per month (or 1000 if verified with a credit card) and that the application goes into sleep mode after 30 minutes of receiving no web traffic. In their FAQ, they say the following about the usage of a free dyno: dyno. If an app has a web dyno that runs using a Free dyno, and that web dyno receives no traffic in a 30 minute period, the web dyno will sleep. In addition to the web dyno sleeping, the worker dyno (if present) will also sleep. Free dynos do not consume Free dyno hours while sleeping. This means that the free tier is more than enough for self-deployment of the application. However, keep in mind that if the application goes into sleep mode, it takes some time to start up again. This has a big impact on the application, as the first query by the user will result in a timeout, responding with the following error. The remote endpoint could not be called, or the response it returned was invalid. Even though this first query fails, it produces web traffic to our application deployed on Heroku, allowing it to wake up. After a small twenty seconds or so, the wake up sequence has finished and the application can be used. Deployment on Heroku First, you should have Heroku and Git installed on your local machine. If you have not yet worked with Heroku before, the installation process can be found . Also, make sure that you are already logged in with Heroku account. here Next, we want to clone the current GitHub repository of this project. First, open up a terminal (or command prompt) and navigate to the directory you want the files to be stored in. Then, use the following command to clone the repo. git clone https://github.com/tyzer34/plexmusicplayer.git Now that the files have been cloned locally, they can be deployed on Heroku. To set up this Heroku server, the following commands should be used. Note that should be replaced by something else. *yourServerName* heroku create *yourServerName*git push heroku master The application should normally be online now! Now we just have to set the authentication variables on the server and set up the Alexa Skill. Getting Authentication Variables In order to authenticate the PlexMusicPlayer application, two environmental variables need to be set, namely the and the . Plex token base url First, you will need to navigate to , select a random episode, show, etc. and click the three dots on the left (as shown in the picture below in Dutch). Next, right click the option and select plex.tv/web/app Download copy link address. The copied link address form should normally look something like this (with the parts filled in though): our_plex_token https://your-plex-ip-address.some_long_encoded_string.plex.direct:your_plex_port/library/parts/some_id/some_file_id/file.ext?download=1&X-Plex-Token=y When looking at this long url, both needed variables can be extracted as following. It is important for the base url that the / after is not copied with. your_plex_port = base url https://your-plex-ip-address.some_long_encoded_string.plex.direct:your_plex_port = our_plex_token Plex token y Now, we have to set these environmental variables in our Heroku server. To do this, go back to the terminal (or command prompt) and enter the following lines, changed with your extracted variables. heroku config:set PLEX_TOKEN=your_plex_tokenheroku config:set PLEX_URL= https://your-plex-ip-address.some_long_encoded_string.plex.direct:your_plex_port Lastly, we just have to restart the server so it can cope with the set environmental variables. To do this, just use the following command. heroku restart Making the Alexa Skill Now that the backend is fully up and running, the Alexa Skill has to be initialized on . If you have not done this before, you can follow this . Amazon Developers step-by-step explenation As for the invocation name, I chose However, this can be anything you want. The information needed to fill in the Intent Schema and Sample Utterances can be found in the , in the folder. plexmusic. GitHub repository speech_assets Next, the endpoint needs to be set to with the following link (with the changed to the previously selected one) HTTPS *yourServerName* https://*yourServerName*.herokuapp.com/plex Lastly, select the 2nd option at for endpoint and save your application. certificate Congratulations! PlexMusicPlayer is now up and running on your favorite Alexa device(s). Now, you are ready to try out some of its functionalities! The Functionalities Currently, PlexMusicPlayer is able to playback music based on a provided artist, album or song title. When an artist or album is provided and multiple songs are available for that artist or album in your Plex library, these will be queued and played as a playlist. Furthermore, it is possible to ask information related to the current song or to shuffle the current playlist. Obviously, requests such as next and play are also implemented. Some activation sentences are provided as an example below. More can be found in the . sample utterances file Alexa, ask plexmusic to play Def Leppard. Alexa, ask plexmusic to play the album AM by Arctic Monkeys. Alexa, ask plexmusic to tell me the name of this song. Alexa, ask plexmusic to play “my favorites” playlist. The Future As this is only an initial implementation, there is a lot of room for improvement and extra functionality. Below is a list of some of the things I’d like to see implemented in the project. Please note that there is no distinction between minor and major improvements in these examples. Enabling user authentication based on a Plex PIN ( ) node.js implementation Implementing more playback functionalities, such as playback based on genre or year Adding Alexa cards to show the requested song, album or artist with a picture Making more intents, so the user can request specific actions such as what year the song is from Tracking of these future implementations are provided in the GitHub repository. User contributions and improvements are also welcome! Hopefully, this guide was able to allow music playback from your Plex Media Server on Echo devices. If there are any issues or questions, please do not hesitate to open up an issue on GitHub.