[RELEASE] PlexPlus - Control Lighting with Plex Play Status

“dim only if lights are on”

was the problem thanks again!! cant wait to get home and be immersed :slight_smile:

1 Like

@Entityxenon is there a way when skipping forward/back to not let the “trailer” light level be triggered?

Unfortunately Plex sees these as pause/play events…

This is why I added the customisable delays, so you can configure them to ignore commands for a set time…

If you don’t care about pauses I could potentially split the code so trailers and pause commands are seperate… but have a go with the delays and see how you get on?

i’ll try the delays and see how it works…

splitting the code may be handy.

@Entityxenon I ended up using Routines in triggers cause I used CORE to setup a specific Cyan color at 10% when paused/trailer playing and another for a Gold color at 50% for Stop for my Sylvania Osram Lightify RGBW bulbs. I didn’t have much success when attempting to use the Adjust the level and color of these bulbs. Routines is working well though!

The issue that bugs me a bit is that the 4 lights don’t all turn off at the same exact time. It’s completely random… sometimes 2 and 2, or 1, 1 and 2. Any suggestions on how to improve this…

Hi @johnesc,

When you say you didn’t have much success with attempting to use the “Adjust the level and color of these bulbs” what issues were you seeing? If it’s an issue I can fix it…

Also have you used the standard core colours, or did you use custom colours? I could port in the full colour list from core…

For your random bulb issue, unfortunately this is an ST issue, I have reported an issue previously specific to hue (below) but depending on what you are using there are limitations either with how smartthings sends messages and also how zigbee passes messages between bulbs… but largely SmartThings is the issue here…

It’s one line of standard code to trigger all of the bulbs in this instance, the issue is how ST processes it and has got worse at about the time I posted the below:

I just installed your SmarterHome app and noticed that you used the CORE colors there, that list is fantastic and it definitely worked better for my Routine situation. When I was using the Adjust the level and color of these bulbs, I would start with daylight white lights and then expect PlexPlus to change during trailers to Cyan @ 10% and if I stopped a movie Gold @ 50%. The colors and levels weren’t changing using the Adjust the level and color of these bulbs, however with Routines and the CORE pistons it works… My issue is that sometimes the bulbs turn off during movie play in a weird order 2, 2 or 1, 1, 2 as opposed to all at the same time!

Thanks for the info on the ST processing of the bulbs. Ugh!

Ok cheers for the feedback! I’ve got a few changes to make, so will include in the next change… but can’t provide an ETA on that at the moment as life is chaos at the moment, in and out of work!

I assume you are not using a hue bridge? If you are you can setup scenes in hue then trigger them from ST using a different hue connect app…this should then work as you are expecting…

1 Like

Love this!

quick question… I use Chromecasts to get plex content onto our TVs in different rooms. In the logs, the player title comes across as Chromecast regardless of the chromecast device I’m casting to. Obviously, this makes setting up PlexPlus rooms/automation tricky. Any way to differentiate so PlexPlus will know I’m using Chromecast1 vs Chromecast2??


11:06:32 AM: debug PlexPlus [PARENT] >> Account JSON: media.pause
11:06:32 AM: debug PlexPlus [PARENT] >> Account JSON: [id:5509126, title:Ben, thumb:https://plex.tv/users/XXXXX09eYYYYY/avatar?c=2015-11-12+09%3A41%3A09+UTC]
11:06:32 AM: debug PlexPlus [PARENT] >> Player JSON: [publicAddress:xxx.xxx.xxx.xxx, title:Chromecast, uuid:XXXXear110k9x2nxktskYYYY, local:true]
11:06:29 AM: debug PlexPlus [PARENT] >> Account JSON: media.play
11:06:29 AM: debug PlexPlus [PARENT] >> Account JSON: [id:5509126, title:Ben, thumb:https://plex.tv/users/xxxxxxx09yyyyy/avatar?c=2015-11-12+09%3A41%3A09+UTC]
11:06:29 AM: debug PlexPlus [PARENT] >> Player JSON: [publicAddress:xxx.xxx.xxx.xxx, title:Chromecast, uuid:XXXXear110k9x2nxktskYYYY, local:true] 


1 Like

Are you using the Plex Webhook? If not, I believe you could just enter the different IP addresses for each of the devices instead of their names. @Entityxenon will be of more help. Try using the IP address under When Event Comes From…

As @johnesc says, using IP is the easiest way… I think webhooks only gives the public IP… which I expect is the same across all the devices… if you are not using webhooks then this should be fine… there is another potential way which will be a complete rewrite of the app which I plan to do, but there are issues with Plex server I need to know if I can fix or if it’s a fundamental issue with Plex server…

I could bodge in something potentially so let me know how you get on…

I am using webhook. Sorry, should have mentioned that. So it only shows the
public IP.

I don’t want to put anything more on your plate, so I can just try and use
the device type. But let me know if there’s anything you want me to test
during your rewrite. Cheers.

No worries, if you find the below line in the code

def playerIP = plexJSON.Player.publicAddress

And replace it with

def playerIP = plexJSON.Player.uuid

This will then give you the unique player ID which you can grab from live logging and then paste in to the app instead of an IP address… that will give you a workaround until I rewrite

1 Like

Awesome. Thanks!

1 Like

Could we have an option for a slower dim on play rather than an instant one?

I’m not aware of any ability to allow setting of fade duration, apart from installing a custom hue handler and then setting the fade duration for all changes rather than specific ones?

If you are aware of a smart app that already does this then let me know and I’ll see how it’s been done…

I think this is it?

@Bizmo, So what that code does is… if you set the timer to 4 minutes it’ll dim 25% every minute, so it wont be a gradual fade as such but 4 steps in dimming…

I assumed that you wanted something more like a 10 second dim? Is that a correct assumption?, that being the case you could in theory do this by sending 5 commands 2 seconds apart, but this would be at the risk of spamming smartthings and hue with commands, and I’m not sure how either system will cope… and in fact if the whole execution took more than 20 seconds it would cause the action to error due to time out…

If my assumption is correct, then in theory it is possible, but it will be probably a noticeable stepped fade, and I’m not confident that SmartThings will like what’s going on… This would really be a try it an see, if it works but I have other things on my list currently that are more important…

ah right, I will have a play and see :slight_smile:

By the way I did have a brief look to see if you could set a fade duration on a hue scene.

Within Hue, well actually within the iConnectHue app, as the hue app doesn’t provide that level of control, but I think you can only set a fade duration when using a hue switch…

If you can get Hue to control the duration of the fade using scene then it’s easy, it may even be possible using on of the other non official Hue (Connect) smart apps, I’m almost certain in fact… but this would be a significant amount of work, and would only work for hue connected bulbs…

Honestly I wish I had more time to play with options and add all of the features everyone wants, as it’s not a bad idea! I may have a very quick look at Bruce’s code and see if I can drop in a bodge, if it’ll take me 10 minutes or so then that shouldn’t be an issue… would a 10 second fade be suitable?