[OBSOLETE] PlexPlus - Control Lighting with Plex Play Status

I’ve uploaded the zip to the GitHub project “Plex2SmartThings V2.zip” let me know how you get on, and if you have any problems still, then let me know…

Finally had a chance to test this. I figured out what was wrong. I ended up downloading the files incorrectly from github. I downloaded the config as an html file in txt format which is why I could not figure out the variables. It had a lot of html code which made it confusing. The exe also worked out for me.

Everything works except when I try to add a room the ST app crashes. I think it’s my phone causing the issue though because I have had issues installing other ST apps on my phone but works okay on a different device.

That’s good to hear, I thought that may have been the issue which is why I zipped them together, I don’t realise GitHub was quite so difficult to download from!

For your crashing issue, I assume you are using Android? There are a lot of reported issues with the Android app (going back years in fact) so I’m not confident I can fix the issue from my end, however if you can let me know at what exact point you are getting the issue I can check to see if there is anything in the code that may be doing something challenging… would be good if you could check if you are seeing anything in live logging relating to this app at the time…

Also try updating this line in the code in the child app, it shouldn’t make any difference, but the only thing I can see that is interacting with the ST DB:

state.catcherRunning = false
to this:
//state.catcherRunning = false

and see if this stops it crashing, if it does then let me know and I’ll update the code to implement this another way…

I got it to work. It was once again my mistake. I thought I had the child app but I had not added it. That is what caused it to crash.

So I got everything working except all the commands do not seem to send. I have 12 light bulbs that would be affected when Plex would play or pause but for the most part it only seemed to affect 6.

I also had a question. The option that says “switches off when playing” is that supposed to turn a switch off once plex is in playing mode? If so it doesn’t seem to be doing that. I have a hue color bulb. I included it in the " hue bulbs" section and the “switches off when playing” I have the settings set to turn the bulbs red when playing. With this particular bulb, it ends up turning red but doesn’t shut off. Any ideas? Should I provide logs?

Oh and also, is there anything you could do to apply all the actions at once? Right now it applies my play and stop actions one bulb at a time. Thank you so much for your app!

Hi @dom89,

I think part of your issue is that you are using it wrong… either you should be changing colour of your bulb or turning it off, but not both? If you set both then both actions trigger at the same time, and I expect it’s turning it off then turning it back on at exactly the same time as red…

Can you try changing that and see if that solves your other issue? I’ll need to see if I can replicate your other issue as my setup is slightly different normally so haven’t experienced the issue you are talking about, or even sure I can trigger it all at once, although it should go through each device very quickly as it is there may be some efficiencies I can make in the code… The other think to consider if using Hue’s is to setup a scene in the hue app and use the Hue Scene handler smart app to create a switch, that would mean only a single event to the hue hub then.

I might be using it wrong but let me explain a little further to see if I am using it wrong. To simplify things, lets say I have 3 lights. I want 2 of the 3 lights to be one while plex is playing. When plex is paused, I want all 3 lights to turn on and all 3 lights to turn on once plex stops. I would think that in order to achieve that, I would need to include all 3 bulbs in the “hue bulb” section. Then put the 2 bulbs that I want on during play in the “switches on when playing” and the 1 bulb to be off during playing in the “switches on when playing” Would that be the correct way to set it up?

Thanks for the Hue Scene SmartApp. I will look into that for a smoother transaction.

So those you want to turn on while playing just put in the hue lights section, don’t need to be in both, those you want to turn off you can just put under “switches” off when playing, the switches section is actually supposed to be for outlets rather than bulbs, so in a simple setup you wouldn’t need to use it…

Give that a go and let me know how you get on, I’d also like to fix the delay between bulbs issue if I can anyway I’ve already made some of the code a little more efficient, but some of it would need to stay to ensure that some of the other functionally can still be retained… Will need to test it out, the above might fix your issue anyway…

So I guess I cannot have that bulb turn on during a pause? That is why I am including it in the hue bulb section. I don’t want it on during play but want it on during pause and stop.

Just add the build to “switches off when playing” no other sections, should turn back on during pause and stop… If it’s not then it’s a bug and I’ll need to fix it…

I can’t check it’s working right now as at the pub :smile:

Ah ok. I didn’t know that is how it works. I will try it out. Thanks for the replies :slight_smile: drink up!

I tried that but the bulb did not turn off. It stayed on while in play. Take your time in looking into this. I am in no rush.

@dom89

New code uploaded to GitHub, give that a go… I’m still seeing a few issues where not all bulbs update, but this must be ST related…

I’ve made a few other changes as well to support a new device type, although not fully functional yet…

It seems to work now. The bulb I want off when playing turned off and then back on when I paused. I also had no issue getting all of my lights to response. It went through each bulb in succession. Not the most elegant but it works! I also got scenes to appear with ST and used that on momentary switches and that provided a smoother transition instead of it going bulb by bulb.

Good to know! I had a thought while queuing for a coffee, there is potentially another change I can make to make it quicker (but only if “Dim only if on” is not selected… this is the bit of code that means you need to do a loop, but if not selected I can just get the code to bypass the loop… I’ll push another update in the next day or two…

v2.7 - 05/05/16 - Further code efficiencies and also added support for trailers with Plex media device type

Child app now updated, this should provide the best possible experience for multiple lights that ST can deliver, although using direct scene triggering on your Hue hub should provide the best results overall.

Also now official support for the Plex HT Manager / Device Type, including trailer handling thanks to the great work by @iBeech thus meaning that your server does not need to be on a Windows computer for PlexPlus to work.

There seems to be an issue with the latest release. When saving the child app it throws an error because the namespace of the parent app is “ChristianH” but the child app is looking for a parent with the name of “jebbett:Plex Plus” (line 44).

I went in and manually changed the namespace on the parent to “jebbett” and it solved the problem, but you may want make this small update.

Cheers @gh0stbeef, my local version has got out of sync with GitHub (my mistake) updated both references and new code uploaded, cheers for flagging!

I have run into a bit of a hiccup that relates to Plex and not the app but I was wondering if maybe you are seeing the same thing. The issue I am having is that my Plex client,(App on FireTV and home theater client running on PC that runs the server) will not show that playing has stopped. So that means that when I stop watching a video, PlexPlus, beacuse of Plex, still thinks the video is playing so I never get to run my “stopped” actions. Eventually Plex does detect that playing has stopped and then PlexPlus does as programmed but that time varies. Any ideas how I can get Plex to update my status right away? Playing and Paused mode work right away. Stopped is the only one that doesn’t

So I have seen the same issue recently with the Plex HT client on the PC when testing another change, I assume you are using the Plex2Smarthings exe to generate the trigger, or were you using the device type? I had the issue when integrating the device type, but didn’t test the EXE.

Having a quick look on the Plex forum the same issue was highlighted back in November 2015, with no response…

I am using the EXE. Using the webclient works perfectly. Plex sees that it stoped and PlexPlus responds accordingly. I will have to try it with my fire tv stick to see if I get the same issue. I guess I will try to get some Plex support since it really is their issue.

Let me know how you get on… If you do add a post in the plex forum let me know the link and I’ll also respond, may get more traction with a couple of people complaining maybe (possible wishful thinking)