[OBSOLETE] PlexPlus - Control Lighting with Plex Play Status

Allright! :slight_smile: Sounds a bit complicated, but I like to try and figure things like this out!
Would I need to create a new Python script, or edit the PlexPlus?
Probably a bit to advanced for me… :slight_smile:

Sorry, you mentioned PlexPy above, and I thought you were using a Python script to poll Plex, (I have another app for pinging hosts that a user has also crated a Python script to do this and got confused between that and this one)

I believe you are actually using webhooks?

If so there are only 4 details for the player available over the API:
ā€œlocalā€ - remote or local play
"publicAddress" - public IP address
"title" - player title (in your case blank)
ā€œuuidā€ - unique player ID

If you update the below in the smart app then this will allow you to match on the uuid

def playerIP = plexJSON.Player.publicAddress

to

def playerIP = plexJSON.Player.uuid

If you enable debug logging in the PlexPlus app then it should receive a few events from Plex in live logging on a state change… you just need to find something like the below and copy the UUID and put in the app, it will likely look like a random jumble like the below, but could look like anything as it will depend on what LG decided to go with :slight_smile:

"Player": {
      "local": true,
      "publicAddress": "200.200.200.200",
      "title": "Plex Web (Safari)",
      "uuid": "r6yfkdnfggbh2bdnvkffwbms"
   },

sorry I’m on UK time and just finishing work… I’m going to be in the car for the next 3 hours driving home… will see how you got on when I get back!

Hey, I have written/re-written new apps… I need someone to test it and ideally I need someone with an LG TV and any other devices that cause issues… If you are up for it I’ll share the code with you… this update should solve the above issue, along with many others and setup should now be much easier… it even supports Chromecasts which are not supported in previous apps…

Offer is also open to anyone else who wants to put a very small amount of time in… just send me a PM!

1 Like

Thanks for making this, installed and ran great for a long time. I recently noticed that while it still works, the .exe running in windows no longer shows clients that have ran or are running. It used to do this and if for some reason there was a disconnect I would just exit and re run the .exe with no problem. If you could let me know what to do in this situation that’d be awesome.

Edit: wanted to let you know that yes I have checked and made sure that both the webhook and config file have the same token, app ID and the ide code. Does the plexstatusUrl have to be updated?

Hi Sorry for the delay in responding…

So I’m slightly confused? Are you using webhooks or the EXE or both? It sounds like you are using both? You only need to use one or the other webhooks being the simplest option…

For the issue with the EXE are you saying it shows status updates for a while then stops, but restarting the exe shows the updates again? or are you saying that they don’t show at all? If the latter then I think a change to the debugging level fixes this, but I can’t remember what I put in there… I think I may have altered this in a release a year or so ago when I added in some other changes…

1 Like

Hi. I’m trying to get this up and running. I’m wanting to use the webhooks method but I’m struggling to find the webhooks URL. I’m looking at the live log in The ST IDE but I can’t find anything that looks right. Can anyone post me an idiot guide to finding the webhooks URL - I’m fairly new to the ST so not entirely sure what I’m doing!

Thanks

Rob

@Rob2 Open up live logging on your computer, then open the app in your phone and go to connection methods and then press ā€œPlex Webhooks Settingsā€

It should show the webhook details on your phone and also in live logging…

The new Samsung app makes everything much more difficult to differentiate a button and text…

Hope that helps!

Thanks so much for your reply. I think I’m still missing something! I’ve attached what I can see in live logging - I can’t see anything that looks like what I’m after!

I can’t find any ā€˜connection methods’ in my app. I have both the new version and the ā€˜classic’ version of the Smartthings app. I presume I’m looking for settings within the Plex Manager, reached from the SmartApps list under ā€˜Automation’ rather than the Smrtthings settings? All I can see is options to ā€˜select clients’, ā€˜auth page’, ā€˜enable polling’ and ā€˜show all devices…’

Thanks

Rob

That’s Plex manager not Plex plus… you’re in the wrong thread :slight_smile:

I believe from memory that the webhook info for that app is obtained when you either open the app or close the app by pressing done… but any further support should be requested in the Plex manager topic

I’m an idiot! Thanks for your help anyway!

1 Like

Anyone get the hue plays to work yet with this?

If it’s seen as a bulb in SmartThings then there should be no reason for it not to work? Are you aware of an issue?

Posting in this thread Jake.
I have Plex Manager and Plex Plus running but the devices do not change state in the ST app.
You can manually select them and change the state, which triggers an event in plex2smartthings.
Also, would this create redundancy if both are triggering play play, pause pause?
If it’s too much hassle I will let it be, bc it works now, just didnt show status in st app as mentioned.
Thanks

I don’t think I understand the question being asked…

Plex2Smartthings / Plex Plus only reports status, it offers no form of control.

I guess you are using Plex Manager for control and Plex Plus for status, so the devices are created in Plex Manager and you then have selected those in Plex Plus?..

If that is the case then I assume the issue is how the update to Plex Manager device is being called, you would need to push an update to state only otherwise you would duplicate commands every time the state changes, which would lead to a play / pause issue I expect… is that correct?

Great app - I’m a bit late to the party and trying to get things working… here’s my setup:
Parent and DTH apps installed from repos and using webhooks for notifications from Plex.

Everything seems to be working and I can get lights to trigger on play, pause, stop using a ā€˜*’ in ā€œplayer name, user or IPā€ but would rather get this working using a virtual device for flexibility. However, the virtual device seems to be stuck on ā€˜Playing’ and not changing state.

Have I missed a step or misunderstood how this works?
Room log:

<bits removed> [PlexPlus [Lounge] >> No match found for room
<bits removed> 23:06:25: debug null is not in [<IP address>, Chrome, <username>]
<bits removed> 23:06:25: warn THIS IS THE MEDIA TYPE: movie COMMAND: onstop

Corresponding PlexPlus log (debug on):

<bits removed> 23:06:25: debug PlexPlus [PARENT] >> Account JSON: media.stop
<bits removed> 23:06:25: debug PlexPlus [PARENT] >> Account JSON: [id:1, thumb:https://plex.tv/users/xxxxxxxxxxxxxxxx/avatar?c=xxxxxxxxxx, title:<username>]
<bits removed> 23:06:25: debug PlexPlus [PARENT] >> Player JSON: [local:false, publicAddress:<ip address>, title:Chrome, uuid:xxxxxxxxxxxxxxxxxxxxxxxx]

Any pointers? I suspect the ā€˜null’ in the room log and don’t know what this value should be.

This is no longer relevant to current SmartThings technology

1 Like

Thanks! I’ll give it a go tonight. I tried Chrome, Android and Amazon Fire TV and expected the virtual device to reflect what the player was doing.

1 Like

In Plex Plus you still need to specify *, IP Address, Name or User Name to control the device, putting * in will make the device work… but regardless of the device you use,… if you put in one of the values then that will match on those…

Using Plex Communicator however will mean it will work only for specific devices based on the hardware ID, which is much more reliable and unique between different device types…

@Entityxenon - tried Plex Communicator and MediaScene and both work perfectly. The device list populated immediately in Communicator without any fettling.

There is a delay of a few seconds for play and pause events but stop works immediately. Looking at the logs it looks like the delay is from Plex calling the webhook.

I’ve only tried it on Amazon FireTV so far and the device is updated so I can include it in other routines but MediaScene seems to cover most of the use cases I had in mind.

Thanks! Let me know about official releases and I’ll connect to the repo for further updates - or let me know if you need any further testing.

No problem, I’ve been using it for months, the only reason I haven’t rolled it out is because I’ve been busy with life :slight_smile:

1 Like