[OBSOLETE] PlexPlus - Control Lighting with Plex Play Status

this is working great for me still thank you!

I apologize but Iā€™m a bit confused, specifically what to do with the ā€œToken and API Endpoint valuesā€ once I get them.

After re-reading I see mention of it in the EXE steps, however I never reached that point as I used the Alternate method (which indicated to skip to step 4, which in turn bypasses this).

Am I correct in thinking this value isnā€™t needed if one isnā€™t using the EXE setup???

Yes if not using the exe then you just need to add the device to the room no need to worry about tokens etc.

1 Like

Is there a way to uninstall this app? I appear to have created a few mis-configurations and now itā€™s not working at all. Hoping that completely removing it and re-installing it will work. When I open the Plex Plus smart app, it gives the option to create a new room, but it doesnā€™t list existing rooms, giving me no way to delete them.

Looking at my ā€œInstalled SmartAppsā€ list in the web interface, I have 3 instances of Plex Plus with no children, and 2 instances with a single child that I canā€™t access to remove. I think the 2 with child instances were set up to run a routine and nothing else, so I have no way to remove the app since routines are not aware of the app.

Any suggestions/help appreciated. Thanks.

EDIT:
Nevermind, figured out that I had to click the ā€œeditā€ link to uninstall apps from that page. Got everything cleaned up yet. The orphaning and the smart app not listing created rooms is still an issue though.

I think the issue is that you are creating a new smart app every timeā€¦ If you are on iPhone at least you need to hit the button on the top right to open installed apps, going via the route to setup the app initially will install another instance, which would explain why you had 3 instances in the first place!

Aaah, so thatā€™s how that works! Yep, that was exactly the issue. Other smart apps Iā€™ve used before somehow re-opened the same instance when I accessed them through the marketplace rather than creating a new one. Thatā€™s where my confusion came from. Thanks.

Any chance you could build the Plex2SmartThings.exe to work on Server 2012 R2? Iā€™d love to use this but currently canā€™t as the exe wonā€™t run

I can try, I didnā€™t write the exe and the code is there to compile yourself, I assume you are on 64bit? Do you get any error? Have you also tried to run in compatibility mode?

Also do you have the C+ runtime installed?

Ah OK. To be honest it was late when I tried and I just got the error it canā€™t be ran. Tried compatability mode but ran into the same issue.

Iā€™ll see if I can get a less generic issue and let you know

This is the error I get on Server 2012 R2.

Downloading VS now to try and compile it.

OK. I rebuilt the source code and itā€™s now up and running.

Iā€™m running into a problem with the SmartApp now. Whenever I create a new room I get ā€œSorry, but there was an unexpected errorā€

Unfortunately there is no more information that than anywhere. Checked all the logs and debugging and cant see anything of value other than the APP ID and API ID.
It does mention about child apps being null, but I assume thats because of the above error

Any ideas?

Hi @iamjezz not sure I understand the question, this app is not for controlling clients but for controlling lighting etc based on client state?

@ghesp would be good to get the exe and know what the difference was and Iā€™ll upload for others to useā€¦

In terms of your issue, can you let me know if you are on android or IOS and if android the exact device. And can you let me know the version of the parent and child app you are using? Also can you just try creating a room adding a name to the room then saving, no other details and let me know if that works?

Iā€™ll upload the exe shortly.

As for the issue, the problem occurs when adding a new room. I press Add Room, and it loads what I assume is the child app and then presents the error. The logs actually say something about the Child App being null.

Iā€™m on Android, using a Nexus 6P on whatever the latest version of Android is now (Base is 6.0 M)

EDIT:
Exe is https://www.dropbox.com/s/9jzkmm40e3nw00d/Plex2SmartThings.rar?dl=0. I just built it off the server for all platforms
For some reason I donā€™t get any notification inside it that itā€™s detecting items playing though. Iā€™ve looked at the source and it seems it should be doing so, although I think its because the SmartApp isnā€™t configured to receive them.

Hi sorry for the late reply, I have a lot of things going on right now at work and in my personal lifeā€¦

Thanks for the exe, when Iā€™m next on my personal laptop will upload the exeā€¦

With regards to the app crashing Iā€™m seeing no issue on iPhone or Android hereā€¦ can you confirm the versions of the smart apps (parent & child), also have you tried completely deleting from IDE and re-installing from sourceā€¦ please ensure you view raw in github and copy that, you may be copying something else otherwise.

WRT the exe not showing any life, have you launched debugging mode? it wont show anything if you havenā€™t? Also I assume you have configured config.config will all of the details in the guide, I expect this is fine otherwise you will get an errorā€¦

No problem.

Just tried it in debug mode, all works great :slight_smile: I was expecting normal mode just to output once something like

Iā€™ve just completely uninstall the app and deleted the code from the IDE and then recreated both apps using the parent and child on github.

Parent Version: 2.9
Child Version: 2.7 (Saved but not published)

Still getting the same problem, copied from the raw code in github.

Iā€™ve turned debugging on and all I get is:

    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:33:39 PM: debug Debug Logging has been TRUE
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:33:04 PM: debug Debug Logging has been TRUE
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:32:57 PM: debug ACCESS_TOKEN: <Removed>
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:32:57 PM: debug APP_ID: <Removed>
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:32:57 PM: debug there are 0 child smartapps
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:32:57 PM: debug Updated with settings: [debugLogging:true]
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:32:55 PM: debug Debug Logging has been TRUE
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:28:15 PM: debug Debug Logging has been TRUE
    7c2232e6-0de9-4d06-92ee-7a9de5d03d63  1:27:24 PM: debug Debug Logging has been TRUE

Here is the error:

Itā€™s definitely something in the Child app, i just cant figure out whatā€¦

So if I actually get some spare time at any point Iā€™ll take a look at re-compiling so you donā€™t have to use debug to see activityā€¦ this was just the way it was created by Christian, but causes more problems :slight_smile:

For the app issueā€¦ this is why I hate SmartThings! If you have another device you can try it on, or perhaps re-install the app on your phone and see if that fixes itā€¦

I will also PM you some code for the child appā€¦ to remove some of the dynamic page stuffā€¦

Dynamic page stuff removal worked., thanks :slight_smile:

Iā€™ve sent you a new config file format which might also make it easier for people to configure. Had some issues to start with, but pretty sure it was just smartthings throwing a wobbler!

So @ghesp has been helping me debugā€¦

Turns out is was due to routines so I have removed the functionality, if there is demand for it then I may bring it back, but donā€™t have the time at the moment to work around ST bugs!

He has also helped me update the config.config file to make it easier to configure and I have put basic debugging on as default and configurable in the config.config fileā€¦ Iā€™ve issued a new EXE as V3 and respective config.config fileā€¦ if your setup is currently working no need to upgrade, but if you decide to then you will need to use the updated version of both files.

@Entityxenon Used this for the first time last night, however a slight error on my behalf forgot to change the settings so it doesnā€™t work during night mode.

Iā€™ve got it setup in my bedroom, and on Plex I had Family Guy on random so it just kept playing. I kept getting woken up by the lights changing brightness but for some reason I decided itā€™d be best just to turn them off, rather than to turn the TV off.

I had a quick look at the SmartApp, but Iā€™m not great with the knowledge of SmartThings development. I was wondering though, is it possible to keep the lights dimmed if the time between a stop and play is say less than 1 minute?
When I was awake watching Family Guy, iā€™d get to the end of an episode, the lights would go straight to full brightness, but then dimmed straight away as the next episode started playing.