[OBSOLETE] Plex Home Theatre Manager SmartApp

Also, if anyone finds a way to identify the Chromecast then shout up.
I can’t seem to find it in devices.xml and its not in my devices on Plex, however under the Currently Streaming page, it shows that “Chromecast” is playing

I think that this is identified by the device that sends the request to the chomecast rather than the chromecast itself unfortunately.

Although I think the below address does pull back the actual chromecast details, mine isn’t hooked up at the moment for me to test it and secondly I’m not sure I have the ability to work out how to amend the existing script to parse the below instead of the devices XML, however if someone wants to give it a go, this would change the setup so you could only add devices that are currently playing though…

http://localhost:32400/status/sessions

[quote=“Entityxenon, post:136, topic:37415”]
You can PM me if you want… n
[/quote]Sent a PM. Thanks much!

@Entityxenon Jake - Thank you very much!!! I fixed my error with your code and now see the TV on the client list. Now… to figure out what I can do with it.

No worries, I’ll be releasing an update to PlexPlus to support these device types hopefully in a few days, this should make it more useful :slight_smile:

1 Like

Hey @ghesp,

Are you able to amend the device type so that it can pull back the type of media it’s playing, such as TV, movie or clip, the last defines trailers in plex, which would be useful for an integration I’m pulling together with PlexPlus…

I’ll have a look when I’m home. If I remember, I think there’s an identifier. If it’s in the status/sessions xml, then it’s doable

Cheers it’s definitely there as PlexPlus is already using it via Plex2Smartthings, thanks for taking a look :slight_smile:

Hi, again. Checking in to make sure I understand where we are. I’ve re-read the whole thread and I’m very grateful for all the work that’s been put into this. Do I have it right, that: the correct code to use is the device handler linked in the OP and the SmartApp in the OP plus (for a Samsung TV) the lines added by @Entityxenon ?

I’ve had a look, and you’ll need to modify the SmartApp also.

SmartApp
Find the following line:
switch(currentPlayback.@type.text()) {

Add a new line before it and add:
pht.playbackType(currentPlayback.@type.text())

Device Handler
At the end of the Device Handler, add the following:

def playbackType(type) {
	state.playbackType = type;
}

You can then access the playback type using the state.playbackType variable within each device handler.

1 Like

@iBeech Could you add this in to the published code as well please?

Also I’ve updated PlexPlus to manage the device type as it stands, once the published version is updated I’ll add pause support…

@iBeech I’ve created a pull request covering 2 commits, one to add non “player” devices, and one to add @ghesp 's suggested change above…

Hi just to let you know that @iBeech has updated the Manager and Device types with all of the changes above, GitHub is now current, it is suggested to remove any existing devices and re-add after updating the device type.

I’ve also updated PlexPlus to handle the new device type, including trailer support:

Thanks for this add to everyone responsible.

I just added, found my Samsung TV and showed when Plex was playing, what was playing, and when stopped. That’s really all I need…forgot to check if the controls work, but I just really need the status of playing and stopped playing right now.

Thanks again…opens ups a pretty useful automation for me.

So for a Samsung TV the controls won’t work, this will only report status, might have a look later to see if I can get the controls to automatically hide in that instance…

Turns out devices can’t have dynamic layouts which means either having two custom device types… or the easier option add [status] to the end of the device title so you know it only returns status…

I’ve added a pull request for the latter, but if you have any existing devices you will need to remove them before installing the updated code, otherwise you will need to push a manual unsubscribe

Just to let you know that @iBeech has accepted the pull request on this, this morning, current code now reflects the identification of “status” reporting only devices.

If updating to this code and you have any existing devices, please remove those devices prior to upgrading - otherwise you will need to force the unsubscribe as mentioned below:

Hi first thanks for working on this! I installed the app and added a couple of Plex devices. After I added my devices I noticed that they are stuck in playing status. Is there anything I need to do to get everything syncing correctly? I have checked the logs and I don’t see any errors.

Hi Allen,

Could you send me your logs from live logging, you should have log entries from the smart app and the device…

Can you also check to see what is going on here?

http://localhost:32400/status/sessions

Edit: replace localhost with the IP of your plex server…

I’ll do a full uninstall later and see if I can replicate…

Yeah, i’m seeing this also, need to take a look at the issue :slight_smile: