[OBSOLETE] Plex Home Theatre Manager SmartApp

Has anyone tried to get this working with the Samsung TV apps?

Ahh i managed to do it.

I had to update the ip and save that first to get the updated section to fire.

Iā€™m having an issue with it detecting playback.

this is my XML returned from the plex server

<MediaContainer size="1"> <Video addedAt="1452011018" art="/library/metadata/25153/art/1452015621" chapterSource="media" contentRating="TV-14" duration="2476518" grandparentArt="/library/metadata/25153/art/1452015621" grandparentKey="/library/metadata/25153" grandparentRatingKey="25153" grandparentTheme="/library/metadata/25153/theme/1452015621" grandparentThumb="/library/metadata/25153/thumb/1452015621" grandparentTitle="The 100" guid="com.plexapp.agents.thetvdb://268592/1/1?lang=en" index="1" key="/library/metadata/25160" librarySectionID="2" originallyAvailableAt="2014-03-19" parentIndex="1" parentKey="/library/metadata/25154" parentRatingKey="25154" parentThumb="/library/metadata/25154/thumb/1452015621" rating="7.4" ratingKey="25160" sessionKey="1193" summary="Ninety-seven years ago, nuclear Armageddon decimated planet Earth, destroying civilization. The only survivors were the 400 inhabitants of 12 international space stations that were in orbit at the time. Three generations have been born in space, the survivors now number 4,000, and resources are running out on their dying "Ark." Among the 100 young exiles are Clarke, the bright teenage daughter of the Arkā€™s chief medical officer; the daredevil Finn; the brother/sister duo of Bellamy and Octavia, whose illegal sibling status has always led them to flaunt the rules, the lighthearted Jasper and the resourceful Monty. Technologically blind to whatā€™s happening on the planet below them, the Arkā€™s leaders ā€” Clarkeā€™s widowed mother, Abby; Chancellor Jaha; and his shadowy second in command, Kane ā€” are faced with difficult decisions about life, death and the continued existence of the human race." thumb="/library/metadata/25160/thumb/1452015619" title="Pilot" type="episode" updatedAt="1452015619" viewOffset="160430" year="2014"> <Media aspectRatio="1.78" audioChannels="6" audioCodec="ac3" bitrate="7258" container="mkv" duration="2476518" height="720" id="59613" videoCodec="h264" videoFrameRate="24p" videoResolution="720" width="1280"> <Part container="mkv" duration="2476518" file="/home/tom/ToliMedia/Media/TvShows/The 100/Season 1/The 100 - S01E01 - Pilot.mkv" id="62242" indexes="sd" key="/library/parts/62242/file.mkv" size="2246870565"> <Stream bitDepth="8" bitrate="6474" cabac="1" chromaSubsampling="4:2:0" codec="h264" codecID="V_MPEG4/ISO/AVC" colorSpace="yuv" duration="2476518" frameRate="23.976" frameRateMode="cfr" hasScalingMatrix="0" height="720" id="135127" index="0" language="English" languageCode="eng" level="41" profile="high" refFrames="9" scanType="progressive" streamType="1" width="1280"/> <Stream audioChannelLayout="5.1(side)" bitDepth="16" bitrate="640" bitrateMode="cbr" channels="6" codec="ac3" codecID="A_AC3" dialogNorm="-31" duration="2476512" id="135128" index="1" language="English" languageCode="eng" samplingRate="48000" selected="1" streamType="2"/> <Stream codec="srt" codecID="S_TEXT/UTF8" format="srt" id="135129" index="2" language="English" languageCode="eng" streamType="3"/> <Stream codec="srt" codecID="S_TEXT/UTF8" format="srt" id="135130" index="3" language="English" languageCode="eng" streamType="3" title="SDH"/> </Part> </Media> <Writer id="28841" tag="Jason Rothenberg"/> <Director id="27891" tag="Bharat Nalluri"/> <User id="1" thumb="https://plex.tv/users/f37fe2c98489ddbd/avatar" title="toliver182"/> <Player machineIdentifier="13ded11a-18c6-429e-ac16-661ddf25f0fe" platform="Plex Home Theater" product="Plex Home Theater" state="playing" title="media"/> </Video> </MediaContainer>

It seems that Plex manager is looking for an IP address in the player section, however the xml returned doesnā€™t contain itā€¦

EDIT: just tested by hard coding
def currentPlayback = statusrsp.Video.find { d -> d.Player.@title.text() == "media" }

It detected perfectly.

Will look at forking your code so we can work on it if you like.

How did the Xbone stuff work?

Control over the app only works if the app supports control over HTTP. The Xbox app does not allow control over HTTP, so it would seem :frowning:

OK, iā€™m working on a fix for this. Instead of using the IP address, iā€™m going to change it to use the machine identifier.

sweet, one problem I have noticed with other integrations with plex, is that PHT on windows does not always report the media stopped state to the server, this is a bug with PHT and will not be fixed as they are discontinuing PHT for plex player.

worth knowing incase it there are any testing issues

Cool, thanks for letting me know.

I have hopefully fixed the issue you were having. I am now checking for the machineIdentifier tag, instead of IP address. Iā€™ve also fixed the bug where movies would show up as stopped and not report the title of the film.

Please update your SmartApp code, then open up the SmartApp settings on your phone and hit ā€˜doneā€™ so that it can update your device settings.

Let me know how it goes.

@iBeech, This looks great, but Iā€™m not getting there.

Plex is PMS running on a Synology NAS
ST Hub v2
Android tablet

I install the device manager and the smartapp, then enter the credentials in the smartapp on my Android. I think at this point, the device is supposed to be created, right? I donā€™t see it. Please advise.

My log: 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:43 PM: debug getChildDevices(false), children=0 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:43 PM: debug Parsing /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug Parsing /clients 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug getChildDevices(false), children=0 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug Parsing /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug Parsing /clients c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: debug c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: trace REPONSE TYPE: text/xml;charset=utf-8 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc] 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug getChildDevices(false), children=0 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug Parsing /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:42 PM: debug Parsing /clients c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: debug c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: trace REPONSE TYPE: text/xml;charset=utf-8 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:42 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc] 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug The GET path is: /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Executing 'updateClientStatus' 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Polling for PHT state 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug The GET path is: /clients 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Executing 'getClients' 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Token is: TvvzoZwxFBcz3zJSxrtY 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Getting authentication token for Plex Server 192.168.1.79:32400 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Updated with settings: [plexServerIP:192.168.1.79:32400, plexUserName:CAL.XXXX@XXXX.com, plexPassword:XXXXX!XX, theHub:physicalgraph.app.HubWrapper@674dd266] c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: debug c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: trace REPONSE TYPE: text/xml;charset=utf-8 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc] c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: debug c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: trace REPONSE TYPE: text/xml;charset=utf-8 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:41 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc] 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug getChildDevices(false), children=0 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Parsing /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:41 PM: debug Parsing /clients 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug The GET path is: /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug Executing 'updateClientStatus' 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug Polling for PHT state 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug The GET path is: /clients 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug Executing 'getClients' 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug Token is: TvvzoZwxFBcz3zJSxrtY 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:39 PM: debug Getting authentication token for Plex Server 192.168.1.79:32400 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:39 PM: debug Updated with settings: [plexServerIP:192.168.1.79:32400, plexUserName:CAL.XXXX@XXXX.com, plexPassword:XXXXX!XX, theHub:physicalgraph.app.HubWrapper@77947b14] 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug getChildDevices(false), children=0 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug Parsing /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:40 PM: debug Parsing /clients 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:39 PM: debug getChildDevices(false), children=0 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:39 PM: debug Parsing /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:39 PM: debug Parsing /clients c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: debug c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: trace REPONSE TYPE: text/xml;charset=utf-8 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc] c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: debug c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: trace REPONSE TYPE: text/xml;charset=utf-8 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:17:39 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc] 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug The GET path is: /status/sessions 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug Executing 'updateClientStatus' 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug Polling for PHT state 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug The GET path is: /clients 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug Executing 'getClients' 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug Token is: TvvzoZwxFBcz3zJSxrtY 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug Getting authentication token for Plex Server 192.168.1.79:32400 4906bf41-5adf-4f9c-a1ec-9d5a42a003f1 5:17:38 PM: debug Installed with settings: [plexServerIP:192.168.1.79:32400, plexUserName:CAL.XXXX@XXXX.com, plexPassword:XXXXX!XX, theHub:physicalgraph.app.HubWrapper@313bf47f] 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:17:17 PM: debug Google accepted event(s) 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:17:17 PM: debug 200 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:17:17 PM: debug https://script.google.com/macros/s/AKfycbzR8zFYZq_tsSqXe71j_vNivGztjvdwk8efNwQfM_pUMd5Tois/exec?ST+Motion+Sensor+temperature=67&Time=1-31-2016+17%3A12%3A16&Aeon+HEMv1+SWv3+energy=1622.671&Aeon+HEMv1+SWv3+power=5138 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:17:17 PM: debug Processing Queue 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:17:17 PM: debug [ST+Motion+Sensor+temperature:67, Time:1-31-2016+17%3A12%3A16, Aeon+HEMv1+SWv3+energy:1622.756, Aeon+HEMv1+SWv3+power:5138] 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:17:17 PM: debug Logging to queue Aeon+HEMv1+SWv3+energy = 1622.756 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:16:52 PM: debug [ST+Motion+Sensor+temperature:67, Time:1-31-2016+17%3A12%3A16, Aeon+HEMv1+SWv3+energy:1622.671, Aeon+HEMv1+SWv3+power:5138] 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:16:52 PM: debug Logging to queue ST+Motion+Sensor+temperature = 67 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:16:17 PM: debug [Time:1-31-2016+17%3A12%3A16, Aeon+HEMv1+SWv3+energy:1622.671, Aeon+HEMv1+SWv3+power:5138] 01c1330c-d48b-4767-bf9b-9ef36dcc4144 5:16:17 PM: debug Logging to queue Aeon+HEMv1+SWv3+energy = 1622.671 c442fa5a-361f-4df5-b7b1-68f7753b3886 5:15:41 PM: trace TV not found... c442fa5a-361f-4df5-b7b1-68f7753b3886 5:15:41 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null c442fa5a-361f-4df5-b7b1-68f7753b3886 5:15:41 PM: trace [devicetype:04, mac:3423BAEC10E6, ip:C0A8016D, port:22B8, ssdpPath:https, ssdpUSN:uuid:a2ff87d1-91bf-4443-acf2-0dfab6982e0c::upnp:rootdevice, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc]

Please re-open the smart app, and hit ā€˜doneā€™ - i think there is a bug where it does not trigger the initial search for clients. Could you please confirm?

That fixed the issue, however the controls do not work, do they need to be updated to use the machine identifier too?

After hitting DONE, here is the log:

(No ā€œThingā€ created. Do I understand correctly that your SmartApp is supposed to create a new Thing using the Device Handler I created from your code?)

01c1330c-d48b-4767-bf9b-9ef36dcc4144  5:40:17 PM: debug Google accepted event(s)
01c1330c-d48b-4767-bf9b-9ef36dcc4144  5:40:17 PM: debug 200
01c1330c-d48b-4767-bf9b-9ef36dcc4144  5:40:17 PM: debug https://script.google.com/macros/s/AKfycbzR8zFYZq_tsSqXe71j_vNivGztjvdwk8efNwQfM_pUMd5Tois/exec?Time=1-31-2016+17%3A35%3A17&Aeon+HEMv1+SWv3+energy=1624.692
01c1330c-d48b-4767-bf9b-9ef36dcc4144  5:40:17 PM: debug Processing Queue
01c1330c-d48b-4767-bf9b-9ef36dcc4144  5:40:17 PM: debug [Time:1-31-2016+17%3A35%3A17, Aeon+HEMv1+SWv3+energy:1624.779]
01c1330c-d48b-4767-bf9b-9ef36dcc4144  5:40:17 PM: debug Logging to queue Aeon+HEMv1+SWv3+energy = 1624.779
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:16 PM: debug getChildDevices(false), children=0
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:16 PM: debug Parsing /status/sessions
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:16 PM: debug Parsing /clients
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: debug
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: trace REPONSE TYPE: text/xml;charset=utf-8
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc]
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: debug
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: trace REPONSE TYPE: text/xml;charset=utf-8
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:16 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc]
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:16 PM: debug getChildDevices(false), children=0
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:16 PM: debug Parsing /status/sessions
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:16 PM: debug Parsing /clients
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug The GET path is: /status/sessions
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug Executing 'updateClientStatus'
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug Polling for PHT state
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug The GET path is: /clients
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug Executing 'getClients'
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug Token is: TvvzoZwxFBcz3zJSxrtY
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug Getting authentication token for Plex Server 192.168.1.79:32400
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:15 PM: debug Updated with settings: [plexServerIP:192.168.1.79:32400, plexUserName:CAL.XXXX@XXXX.com, plexPassword:XXXXXX!XX, theHub:physicalgraph.app.HubWrapper@40a9b51d]
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:09 PM: debug getChildDevices(false), children=0
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:09 PM: debug Parsing /status/sessions
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:09 PM: debug Parsing /clients
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:09 PM: debug
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:09 PM: trace REPONSE TYPE: text/xml;charset=utf-8
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:09 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null
c442fa5a-361f-4df5-b7b1-68f7753b3886  5:40:09 PM: trace [mac:0011323940DD, headers:SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LVR5cGU6IHRleHQveG1sO2NoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtTGVuZ3RoOiA4Mw0KQ29ubmVjdGlvbjogS2VlcC1BbGl2ZQ0KS2VlcC1BbGl2ZTogdGltZW91dD0yMA0KWC1QbGV4LVByb3RvY29sOiAxLjANCkNhY2hlLUNvbnRyb2w6IG5vLWNhY2hl, body:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPE1lZGlhQ29udGFpbmVyIHNpemU9IjAiPgo8L01lZGlhQ29udGFpbmVyPgo=, hub:9d6ea9ad-d96b-4c1f-bc97-1faae4a7d0cc]
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:09 PM: debug The GET path is: /status/sessions
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:09 PM: debug Executing 'updateClientStatus'
4906bf41-5adf-4f9c-a1ec-9d5a42a003f1  5:40:09 PM: debug Polling for PHT state

i found that i had to close and re-open the app to get the thing to display

I havenā€™t checked that yet, as my wife is watching the tele :wink: just checking the code now.

Have just done some more testing and a couple of fixes- so update your SmartApp and those functions should now work :smiley:

@CAL7 are you using an actual Plex Home Theatre, or are you using the web-interface on the plex server? You are correct that the smartapp creates a device under the things section. But your client has to be a plex home theatre client which supports HTTP control. Also, please check your PM

Please see debug data via IM.

Technically, itā€™s not PHT, itā€™s PMS 0.9.15.2. And I am using the web-interface. I use several clients: Android, the NAS client on the same PMS host, an HTPC, but almost always just the Samsung TV Smart Hub Plex application (v2.004 by Orca).

My thinking was that your app keyed off the server status, so that the client configuration was not relevant; perhaps I have a fundamental misunderstanding that means it will never work for me.

@iBeech

it doesnt seem to work when using remote clients, PHT/ IOS

the client doesnt appear in
http://192.168.1.2:32400/clients?X-Plex-Token=XXX
unless its on the local network.

I host two plex servers, one in my house, one remoteā€¦ need to find away around itā€¦

could use this to get the list of devices. but i dont think it allows remote control.
https://plex.tv/devices.xml

Iā€™m going to see if it is possible to get it working with your clients. However I donā€™t have all of them personally, so it will be difficult.

Iā€™ll start with the Plex web UI and go from there.

I donā€™t think it wil be possible to control remote devices, as the commands contain the local IP. But I will try.

I figure worse case scenario is that I can discover your devices and have a device type that allows SmartThings to be aware of the state of your Plex clients. So that events can be triggered based on your clients status. And if HTTP control is enabled, you can also control them.

For anyone who wants control of devices which donā€™t appear to work at present, could you please send me a PM with the output of:

https://plex.tv/devices.xml?X-Plex-Token={TOKENHERE}

Replace {TOKENHERE} with the authenticationToken found by doing the following:

Open the SmartThings IDE and goto ā€˜My Locationsā€™. Select your location, then scroll to the bottom and click ā€˜List SmartAppsā€™. Scroll to ā€˜Otherā€™ and click ā€˜Plex Managerā€™. Take a note of ā€˜authenticationTokenā€™ in ā€˜Application Stateā€™

This will help me identify if your clients are compatible.

Hi @iBeech.

I ran into an issue with my app and it seems that yourā€™s is also affected.

The response from hubAction is being returned to all apps on the hub, not just plex managerā€¦