Plex Webhooks

Find the latest code updated in the original post below..

@jpark you will need to update the driver for the Plex Communicator Device.. this should fix your problem!

FYI, I just set this up and it is working great. Another thing off of SmartThings!!

1 Like

Would you be willing to point out to me the part of the code that receives the json and parses it? I am trying to d a similar thing with Emby but do not need all of the lighting automation .

It’s in the Plex communicator app under plexWebHookHandler there are two points this is referenced in the code that you’ll need to make it work

I think from a quick check you need to parse playstate.command

1 Like

trying to get this to work. All of my playback devices show up in the app, but nothing shows up in the log when I start or stop playback. I'd love to be able to have the lights turn on and off based on play/pause state.

also, any chance you could make this work with kodi? that's where i'd really love to use it.

this guy seemed to be working on something similar for ST:
Kodi callback endpoint for light control


You'll need to give me some more info, are you using Plex webhooks, the exe or polling? What are you seeing in live logging?

To implement Kodi would be a whole new app, it's completely different in operation but would be possible.. I'm certain someone already did this in ST

I see now that a plex pass subscription is required to use the webhooks. Using the polling, it says "polling update" in live logging, but doesn't seem to reflect any changes.

Yeah, there are a couple of projects in the ST forums, but I have no idea how to port them over to hubitat (seems to be quite a bit more than just replacing physicalgraph).

It's possible polling isn't working, as I haven't tested it.. the exe is the preferable option if you don't have Plex pass as its a lower overhead for HE.. I'll take a look at polling when I get back home though and see what's going on..

With regards to porting, it's a little bit trial and error, but not too difficult with a little debugging

signed up for plexpass. works like a charm. i use plex2kodiconnect to sync my libraries anyway, and that seems to work fine with this app.

may have to look into running the exe, but i'd run it on my linux server and i'm not sure I want to install mono on my system.

thanks for this

Plex Pass is the preferred option anyway.. :slight_smile:

Tagging in @josh as he developed one of the Kodi apps on ST, any plans to release a HE port?

1 Like

Would love this for Kodi!

Agreed! any interest @josh?

@jrau272 are you referring to a port of the Kodi SmartApp and Device Handler I wrote for SmartThings? I haven't used Kodi for a few years now, so I don't really have an interest in spinning up Kodi instances just to port over the code.

That being said, the source code is all out there and I believe the modifications to port it would be relatively straightforward. I'm happy to transfer stewardship of the code to anyone who is both willing and capable. :smiley:

That is exactly what I’m talking about. That’s too bad you’ve moved away from Kodi. I’d love it if someone ported it.

Give it a go yourself, porting is mostly just dropping in the old code and seeing what's broken.. this thread contains most of the details of the things that need to be swapped:

Just jumping into this thread now that I have a weeks worth of Hubitat under my belt.

Do these webhooks and automation work on the 'player' level or do they / would they work on the server level as well? Meaning, I tend not to use plex as a front end, but I access my content over DLNA and pull from the plex media server.

I presume its tied to the front-end (because who would want their lights going on when someone else pauses a movie in another room), but I can't figure that out from the code (yet. Reading Code for Dummies is next on my hit list).

Do DLNA sessions show up in the now playing screen in Plex, if it does then it should work but I've not tried it..

Honestly I've never looked before. I was always just watching the movie and never thought to see what Plex was showing. I was just asking in case someone already knew.

Thanks for the quick reply.

1 Like

I've just tested it on my setup, sorry it doesn't show up..