[Release] Plex Communicator V3

Super super cool app! Thank you for all of the time you have put into this!

Looks like the response sometimes contains an Image jpg...would be SUPER cool if that could be displayed in the dashboard as well. Why Plex does not just return a link though????

1 Like

First time I’m seeing a jpeg returned, according to the spec this is only returned for on deck and new content.

WRT just providing the url they do in play events, just the resolution is usually very high so I never implemented it.

Thank you for responding so quickly! I did not see link for what was playing in the logs. I only saw the link for the users profile picture. I will have to give this another look!!!!

Thank you again!!!

Hi Jebbett,
Thank you for all this work !

I installed the app and connected it to my Plex server, all went good and it created the devices I selected.

my problem is that the device do not display the title played ( music or video)
When I play a video from my Plex server, I see the arrow in the apps device list, but the device does not show any info.
I uninstalled, re-installed, deleted the devices, re-created them, still no luck.

Did I miss something ?
Thanks !!
Capture1

How have you connected to Plex? Via web hooks?

So I installed Plex2Hub on the Plex server ( that part was not clear to me) and partially got it to work, Now the device shows:

Current States

  • playbackType : track
  • status : playing
  • trackDescription : none

whatever I play, music, photo, movie, the track description does not work, is that supposed to show the track title or name ?

is there anything I can add to the "white list" so it shows the title of the media being played ?

If I set the logging to 2, I see that "Title" is available, should that be available in the hubitat device ?

I tried adding to the whitelist what I would like to see in the hubitat device with no luck:

   <!--Any items on the whitelist will be processed even if they are on the ignore list. -->
      <whiteList onlyAllowWhitelisted="false">
      <!-- <item type="user" value="Test User B" /> -->
      <!-- <item type="player" value="Test Player B" /> -->
      <item type="type" value="movie" />
      <item type="type" value="track" />
      <item type="track" value="title" />
      <item type="track" value="grandparentTitle" />
    </whiteList>

Am I on the right track here or way off ?
thanks

Track description I think is only available with web hooks I don’t think I ever recompiled the exe to handle descriptions because it would mean reinstalling visual studio

Ah!
ok
so my whitelistings are useless than

thanks for your answers

FYI, I'm new to Hubitat and installed Plex Communicator V2 this evening. I found OAuth wouldn't authorize due to 2FA being enabled on my Plex account (this is a new addition to Plex in the last couple months IIRC).

Logs
app:792021-03-01 09:11:15.929 pm errorgroovyx.net.http.HttpResponseException: Unauthorized on line 310 (authPage2)

app:792021-03-01 09:11:15.219 pm warnHit Exception groovyx.net.http.HttpResponseException: Unauthorized on [uri:https://plex.tv/users/sign_in.json?user[login]=MYUSERNAME&user[password]=MYPASSWORD, requestContentType:application/json, headers:[X-Plex-Client-Identifier:PlexCommunicator, X-Plex-Product:Plex Communicator, X-Plex-Version:1.0]]

1 Like

Thanks for the head up, it'll need a significant re-write of the auth code, probably to use the newer PIN authentication method.

It's not high on my list of priorities to figure it all out, until they enforce mandatory 2FA.

I would guess that you can probably disable 2FA link this app and re-enable 2FA, that will probably then work?

@jebbett
First thanks so much for developing this app/driver I being postponing writing one myself for a while not knowing that you have this already working wonderful, is being stable for a few days now :smiley:,
Fortunately I found your app after just a few lines of my own so I abandoned my efforts. I have no clue how your did the app code but I will use it as starting point for a couple of ideas I have still on the pipe.

one thing that make me struggle to get it going in the beginning, there is no much instruction on how to set the url on the plex side for slow people like me.

will be nice if in the github instruction you add something like "copy the url then go to the plex server and click settings-> Webhooks-> click add Webhooks-> paste url -> save changes"

I also change your code a little bit to add support to 5 more attributes

  • attribute "Rating", "string" //Intruders watching inappropriate content have couple of them at home

  • attribute "Season", "string" //want to know how far is my wife is on the show to see if i could catch her

  • attribute "Episode", "string"

  • attribute "Show", "string"

  • attribute "Live", "bool" //want to how is taking my hdhomerun tuner :smiling_imp:

Did some changes on the eventHandler() and plexWebHookHandler () function in order to pass the information to the child.
(I only change a few lines the rest still your baby :innocent: )
if you want I could pass you the changes maybe I could save you some typing if you need some of those attributes in the future.

Again thanks so much for sharing your code

No problem!

If you send me a pastebin of the updated code or a pull on Git and I'll take a look at the updates when I have some time and upload!

1 Like

@jebbett
So I never did a pull on github and I just learn about pastebin I hope you could get to the files


I end up adding some 2 way communication I don't really know if is going to work well or not, so far I could play,pause,stop,nextTrack,previousTrack, volume control on my iphone and apple tv and I know it do not work on chrome browser.
I have no idea which devices will work and if is anything could be implemented for non working ones
Best
Jorge Martinez

Control is a mess TBH the plex implementation is all over the place, there are at least 3 different ways to control clients, with different devices supporting different methods, and some clients don't support any control, that's why I left control out entirely.. When I update I'll leave it in with a list of supported devices.

I'll take a look at your code when I next have some time I'm away this weekend, I might look to re-write my code to allow easy addition of any of the variables so that adding and removing is just a line in the app, and a couple in the driver..

I have PlexCommunicator 2 and MediaShare installed on Hubitat. I have configured MediaShare. I assume that I need to run the Plex2Hub.exe. It will run on the same box as Plex. Where do I get accessToken, appId, and ide values for the config.config file (copied from config.hubitat)?

In the app under connection methods, all the info should be presented in there

Ok. I made those changes but I still get the following after killing Plex2Hub and starting it again with new config.

davidwsimmonds@'Theatre ShieldTV' (10.0.0.89) Changed state to: PLAY, mediaType is movie
Failed to SendGetRequest: The remote server returned an error: (404) Not Found.
davidwsimmonds@'Theatre ShieldTV' (10.0.0.89) Changed state to: STOP, mediaType is movie
Failed to SendGetRequest: The remote server returned an error: (404) Not Found.

What do I need to change?

Sounds like incorrect URL, if your url ends in the app ID remove the app ID from it and see if that works, if not then pm me your config file

The error went away with just the appId taken away but the lights did not react. I have used Hubitat to test the lights. They go on, go off, and dim to a specified level no problem. Do I also run the Plex2Hub.exe file? I am doing that.

Does the device react to the change in state? And did you add that device to the room in the media scene app?

If the device is working but MS isn’t then you can use rule machine instead