[OBSOLETE] PlexPlus - Control Lighting with Plex Play Status

In my setup I actually only have it set to dim on play, I don’t have it returning brightness after, which would explain why I haven’t had a similar issue, but should be fairly easy to put in a cancelable delay, still at work at the moment, but will see if I can update when I get home

1 Like

Child App updated!

v2.9 - 04/07/16 - Added cancellable delay on stop action, duration defaults to 5 seconds but fully customisable!

Also changed default debug mode to “1 - standard” in config.config

1 Like

Amazing! No more disco’s in the bedroom! :slight_smile:

No that’s a different smart app :wink:

in the last few days the application on my plex server just sits on “looking for plex”

Could this be caused by me enforcing secure connections? i put it back to allow any and it still just sits there looking for it. so not sure what I may have done

loving that it only works with certain modes now!! ( as I said in July hehe)

I’ve just tried to re-create your issue, but can’t? Enabling secure connections didn’t seem to make a difference…

open your config.config file and find the plexStatusUrl copy and paste that in to your browser… what do you get?

The URL should look something like this, if you are not using the latest exe, I would download the latest and use that and the config.config file

http://localhost:32400/status/sessions?X-Plex-Token=abcxyzabcxyz

If nothing is playing you should just see:

Also would be good to know your setup, are the server and the polling program on the same computer?

Let me know how you get on? If you can get a response tonight I’ll be able to have look, but otherwise I’m out the rest of the weekend…

1 Like

You are one of the most supportive and helpful developers mate. I’ll look into your suggestions and get back. But it won’t be Til after tonight all good. Enjoy your weekend away!

1 Like

Updating to v3 fixed it :slight_smile:

Nice! Glad it worked!

Banging my head against the wall here, can anyone lend a hand please?

Yes :slight_smile:

Can you go in to the config.config file and change the debug level to ‘2’

Hit play on a plex session then you will need to quickly tap the top left icon and press “mark” if you can then copy the line that looks like the below and private message me, don’t post in this post as your token will be there, you can change a couple of values in your token if it makes you happier, but keep the number of characters the same… if you can’t do the above a screen shot will have to do…

I know what the issue is, but I need to work out how much too long it is… I think the issue is your player name… I might need to re-write the EXE and the smart app to make this customisable, it’s 23:00 here so wont do it tonight, but if you can get this before tomorrow evening, I should be able to try to re-write tomorrow… I’m on holiday from Saturday for 2 weeks… so want to get it sorted before then :slight_smile:

What it should look like:
SendGetRequest: https://graph-eu01-euwest1.api.smartthings.com/api/smartapps/installations/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/statechanged/onplay?access_token=xxxxxxx-xxxx-xxxxx-xxxxx-xxxxxxxxx&player=Bedroom&user=somename&type=episode&ipadd=192.168.25.27

@MrBenjaminHDM

OK so I didn’t go to bed when I should have (It’s now 00:40), I’ve uploaded version 4 of the exe, this will trim the player name to 10 characters, I would still be interested to see your logging for a better fix, but give it a go and see if you still get errors, if you do I’ll need to update the exe and smart app, but the fix I have put in place is least disruptive, although may cause issues with similar player names…

Just to update here, V4 exe is not required, the issue was due to missing https:// in the config file :slight_smile:

It looks like the ignore list isn’t working for Plex2SmartThings.exe

<ignoreList>
<item type="type" value="episode" />

This still reports the event to the PlexPlus smart app, which triggers the lights. If the .exe can’t be fixed, could we have some functionality in the smart app itself to only trigger on certain media types (I know this information is passed along to PlexPlus because it shows up in last event)

I’d like the lights to trigger when I watch a movie but NOT when I’m watching TV.

It looks like more trouble with the .exe file. I tried to add a delay because it activates the pause function when seeking (so my lights flash when seeking through the movie)

  <delays>
    <!-- <item type="episode" event="stop" delay="10" /> -->
    <item type="movie" value="pause" delay="2" />
    <!-- <item type="movie" value="play" delay="7" /> -->
  </delays>

causes:

—Plex2SmartThings—
-Loading config…
Error in config: Object reference not set to an instance of an object.

This example was literally in the config, I just removed the block commenting it out.

Hi @davidav,

I’m currently on holiday in Italy, so won’t be able to do anything until I’m back in just over a week, however I can make changes to the smart app to handle identification of movies vs episodes and also the handling for “pause”, I’m assuming you do have different lighting for pause? A work around if you don’t is just to set to the same lighting as play…

With regards to the exe and the exception lists etc, no idea with that as I didn’t write them, I’ve only modified the existing exe (in fact first time I’ve even coded in C) but would be better in the smart app anyway as will allow per room customisation…

I’ll also remove mandatory population of pause config as well as some people won’t want anything to happen on pause…

Yes, my lighting for pause is slightly different by design. Right now, I have worked around it by setting the pause the same as play, but it would be cool.

I tried to look at the code for the exe but without an IDE, I couldn’t’ figure out what was going on. Since it does work to send the data, filtering on the smart app would be optimal anyway.

Thank you for all your work, and enjoy your vacation!

You can download visual studio express if you really want to play, but I would suggest just amending the code in smartthings, in which case it will be replicating stopcommand but with the pause section detail and then putting in a new RunIn, I’ll sort it when I get back though any way :slightly_smiling_face:

@davidav

I have updated both parent and child apps, including both the changes you wanted and also a bug fix due to ST changing something somewhere…

v2.11- 24/09/16 - Added support for delay on pause, triggering based on type of media and fix to debugging.

Git hub has been updated with both files… let me know how you get on!

Just got back from vacation. Can I just replace the code with whats in github, or do I have to wipe the app and reinstall it

EDIT: Looks like I was able to overwrite the existing code and re-enable the app. Looks amazing so far, I’ll test tomorrow. Thank you so much for your hard work!

1 Like