kmahon37 / plex-dvr-waker

Plex DVR Waker is a simple command-line tool for waking the computer before the next scheduled recording.
MIT License
8 stars 0 forks source link

Plex Server not Sleeping #35

Closed coreyspeed closed 2 years ago

coreyspeed commented 2 years ago

Hi,

Since the issue with Plex DataStamp changed, I switched my machine's sleep settings off, I've updated and set the sleep settings on again, only thing is my machine doesn't seem to go to sleep now.

Anyone else having this issue, or got any suggestions ?

coreyspeed commented 2 years ago

What would actually be useful to me, would be to adjust the plex waker script to allow a custom action to be added to the script.

Basically I'm fine with my plex server running and not sleeping, however, I have an external Synology storage box that I'd like to shutdown and wake using WOL.

I've had this working quite nicely, before using a scheduled task that was based on the Plex server PC waking (using your setup). That then sent the WOL packet. Now though my Plex server doesn't want to go to sleep.

kmahon37 commented 2 years ago

Nothing in PlexDvrWaker should be "preventing" the computer from sleeping, unless the "wake" task is constantly firing because of your DVR schedule (ie: if your trying to record every hour).

You can investigate why your machine isn't sleeping by running the Windows command powercfg /requests (you must run this from an administrator command prompt). This will list all the potential things preventing your machine from sleeping.

I'll have to think about your suggestion for running a custom action during the "wake" task. The Windows Task Scheduler supports running multiple actions per task. I could probably allow you to set a path to your own custom script (ie: .exe, .bat, etc) and then have the "wake" task just run that as part of waking the machine.

kmahon37 commented 2 years ago

I was able to fairly easily implement custom actions to run when the 'wakeup' task is triggered. These actions just get added to the Windows Task Scheduler 'wakeup' task and allows you to run any script file or program that Windows Task Scheduler can execute. Try it out in v2.2.0 (I also released v3.0.0 which upgrades to .NET 6.0 - if you want to jump straight to that).

New Features: