Integration from Plex to SmartThings, notifying a smartapp when media starts playing (or pauses/stops) on Plex.
- SmartThings home automation system.
- Plex Media Server
-
Go to https://graph.api.smartthings.com/ide/apps and create a new SmartApp.
-
Fill out the required fields.
-
Replace the generated app source code with the code from the file SmartApp_Source.groovy.txt.
-
Save and publish the app for yourself.
-
Either configure the app online and note down the API Token and API Endpoint values, or install the app through the SmartThings app and click Api Information to find the token and endpoints.
-
Compile the Plex2SmartThings application.
-
Open the config.config file.
-
In config/smartThingsEndpoints fill in your API token and endpoint urls. Be sure to keep the /statechanged/on* at the end of the urls.
-
If plex and this application is not running on the same server then enter the url to the session status page of your plex server in the config/plexCheck/@plexStatusUrl attribute.
-
If you have Plex Pass users with PINs be sure to append your plex_token to the end of the url in the step above. (e.g. http://localhost:32400/status/sessions?X-Plex-Token='myPlexToken'). To find your plex token follow this guide.
-
Configure the rest of the file to your likings.
You can now run Plex2SmartThings and the SmartApp should be notified whenever any media plays on plex.
If anything isn’t working you can try enabling some extra debug output by adding the d1 or d2 arguments. E.g. running Plex2SmartThings.exe d1 from the command line.