Sign up here and you can log into the forum!

Plugin: SleepTimer + sleep on idle (update 3)

The WDTVExt plugin depot. Plugins/libraries/code only

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby Gambler71 » Sun Nov 06, 2011 5:29 pm

I also would like sleeptimer to always be on when idle without pressing any buttons.
Gambler71
n00b
 
Posts: 14
Joined: Thu Jul 21, 2011 5:09 pm

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby mad_ady » Sun Nov 06, 2011 11:09 pm

I have made a SleepTimer implementation that works on newer firmwares (non 1.02) as well. It supports only sleeping after x minutes (not sleep on idle) for now, but should work fine.

You will need to get the Sysinfo UMSP plugin via webinterface -> Addons -> Sysinfo and then navigate on your OSD to Video -> Media Servers -> UMSP -> Sysinfo -> -- SleepTimer --.

Thanks to blachanc for his testing and idea.
User avatar
mad_ady
Developer
 
Posts: 2997
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby simogere » Sun Nov 06, 2011 11:23 pm

mad_ady wrote:I have made a SleepTimer implementation that works on newer firmwares (non 1.02) as well. It supports only sleeping after x minutes (not sleep on idle) for now, but should work fine.

You will need to get the Sysinfo UMSP plugin via webinterface -> Addons -> Sysinfo and then navigate on your OSD to Video -> Media Servers -> UMSP -> Sysinfo -> -- SleepTimer --.

Thanks to blachanc for his testing and idea.


Sounds good! Thanks, man!
User avatar
simogere
Donor
 
Posts: 140
Joined: Tue May 11, 2010 9:50 pm

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby Derll » Thu Dec 22, 2011 4:48 am

Gambler71 wrote:I also would like sleeptimer to always be on when idle without pressing any buttons.


+1. That would be awesome.
Derll
n00b
 
Posts: 3
Joined: Thu Dec 22, 2011 4:47 am

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby mad_ady » Thu Dec 22, 2011 5:22 am

Derll wrote:
Gambler71 wrote:I also would like sleeptimer to always be on when idle without pressing any buttons.


+1. That would be awesome.


Then check out KAD's sleeptimer.app.bin http://forum.wdlxtv.com/viewtopic.php?f=40&t=5888&hilit=sleeptimer.app.bin
User avatar
mad_ady
Developer
 
Posts: 2997
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby Derll » Thu Dec 22, 2011 1:12 pm

mad_ady wrote:
Derll wrote:
Gambler71 wrote:I also would like sleeptimer to always be on when idle without pressing any buttons.


+1. That would be awesome.


Then check out KAD's sleeptimer.app.bin http://forum.wdlxtv.com/viewtopic.php?f=40&t=5888&hilit=sleeptimer.app.bin


Wow, thanks, later on i will test it.
Derll
n00b
 
Posts: 3
Joined: Thu Dec 22, 2011 4:47 am

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby workingman » Tue Jul 10, 2012 1:08 pm

Hi Dan,

Tried to pm this to you but it just seems to be stuck in my outbox...

Wanted to share a little mod I made to your sleep script. It used to work perfectly fine for me but now that I'm using my wdtv as a torrent box the cpu never went idle enough to shutdown.

Within your .js I made this change to look for the device to be in a STOPPED state instead of cpu idle:

Code: Select all
//                this.cmd = "echo \"if [ -f \\$0.pid ]; then p=\\$(cat \\$0.pid); rm \\$0.pid; kill -9 \\$p; fi; echo \\$\\$ > \\$0.pid; killall -9 sleep; sleeptime=60; idle=0; loop=0; while [ \\$loop -le 10 ]; do t=\\$(top -b -n 1 > /tmp/topdump.txt; cat /tmp/topdump.txt | grep idle | perl -wlne 'print \\$1 if /([0-9]+)\\.[0-9]% idle/'); if [ \\$t == 0 ]; then sleep \\$sleeptime; continue; fi; if [ \\$t -le 75 ]; then loop=0; idle=\\$t; else loop=\\`expr \\$loop + 1\\`; idle=\\`expr \\$idle + \\$t\\`; fi; echo \\$loop; echo \\$idle; sleep \\$sleeptime; done; rm \\$0.pid; \\$(/usr/bin/irsend POWER)\" > /tmp/sleeptimer.sh && sh /tmp/sleeptimer.sh &";
                this.cmd = "echo \"if [ -f \\$0.pid ]; then p=\\$(cat $0.pid); rm \\$0.pid; kill -9 \\$p; fi; echo \\$\\$ > \\$0.pid; killall -9 sleep; sleeptime=60; loop=0; while [ \\$loop == 0 ]; do t=\\$(/usr/bin/upnp-cmd GetTransportInfo | grep STOPPED | awk '{print \\$3}'); if [ -z \\$t ]; then loop=0; else loop=`expr \\$loop + 1`; fi; echo \\$loop; sleep \\$sleeptime; done; rm \\$0.pid;\\$(/usr/bin/irsend POWER)\" > /tmp/sleeptimer.sh && sh /tmp/sleeptimer.sh &";


Does the trick for me.

Thanks much for initial script though!
workingman
DLX'er
 
Posts: 55
Joined: Sun Apr 01, 2012 3:04 pm
Location: Montreal, Canada

Re: Plugin: SleepTimer + sleep on idle (update 3)   

Postby recliq » Wed Jul 11, 2012 9:36 am

Tried to pm this to you but it just seems to be stuck in my outbox...

Your PM stays in your outbox until the user read it.
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5021
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Previous

Return to WDTVExt plugins

Who is online

Users browsing this forum: No registered users and 2 guests