[OBSOLETE] Plex Home Theatre Manager SmartApp

Sorry just thinking about this @Krystm didn’t you find a better work around for 2 harmony hubs?

And Merry Christmas both!

1 Like

@iBeech - thanks for creating this, very polished and easy to set up. One question; I have a Gen 4 Apple TV and although status is reported accurately I can’t control it. I’m guessing this is because the Plex app for Apple TV doesn’t support HTTP Control? Is there anywhere this can be enabled as far as you know or is it a case of it just doesn’t support it?

Thanks again for a great tool!

Hi @Fenix24,

You may want to take a look at the version I have linked below, I think this specifically works with Apple TV…

Unfortunately the Plex API is shoddy and doesn’t seem to be consistently used across devices, both @ph4r and I have the intention of attempting to try to develop come code to handle the variation across devices, but I haven’t had the time to start looking at this and suspect @ph4r hasn’t either, it’s definitely on my list of things to look at as I want to be able to control Plex using Alexa, and the first step is to get the control working reliably, but having time to do this is the problem… I know @iBeech occasionally makes an appearance to approve some pull requests etc… but think he is pretty busy too…

1 Like

Hey guys, yes I am here, and I do see your posts, but as you said, I am very busy and have little time to put into the plex app. I will review and merge pull requests though :slight_smile: glad to see the community is alive here!

1 Like

I honestly can’t believe the responsiveness and resourcefulness of this community. Thanks for that Fork, I’ve installed it and it’s controlling Plex straight away.

It’s a real shame that the UK version of the SmartThings IDE doesn’t support pulling straight from GitHub so I’ve got to manually keep track of SmartApp versions - does anybody have a graceful solution for this yet or are we just waiting for the official integration to arrive?


@Fenix24 GitHub is working in the U.K. We just need to use a different site to setup. Check out this link:

SmartThings + GitHub Integration Issues

It works pretty slow though when you have integrated it all. The bet way to stop the page not showing when looking at smart apps or device handlers is to use your web browsers incognito Mode. For some reason everything loads perfectly then

1 Like

@Entityxenon - I did actually spend some time playing with it last week, since I am now trying to use PMP in another room and it does not work with the Server Posted commands, so I have been trying to use the client commands but it is failing on what appears to be an invalid message in the log. It reports that I am missing a key that I am explicitly sending, and I can even get to appear directly in the logs. I’ve been log stalking how various things handle the Remote Control function that the official iOS Plex App has which uses the subscribe and timeline functions to build a more robust connection. I plan to dig more into how to use this and process the callbacks (from one or more connections) into a DTH Directly. Until then, I have posted about my PMP concern on the Plex Forums with no response as of yet.

@ph4r Nice good to hear! :slight_smile:

Let me know if there is anything I can help with… I just don’t have the time to dedicate to it and work out what I need to do, but appears you are making some good progress, I have a Samsung Smart TV, Roku, ChromeCast, windows 10 App and Plex HT… so more than happy to test, debug or try and work out a solution where I can…

Take a look at the below link, it mentions this, so I think the latter may be required…

“Required Headers: X-Plex-Client-Identifier, X-Plex-Device-Name”

Although I think that you might actually be sending the wrong ID:

“All commands sent to a player MUST include a X-Plex-Client-Identifier header identifying the controller.”

I think currently you are identifying the player, rather than controller…

This is awesome and only took a second to configure. I was curious, is there any way that Smartthings could notify me what movie has started? This would allow me to know if my kids have started playing a movie, even when I told them not to (sometimes they sneak in the playroom). Also, it would let me know if they are watching an inappropriate movie. I have security controls in Plex, but they got my password one time and I didn’t’ know it. Considering you already show the movie title, I’m hoping a notification wouldn’t be too difficult. I may be missing something… if this is already possible please let me know. Again, thanks for the awesome work.

Depending on how technically competent you are, I think you could use CoRE…

sendEvent(name: “trackDescription”, value: text)

The trackDescription event should* be readable by CoRE I think, you would need to put this in to a variable to send in an SMS…

There is a CoRE thread specifically for things like this… they should be able to help… I don’t currently have this app running as I use the other method for reporting state…

The easiest way is to use PlexPy and a service such as Pushover. PlexPy is simply amazing. Gives full stats on what has been watched by who, how many times it’s been run etc and keeps all historic data. Not hard to setup - I have PlexPy running on my ReadyNas and Pushiver on my phone so I get instant notifications through.

The only thing is PlexPy doesn’t work on the Plex Cloud beta at the moment

1 Like

I just started using Core. I’m not at all familiar with this at the moment, but it sounds like it would solve my problem.

Are you saying that I need to send the trackDescription variable to Core or can Core already access the trackDescription variable and I just need to call it in my SMS message?

Also, if you could guide me to the page you were talking about, that would be helpful for me to learn. Thanks.

My suggestion would be to post in the CoRE help thread as they will be able to be more specific … but in principle you would setup a piston that says when state changes to playing, get the trackDescription (I expect called as trackDescriptionState.value) from the device and save to a custom variable and then Send an SMS to X including the custom variable in the content… one trigger and two actions…

I’ve not done it myself but I did do something in the past similar…

@Brian_Peterson honestly give PlexPy a go. If you have a PMS server running all the time you should be able to install it. Why reinvent the wheel when a much better alternative is out there. I love using ST but it’s a case of using the right tool for the job

Yeah, I have to admit that my current test code is not live in my public GitHub since I didn’t want to risk that someone grab it and it not work for them like I said here that it did. I did add code to create a Token for the Controller that I pass along. I have looked at the subscribe thing a little more today and noticed that I need to send a port number for it to post responses to, which I am trying to figure out blind for now if ST supports that. I will try soon to see if I just get an HTTP response immediately that I can parse or if I need to use “/player/timeline/poll?wait=0” in order to get instant feedback, but the polling every <=10 seconds and incrementing command numbers will be another challenge.

1 Like

Okay… I just installed PlexPy. I’m now messing around with the notification options. It looks like I’ll get there. Thanks for the help!

1 Like

@Entityxenon - There is a lot to clean up (settings, incrementing commandID, states, logging, etc) and the timeline parsing needs to come next, but I did get commands working and subscriptions are working. This is working now on both my Apple TV 4 and my PMP install. I get the same kind of returns from each, we just need to parse what returns. The navigation keys are weird, but are “working” so I need to log stalk the official remote again to see how they set focus elements. I don’t see me having time to do more on this for a week or more, and it isn’t clean for distribution. I’m really stumped about why the commandID doesn’t increment, but once it does we need to implement a rollover point.

Device Handler

Nice! I’m over the other side of the UK at the moment, so wont get back until late tonight, but will see if I can take a look tomorrow evening! Sounds like it’s getting close to being complete too, great work!

for commandID instead of using state, you may have more luck referencing atomicState, as state isn’t an immediate write, so can get out of sync, atomicState puts it in to memory and only commits on completion…

E.g. use the below to increment…

atomicState.commandID += 1

and you will need to update any reference to state to atomicState…

I’ll take a look tomorrow and try to work out what your code is doing in more detail :slight_smile: