Feature Request: Wake up Server

All my movies reside on a NAS, which, to save energy, is not running 24/7 but is woken up on demand using a separate script.

It would be great – and extremely convenient for spouses and others – if such a wake up function were available from within the Plex Player. So instead of saying “Not available” in red color, it would offer “Wake up Server” in green color, when that movie is known to be available on the local network.
The correct MAC-address/es has/ve to be provided as a preference setting, of course.

Most hardware platforms for which there are Plex clients, don’t allow a regular user app to send a magic packet.
This would only work on personal computers and the like.
Not on embedded systems, like the various media player sticks and devices, or smart TVs etc.
And only on the local network.

Thanks – that was fast,

Yes, of course, I am thinking of my macs, and of my local network. I do not use outside servers.

So you think this is such a niche use case that it does not warrant the effort?

Jurgen.

It only covers a minority of users. As such, chances are pretty low that there will be developer time spent on it.

It occurrs to me that web hooks would a way to implement such a feature. The only thing needed is a proper event – like clicking the “not available” button, or something like that.

That should be easy to implement. I am happy to do the rest myself.

Check what your NAS server capabilities are ie can it go to sleep and wake up on a schedule like midnight and sunrise?

What does the wake up script to? Can it be called from the Plex client startup scripts if any?

Note a Raspberry PI is cheap. A lot of people use the PI for various tasks. Maybe it is possible to expose the PI as the “Plex server” which runs the script and then redirects to the real Plex server. Note you don’t want all traffic going through the PI so you would have to check if this is possible.

Warning - don’t make this too complex. Most of us can forget how we configured this 6 months ago. In my case if Synology (my NAS) is down I simply push the power button. When going away I simply push the power button for the two seconds to tell Synology I want a soft power down. Since this is an Apple house, my plan is to bring up an Apple mini that resides in the equipment rack with the Apple TV and decommission Synology.

Well, I also have a Synology NAS in a remote room just for storage (40TB for movies) and a recent Mac mini as my HTPC. I use the Apple TV remote together with Remote Buddy and Keyboard Maestro to control everything with few clicks, for instance waking up the NAS, starting the beamer and lowering the screen.

PMS is always running on the Mac mini. But when my wife wants to watch a movie on her iPad, she always forgets how to wake up the Synology. The same applies for my daughters, who sometimes access the PMS remotely.

That is my use case.

No. Web hooks are fired by the server – which is in hibernation state.
So it can’t fire anything, nor could it react to a web hook request – if that were implemented.

If I read correctly his server is running, but his NAS (where the files are) is not.

In that case it should indeed be possible to hook a wakeup script to your PMS.

Yes, this is the case. The PMS is running on the Mac mini, which is always on because it also serves other purposes, and is rather energy efficient. It’s the fat NAS with the media files which is hibernating.

So I think web hooks could go a long way.

All my Asustor NAS drives go to sleep while the NAS itself is still on. So it will just spinup the drive(s) where the media files are located.

I’m aware that Synology don’t easily allow that kind of operation. From my experience getting drives to sleep on a Syno is a very tough operation.

However in your case hibernating and waking the NAS controlled from your Mac Mini seems to be a viable solution.

So you need a script which is listening to an incoming webhook, and then fires a magic packet at a predefined MAC address?

Wouldn’t it make more sense to develop that kind of tool separately from Plex?
That way non-plex users could benefit and participate as well,
while the main development of Plex is not bogged down by yet-another-feature.
All Plex itself would need is a webhook event which fires upon access to a media file.

The wakeup script could run either on the same machine as plex server itself, or maybe on another device in the local network, like your router, home automation hub, or similar.

What I imagine would be more tricky is to translate media storage locations to actual MAC adresses, because media storage can easily be distributed across several file servers, not just one. How would you decide which one to wake up?

Yes. That would do the trick. I already have separate scripts for firing of magic packets using the usual WOL-tools. These scripts also know the relevant MAC-addresses. The only thing missing is an appropriate trigger coming from PMS.

Sounds a bit like Keyboard Maestro listening to all kinds of triggers.

These scripts could also inform the user that the NAS is starting up, and so on. So PMS has nothing to do with it.

I can’t imagine, how. Because once the webhook is fired, Plex has nothing to do with it anymore. And an external script has no way to inject its own messages into a Plex client. (which would be the appropriate place for such a message)
So it’d have to go around Plex and use a different channel of communication, which could become tricky, if we involve remote clients, or clients on restricted platforms (e.g. the above mentioned smart phones, smart TVs, or game consoles etc.)

I’m curious. Is this really saving much energy? Most NASs these days run very power efficient when the disks are idle and not in use. The amount of energy used to power down and then backup again may outweigh or have very little actual energy saving.

Not trying to be critical, just general curious if there is any real worthwhile saving here.

My Synology Diskstation dates from 2015, and is drawing more than 50W with eight discs installed. So I think it does save some energy to put it to sleep for 18 hours a day.

“very power efficient” can mean very different things depending on cost of energy generation/transmission, not even bringing up the wife acceptance factor. Remember, we are talking about 24/7 loads. My NAS is a 12 drive 2u unit so not exactly some synology.

My “perfect world” use case is such that I have a nuc plex server that sips power but always on. The NAS does have WOL capabilities, s3 sleep is set after 30 minutes of no activity. If there was a setting in Plex server where we could send a WOL packet upon play of any media, that would solve one big issue in my house. There is no harm in sending a WOL packet to a device already on.

Could be tight rules: same subnet, mac address of lan card known, only lan.

is this true that most hardware platforms with plex clients can’t do a WOL packet?

I can possibly imagine that if we count the number of individual plex clients, that it might be true, but I wonder if its true if one views it as the the actual number of plex users.

i.e. WOL seems to be supported on android - https://play.google.com/store/apps/details?id=co.uk.mrwebb.wakeonlan&hl=en and I’d think android makes up a significant portion of the plex client user base (but that’s just a guess).

If you told me WOL wasn’t supported on samsung TVs, Roku, WebOS… I’d believe you, but I wonder about how the plex client user baese breaks down in percentage. Ex: if 30% of plex users get it via an android device, while your statement is still true, it seems like it could be a feature that would benefit lots of people still.

Well, WOL should be supported on servers on a LAN – that is, with cables.

So again, the only thing I am asking for is a web hook that fires when somebody tries to play content which is not available. That’s all. That can’t be too hard to implement, and it’s not a feature which requires maintenance.

Any chances?

Jurgen