Using Plex Webhooks, a custom Plex2Hub program or some dodgy polling from your chosen smart home platform this provides you a device that you can then control your lights etc in response to what's being played on Plex
This will not provide control of Plex, but will give you the current state, type of media and media title of each of your plex devices.
Instructions
Note: (Hubitat files are in the Hubitat folder)
Install the App and enable OAuth
Install the Driver (Hubitat) / Device Hander (SmartThings)
Run the app, you will need ot login and add the LAN IP of your plex server
Select your devices and these will appear where they should
Setup your "Connection Method", taking the information required from the Plex Communicator App
Enjoy
For lighting control
Use the automation in build to your hub or use MediaScene by me (You'll need to use search until I release it properly)
Errors / Debugging
Plex2Hub.exe - SendGetRequest: the remote server returned and error: (403) Forbidden
There is an issue with the URL in config.config re-check section 2.D
No error in the EXE and nothing appearing in your smart home logging (with logging turned on)
This is because your hub is not receiving an event, this is usually because the App ID or Token are incorrect, if you re-install the app these values will change and need to be setup again.
Live Logging - java.lang.NullPointerException: Cannot get property 'authorities' on null object @ line xx
You have not enabled OAuth in the parent app
I've been unofficially supporting this on the back of another thread (below) for nearly two years now, I needed to make some changes to the code, so I have finally decided to release it properly.
I say properly...there are a few rough edges still and I haven't really written a detailled how to.. but you are intelligent people and you'll work it out!
I've also linked below to the latest version of Media Scene (That I might get to releasing in another 2 years)
Update: As seems to be my luck with Hubitat so far is to just leave it alone and things work themselves out. It's working as expected right now.
OK, I'm aback to ask silly questions because I'm probably not "intelligent people" who will work it out! LOL.
I uninstalled everything (Media Scene, Child, Communicator, driver...) and reinstalled everything. I'm not getting anything in the logs. According to your Github that means my... "hub is not receiving an event, this is usually because the App ID or Token are incorrect, if you re-install the app these values will change and need to be setup again."
I have re-enable OAuth, I think, but I don't know how to set up my App ID or Tokens. Or what my App ID or Token are...
Thanks again for this, I can't wait to get it working!
You can just update the code for both, no re-install, you'll get better detection of devices, track title in the device, better debugging and if you want to use the exe then that actually works now..
marvelous. Thanks for the quick reply and, of course, your great work.
Never thought I "needed" the title of what was being played, but suddenly I've got some ideas on how I want to play with it. Need is a funny word.
One quick question -- can you explain how the devices are identified? I have 17 browser based devices showing up in the list, and they didn't clear when I did the "reset devices." Are those authorized devices reported by the Plex server it is connecting to? If so, I don't think I'll be able to clean up the list, since I have about a dozen people who connect to my server.
Correct, remove them from Plex then hit the button, if you need to know which is for a specific device then play the film and go back to the list in hubitat, should appear at the top with a play symbol next to it
Old thread but I just got around to setting up Plex Communicator. I seem to have it working, it created a device and in the Plex Communicator app it does show when the device is playing media.
However, when I look at the Plex device in the Devices section; it doesn't show current state or media information and when I click on the Pause button it doesn't do anything on the player.
Long-term I'd like Hubitat to know if we're watching a movie or a TV show and then run actions based on that.
Also, I looked for MediaScene, I found the main app driver but I couldn't find the child and the app won't run without it, any tips on how to proceed?
I'll need more info to help, check the device ID on the device and check to see what device ID you are getting in logging (you'll need to enable logging) also let me know what device the player is running on..
For the other app it's somewhere in the Plex webhooks thread, search for child in that thread and it should come up..
Sort of related question... Did plex fix the fact that their webhooks tend to be minutes behind the actual action? I found that to be the limiting factor for using an integration like this.
Webhooks are generated from the local server and are pretty much instant, I've never had an issue with webhooks since they launched them across multiple devices?
I thought I was using Webhooks, I went through the setup as instructed and it was able to make the connection to the Plex server.
I went back into the PlexCommunicator app on Habitat and when I click on the Webhooks menu for the connection type it shows me a white page with a URL and token but that's it. Is there something else I need to configure?