SmartThings Community

[RELEASE] PlexPlus - Control Lighting with Plex Play Status

Haha no worries, glad you got it sorted, any other help you need let me know!

Hmmm, i’m getting absolutely no feedback from this. Trying to use the webhook method as i’m a Plex Premium member plus i’m on Mac so not as easy to run the .exe.

I’ve got the correct webhook URL from the log and added to Plex, but no matter what I can’t get anything - I’ve played and paused all kinds of content but there’s nothing in last event and nothing happens. I’ve tried using an * in the player and leaving it blank. I can’t see as there’s any other options I could add. I can’t see any errors in logs (although Plex now seems to take a long time to play!)

Anyone? I’m in the UK so i have the EU graph URL if that makes any difference.

Hi Dan,

UK will be fine as I’m also in the UK…

So first thing… please go in to the last event screen and press “Done”, you shouldn’t need to do this, but just to be sure!

Second thing, re-check your web hooks URL in Plex under account settings, make sure you haven’t missed the last bit (I have replaced my tokens with Xs but everything else should be exactly the same)

https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/pwh?access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Third make sure the server is setup to send
Settings > Server > [Show Advanced] > Network > Tick Web Hooks

If after following the above 3 you are still not seeing anything in either live logging (you’ll need to enable debugging in the smart app) then there is something stopping Plex from sending the event via webhooks… that being the case I would check to see if a firewall on the system is perhaps stopping it?

Let me know how you get on…

Hi Jake,

Thanks for the reply - bizarrely all those things were set up just fine. So I decided to just reboot the computer running the Plex server and low and behold it works fine after a reboot!

“Have you tried switching it off and on again” sigh!

Excellent stuff, now if only I could get my Hue bulbs added I’ll be laughing :slight_smile:

1 Like

Ahh no worries :slight_smile: What issue are you having with the Hue bulbs?

Trying to get [UPDATED DECEMBER 2017] Hue B Smart (Groups & Scenes) working - but it’s not seeing my bulbs.

I wanted to upgrade from Hue (Re)connect which was using the old scenes (and a lot of them were dead or doubled) to the newer Hue API and the must faster lights. I guess the official integration is on the new API now but of course it doesn’t do scenes.

Make sure you uninstall your old hue app and the devices associated to it… they wont show if they are already associated else where… (including the hub device)…

Good luck with faster lights, I assume this is via hue scenes, rather than individual bulbs? :slight_smile:

Ok, all working well here - however i’ve got a new problem.

I’m mainly using the Plex app from WebOS 3.5 on my LG TV. The problem is however, it doesn’t send a player name to PlexPlus, so it’s just blank.

I left it as a astrix but for some reason last night whilst watching the lights kept changing, I looked at last event and PlexPlus was getting notifications from iOS Plex Apps that weren’t even running.

I’m not sure how to get around this because theres no way I can see to name the LG app so it appears in PlexPlus. I can’t enter a way to match only blank names - and I can’t exclude other names or i’d exclude the name of every player that appears in the last event. Any ideas?

Have you tried setting the field to blank?

It depends on how it’s then being translated… can you confirm how the player name is appearing in the last event screen? Is it “” or is it “null”

If the above doesn’t work, if you take a look in the smart app and find this at about line 448:

parent.StoreLastEvent(command, userName, playerName, playerIP, mediaType)

add this line above it:

if(command==null){command = “Unknown”}

You should then just be able to use “Unknown” in the app (note the uppercase U)

Let me know how you get on… unfortunately I don’t think I have a device without a name to check!

Leaving it blank stops it responding to anything.

In the last event screen it literally says nothing. The player name field just says

Player Name:

IP Address is also empty, although that makes sense as i’m using webhooks.

I’ll try the “Unknown” hack now…

Unfortunately the “Unknown” line didn’t work.

If I look at the known devices in Plex, it hasn’t got a name there - however it does have one unique identifier - it’s app name is “Plex for LG” maybe we could target it that way?

Try this:

if(command==“”){command = “Unknown”}

If that doesn’t work then I’ll update to use UID but won’t be until next week as I’m at a wedding now…

Thanks for the help bud, no luck with that edit either unfortunately. Enjoy the wedding though!

Anyone using webhook method on a linux plex server having issues with plexplus working great for a while then no longer receiving events requiring the smartapp to be deleted and reinstalled from the ST app to get it working again?

Hi, Shouldn’t make any difference to the app where it comes from, it’s a standard post request, the format will be the same regardless of source or OS, unless Plex have really screwed something up…

I assume as you re-install the app, that you update Plex with a new WebHook address, this should change due to a new app ID etc.?

TBH It’s more likely that the server is not sending the requests in the first place, rather than the app having the issue, next time you have the issue try a re-boot of the server see if that resolves the issue?

For this issue, just to update in the main thread, we have developed a workaround to use the uuid, when I have some time then I’ll roll out a formal update, will take a little time as I need to update the exe as well, hopefully this week though!

When the webhooks stop working I first try to reboot the server, not solving issue. I then turn on debugging to see any errors, which display that “no events are received”. I double check the webhook setting in plex server, it appears to be set correctly. Lastly, deleted the smartapp from ST and then reinstall and then update the webhoook url on plex server, which causes it to start working again.

So the debugging will enable logging in live logging… the No Events Recieved I think is just shown in the app, there should be something here if it’s worked in the past as is a stored value, there was a bug for that, but I’m sure that was fixed, could have been in another app as I have a few using the same base code…

Live logging however should be where you are checking for issues as you should see the events come in even if they don’t do anything… I’d check there next time you have an issue and perhaps we can see if an error is being thrown? The only other thing I can think is that ST is updating the Token, but I’ve not seen that issue on my setup?

Well, further investigation leads me to believe that rebooting the plex server is what is causing the issue. I just completed some security updates and noticed that plex plus is no longer receiving any events from plex server.

I’m assuming this is not the expected behavior? What steps should I take to troubleshoot?

I’ve considered just trying to use the plexplus DTH instead of webhooks, but after installing I don’t see any updates to it’s status, I believe I have set it up incorrectly. I don’t see any settings for designating which device it is supposed to be tied to (player name, ip, etc). If I understand correctly the webhook method is supposed to be superior since it doesn’t rely on polling and should respond to event changes more quickly?

No the DTH is an output the exe or webhook is the input, it’s in case you want to use with other apps…

Can you open live logging in IDE then do some stuff in Plex and see if anything comes up in there?

Pretty much everything you are currently saying doesn’t make sense! I’d also try going in to the webhooks setting in Plex and re save with the existing value, all I can think is that the webhook isn’t reinitalising on reboot, but you updating it restarts the webhook service perhaps…