[OBSOLETE] PlexPlus - Control Lighting with Plex Play Status

@Entityxenon This is the result, just as the last trailer finishes and the theater pre-roll is about to start:

a42b8dad-51f7-4f8b-b7c4-665074b8b448 6:47:52 PM: trace setColor([hue:70, saturation:56, level:50])
5507c29c-78d9-4162-a69d-5d60e84e5f5a 6:47:52 PM: trace setColor([hue:70, saturation:56, level:50])
ea1e3a38-dd5e-4755-92dd-f2f5b92b8f9e 6:47:46 PM: error groovy.lang.MissingMethodException: No signature of method: script14876344251211756533467.checkAllDeviceThresholds() is applicable for argument types: () values: []
837187d6-f46d-4814-84e0-bfd0db6ae7fb 6:47:45 PM: warn THIS IS THE MEDIA TYPE: clip COMMAND: onstop

Not sure if that helpsā€¦
Second attempt, pretty much same result:
a42b8dad-51f7-4f8b-b7c4-665074b8b448 6:57:51 PM: trace setColor([hue:70, saturation:56, level:50])
5507c29c-78d9-4162-a69d-5d60e84e5f5a 6:57:51 PM: trace setColor([hue:70, saturation:56, level:50])
ea1e3a38-dd5e-4755-92dd-f2f5b92b8f9e 6:57:46 PM: error groovy.lang.MissingMethodException: No signature of method: script14876332701391756533467.checkAllDeviceThresholds() is applicable for argument types: () values: []
837187d6-f46d-4814-84e0-bfd0db6ae7fb 6:57:44 PM: warn THIS IS THE MEDIA TYPE: clip COMMAND: onstop
837187d6-f46d-4814-84e0-bfd0db6ae7fb 6:57:43 PM: warn THIS IS THE MEDIA TYPE: clip COMMAND:

I created a dozen theater pre-roll clips using www.ivipid.com
Here are my others: https://www.youtube.com/playlist?list=PLxsJn0e48ocdCswhwrWpN9za6fVYuynai

@Entityxenon SmartApp Suggestion: I use a Third-Party Program called PlexPy which is a web application for monitoring, analytics and notifications for my Plex Media Server. One of the settings I can configure in PlexPy that I think would be really beneficial in PlexPlus would be the ability to change Watched Percent so that you can Set the percentage for a media item to be considered as watched. Minimum 50, Maximum 95.

This would allow the lights to be set to turn on at 95% of the movie completion, which is usually the credits.
Just a thought, hope you see how it could be a really cool option.

So after this command there should be an onplay command, what I really need to see is both events and their time stampsā€¦ this will then tell me what timeline is being followed against which events

Cheers will definitely check that out!

1 Like

Unfortunately webhooks doesnā€™t provide timeline reporting, there are other APIs within Plex that do but they are a little hit and miss depending on deviceā€¦ ph4r has been updating the Plex HT Manager app to allow control and status reporting, but had been quite a headache to get where he currently is and it still wonā€™t work with 100% of devicesā€¦ a Plex limitation rather than codeā€¦

I need to spend some time properly looking at his code and doing some testing with him, as if this can be updated reliably then Iā€™ll consider adding in the code to do what you are askingā€¦

Just finished watching Arrival. I tested it and watched the Live Loggingā€¦ I watched Play, Scrobble, and Stop the first trailer, Play, Scrobble, and Stop the second trailer, but for the pre-roll it just showed scrobble (no play or stop) and then it began Playing the selected movie.

webhooks does send timeline reportingā€¦ sometimes. In the PlexManager support for WebHooks I do parse it when it is sent. The rub is that it always tells you where in the media it is when an event occurs, but not always how long the media is, and it also only sends data when something changes.

In PlexManager (which you can use to trigger PlexPlus) It does support getting Timeline Status from all connected Players (via ServerSubscribe - most robust, faster than webhooks/None, but slower than Subscribe), and when media is playing, it updates every second! The part that is perhaps not working across all devices is sending commands. Client commands work the best and most reliably; however, not all players support them properly. Some users have reported that the Server and ServerProxy commands work for them, but for me these typically stop at the server and are not forwarded on to the player (I think because my server and main player are on the same IP).

I installed PlexManager last night after @Entityxenon mentioned it. I used the Dropbox links and I too use my Server as the player in my theater and using the settings Command Target Client and Timeline Status None, it worked for me, but I guess youā€™re saying that ServerSubscribe would be the better option?

1 Like

Cheers for the clarification :slight_smile: but just for Johnā€™s clarityā€¦ currently PlexPlus isnā€™t able to respond to the timeline reporting, this is possibly something I will do in the futureā€¦

I do have some further questions on the API work you have been doingā€¦ but before I batter you with questions I want to firstly test the latest version of your code and take a look through itā€¦ but I havenā€™t had time to much of anything SmartThings related recently :frowning: although I am looking to book a week off work soon to make some time to spend on ST (and other things)

There is a possibility I may also split PlexPlus, in to two simpler apps, one to manage the devices and the other to do scene handling across all media player device types not just Plexā€¦ but having the time is part of the issueā€¦ That way it would also make swapping in the Plex Manager component much simplerā€¦

2 Likes

Iā€™ve just updated the code to 3.5 to treat scrobble as playā€¦ however looking at your timelines, the issue may just be that webhooks doesnā€™t send the update quick enough or in fact it didnā€™t send the event at all?!.. You can see that there are 14 seconds between stop and scrobble in your logā€¦ in that case your pause would need to be longerā€¦

Jake, Iā€™m still trying to learn this ST IDE site, how do I update to version 3.5, to test it out. Iā€™m seeing this when I go to Update from Repo, neither checkbox is plexplus.groovyā€¦ did I do something wrong?

You will typically have to remove the existing app from the ST IDE site. Then you will need to add a new app by using code. Youā€™ll have to copy and paste the new code from his Github site and paste it into the code field on the ST IDE page. Youā€™ll need to create a new Smartapp in the Smartthings app and re-add your settings.

You will also need to get a new webhook URL and update your Plex account with that info.

Thanks Tom, I did just that. @Entityxenon it continues to go bright during the pre-roll videos after the 3.5 update. I will play around with the stop timing to see how that effects it.

If I have some time Iā€™ll try to recreate your issue and submit a bug report to Plex, as I expect the root cause is a webhooks limitationā€¦ I donā€™t think we can do anything other than extend the delayā€¦

For git hub integration, you donā€™t need to remove the app and reinstall you can just click one of the buttons next to the app and view changes then click updateā€¦ but based on what was in your screenshot I think you are linked to the wrong forkā€¦

Thanks @Entityxenon Jake, I did realize that after @tomd16 's reply that I had master in the Settings button as opposed to the PlexPlus fork. Just wondering are you using Hue bulbs in your setup? I noticed one of the settings is Hue Bulbs Color, I selected Blue for mine but on my OSRAM Lightify itā€™s not really the blue as shown here:


Currently, I select the color I want and hope that the bulb just remembers itā€™s last setting to get the exact color I want since there isnā€™t a custom option to select a Hue of 59 and Saturation of 67 as shown in the Device Current State:

Awaiting todayā€™s delivery of 2 more Lightify bulbs and 2 new GE Smart Dimmers and this latest theater upgrade will be complete. Thanks so much for this!

1 Like

I had the same thing happen with me. Iā€™m using the Sylvania bulbs as well. What I did was open up Live Logging from the ST IDE and then I selected my desired color from the app. I looked for the output on the Live Logging for that color. I believe those bulbs rely on RGB, although Iā€™m not sure how you can set it. But what I did do is in the output of that color I saw a Hue & Saturation. I changed the values for a couple of them. They appear to be displaying the proper color now. Hereā€™s a sample of what I changed in the color values.

case ā€œBlueā€:
hueColor = 63.91129
saturation = 97.254906
break;
case ā€œGreenā€:
hueColor = 31.768707
saturation = 96.07843
break;

1 Like

Let me know if Tomā€™s suggestion resolves your problem, you can just add as many as you want hereā€¦ if you want me to add the non hue bulb variants in to the main list I can add themā€¦

Thanks @tomd16 !

1 Like

Your welcome @Entityxenon! I know for my purposes Iā€™m find with keeping a cheat sheet on the side with the updated colors that work for my bulbs. That way when you update the software I can just copy the colors back into the place.

@johnesc - The good news on this part is you can just change the values in the existing code and then click Save and Publish (For me). It will update your installed version on the fly without having to reload the app.

Thanks,
Tom

1 Like

Huge thanks for that info Tom! I made the just adjustments and I kept a copy of the codes in a separate file just in case I never need to copy and paste them in again! Much appreciated for everyoneā€™s help!

1 Like