[OBSOLETE] Plex Home Theatre Manager SmartApp

Having issues here, I got the app installed, it found my server, but whenever I try and select a device and hit ‘Done’, I get an error saying ‘Error Saving Page’. I used code from DropBox, not sure if I should be using that or the github code from the OP.

Still very new to SmartThings and have never gotten into much detail with Plex so bear with me if I ask dumb questions.

Edit: Seems that any change in the setup page from the defaults results in the same error.

Edit 2: And never mind, now it’s working.

Did you enable OAuth when setting up the app, I expect this is required in the drop box version but not in the original…

If you did then you may want to share the error from live logging…

Edit: sorry just seen your update :blush:

Working great here! Thanks the the hard work!!

@Entityxenon, it may just be that I missed something, but I can’t seem to find the link to the Dropbox version you’re referring to. FWIW, I have a PlexPass and would be able to test Plex Home Theatre Manager with WebHooks and various players.

@rwhapham Post 228 has the Dropbox version @ph4r has been working on, he is working on the control side of things mostly, but I think he’s added the webhooks code in there too, if not one of us will add it…

Weekhooks are client independant and just used for getting current state, I’ve already put it in to the Plex Plus SmartApp iand it’s working well f you are only wanting to get the status and maybe control lights, PHT manager is working on allowing control of Plex…

Thanks for the info. I am interested in controlling players–mainly my Nexus Player (Android TV), but possibly others. So I’ll wait until WebHooks has been added to PHT Manager. Love that both SmartApps exist, though. Have Plex and ST integration is pretty sweet.

No worries he has already integrated webhooks but I don’t see it in the Dropbox version, although I’m looking from my phone, so I may have missed it… but I suspect he just hasn’t updated to code on there, I’m sure he’ll also appreciate any help testing as I’m struggling for time to help him out… :slight_smile:

They are already present in the Dropbox version. Here are the links again for clarity. To enable WebHooks, set the Timeline Status to None, and set the Command Style to whatever you need for that device. When you setup the SmartApp and click Done, the SmartApp will start running. You need to enable OAUTH on this SmartApp, from the IDE, and then open the SmartApp settings from your iOS or Android app and press Done again. The link that you need to put into the Plex WebHooks setting will be put into the logs for you to copy/paste.

TRY AT YOUR OWN RISK!
Device Handler
SmartApp

I don’t have documentation for what I have done, but you can ask me on here if you have any questions or concerns. For the clients that it works on [PMP, Windows 10 App, others?], I prefer using the Timeline Status of Subscribe over the WebHooks personally.

1 Like

Thanks for clearing things up. I have your code installed and WebHooks enabled. I’ll do some testing with it this evening (hopefully). Can you clarify what “Command Style” is? I assume “client” attempts to connect to the client directly, “server” attempts to tell the Plex server to control the client, but I don’t know what “serverProxy” would be.

Command Styles:
Client - Uses Official API and connects directly to the Player [Client]
ServerProxy - Uses the Official API but instead sends the commands to the Server which Proxies them to the Player
Server - Uses an old and potentially unofficial method to send commands to the Server which might get to the Player

Timeline Status:
None - Do not try to reach out for updates, but accept them from Webhooks
Subscribe - Uses Official API and connects directly to the Player [Client] with a return channel for async updates [FAST]
Poll - Uses Official API and connects directly to the Player [Client] once every 30 seconds
ServerSubscribe - Uses the Official API but instead communicates to the Server (with a return channel for async updates) which Proxies data from the Player

There seems to be a fundamental issue with how this App authenticates to the Server which prevents some Players from authenticating that it is a trusted device which prevents the options from working universally. I am trying to get some support on the Plex Forums, but nobody is responding there.

Maybe one day I’ll break down and buy a USB-C Cable so I can pull the logs directly from the device and hope that it gives me answers. I’ve been avoiding this as there doesn’t seem to be a real standard on what you get for now.

2 Likes

FWIW, it wasn’t extensive testing by any means, but with the @ph4r version, I can confirm that my setup with WebHooks and a Nexus Player (Android TV) using client control work perfectly. I will eventually test other Plex devices I have, but that was the main one I was concerned about. Just starting into my ST setup, but being able to pause a movie (which we tend to watch LOUD) when the doorbell rings is a pretty cool use case for me. Eventually it may turn into lighting control, but I have to wait for the budget to have room to get that gear. Thanks again for this app.

2 Likes

Hmmm… I like that idea! What are you planning on using for the door bell side of things?

I’m using an Aeotec Doorbell (http://aeotec.com/z-wave-doorbell). Still getting it fully set up and loaded with custom sounds, but if nothing else it will serve as an inexpensive speaker I can use for various audible alerts (door open/close, water leak, freeze warning, etc.). The actual button that comes with it is pretty poor and intermittent. I may replace it with a real doorbell button wired to a dry contact closure (not my idea; read it somewhere in the community). And I have a couple of Nest Protect smoke detectors on the way. So I’m thinking pause my main Plex player when the doorbell rings; stop all Plex players if there is a smoke/CO2 event.

1 Like

I just updated the dropbox link for the SmartApp where I fixed the silly Timeline Subscribe bug that I had with some devices. I would appreciate it, if you would atleast give it a try on a device or two and let me know how it goes? I also made a couple other small changes to hopefully cut down on some log spamming.

Note: Updating the App MAY generate a new WebHooks Link that you need to update with Plex

1 Like

I’ve been tied up with other things for the past several days. It may be a few more before I can drop in your changes, but I do intend to get to them. Thanks.

1 Like

I’m using the same setup as the op, rasplex with http remote control.
However I can play stop next but I can’t pause and the playback status doesn’t update, does anyone know the issues and how to fix it? Regards

Apologies for any confusion, but there are a few different programs in this thread. I have never been able to get the OP to work with my Server properly, so I wrote a new version. You can find the dropbox links in this post for the DTH and SmartApp, or you can also pull them from my GitHub

There is some “documentation” sprinkled around the thread from there, but feel free to comment here or in a PM and I can help you out if you have any issues…

Thanks Ph4r, it works much better now, however I still have a delay between the moment I pause with my remote and the moment when it appear to be paused on the smartthings, do you know how can I short the delay?

Thanks a lot anyway !!!

Which Timeline Status Mode are you using? The default is Subscribe, but if you changed it - it could be slower. About how slow would you say that it is?

Timeline Status of None uses Webhooks for the timeline data.

In order of Speed (fast to slow) the options are:

  1. Subscribe
  2. ServerSubscribe
  3. None (when using Webhooks)
  4. Poll
  5. None (when it really does nothing)

So, as long as your client supports it, I recommend Subscribe!

Thanks for your message, I was with subscribe.
I got two rasplex at home, the one in the bedroom works perfectly, however the one in my living room can’t be paused with the smartthings, do you know what would be the issue?
Regarding the latency, it’s about 9-10 seconds.