Global Event to force PC to Sleep?

Help each other out

Global Event to force PC to Sleep?

Postby snsumner on Fri Jan 11, 2008 4:56 am

Hello,

After surfing the web and doing a bunch of research I figured out how to wake my PC from a sleep (S3) using USB-UIRT from my Harmony remote. I can initate the sleep (S3) of my PC by click the "sleep" button my wireless bluetooth keyboard connect to my HTPC running Xlobby. But, I would also like to have the ability to do this from my Harmony remote.

Is there a way to have a global event within Xlobby assigned to a IR code that when I send that IR code to the USB-UIRT it will send a "sleep" signal to my PC from Xlobby? So that when I'm in any screen within Xlobby and I hit the power on/off button on my Harmony remote it will put my PC into sleep mode. Then all I have to do is hit the power on/off button again and it will come out of the sleep.

I realize that I could do this with Grider but I would like to avoid having to use yet another piece of software on my HTPC. Any help is greatly apprecated.

Regards,
Scott
snsumner
 
Posts: 19
Joined: Mon May 07, 2007 4:37 pm

Re: Global Event to force PC to Sleep?

Postby dalanik on Fri Jan 11, 2008 7:33 am

Just execute following command from XLobby:

rundll32 powrprof.dll,SetSuspendState

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Re: Global Event to force PC to Sleep?

Postby snsumner on Fri Jan 11, 2008 3:21 pm

I tested this from "Start->Run" menu of XP and it works like a champ. So my next questions is where within the Event folders do I put it so it will work in any menu within Xlobby? Or when you create a new event is there some special setting or flag to tell it that this event should work anywhere within Xlobby? I'm still learn all this stuff so bear with me.
snsumner
 
Posts: 19
Joined: Mon May 07, 2007 4:37 pm

Re: Global Event to force PC to Sleep?

Postby vicom on Fri Jan 11, 2008 3:54 pm

Create an event to shutdown using the rundll method mentioned above, then click on the TRIGGERS tab, select IR, then select the remote (alias) and button (command) that is linked to your Harmony button you want to use. I assume you've already created your Harmony alias in Xlobby using the IR Plugin.
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Re: Global Event to force PC to Sleep?

Postby snsumner on Fri Jan 11, 2008 7:56 pm

Thank you, I did everything mention above and now I can bring my HTPC in and out of "sleep" (S3) as long as XLobby is running in foreground. This is extremely useful considering I have a rackmount 4U HTPC running a 1000 Watt PSU and 6-500GB HD 24/7. Now I will go into sleep when I'm not using it. Can't wait to see if my electricity bill goes down 15-20 bucks amonth from this. ;-)
snsumner
 
Posts: 19
Joined: Mon May 07, 2007 4:37 pm

Re: Global Event to force PC to Sleep?

Postby homepc on Sun Jan 13, 2008 12:50 am

vicom wrote:Create an event to shutdown using the rundll method mentioned above, then click on the TRIGGERS tab, select IR, then select the remote (alias) and button (command) that is linked to your Harmony button you want to use. I assume you've already created your Harmony alias in Xlobby using the IR Plugin.


So what do I pick as the event to add? From the "OS", "Execute File", then "powrprof.dll,SetSuspendState"? And is there a simular command to bring it out of suspend?

thanks
Ray
homepc
 
Posts: 251
Joined: Tue Mar 20, 2007 1:27 pm
Location: Delaware

Re: Global Event to force PC to Sleep?

Postby dalanik on Sun Jan 13, 2008 10:40 pm

homepc wrote:So what do I pick as the event to add? From the "OS", "Execute File", then "powrprof.dll,SetSuspendState"?


Exactly.

homepc wrote:And is there a simular command to bring it out of suspend?


I'm afraid this is a little out of XLobby's possibilities... since, when in S3 or whatever, the PC is not working, the only way to wake it up is to have it enabled in BIOS to wake on LAN or USB or such....

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Re: Global Event to force PC to Sleep?

Postby PhilB on Mon Jan 14, 2008 1:01 am

You might be able to wake it up at predefined times using this tool:

http://www.lifsoft.com/

I am experimenting with this to sleep my server at night and wake it in the am.

PB
PhilB
 
Posts: 283
Joined: Sat Feb 18, 2006 6:38 pm

Re: Global Event to force PC to Sleep?

Postby Marbles_00 on Mon Jan 14, 2008 3:21 pm

You may try poweroff.exe. It is a neat little executable that does the following:
Logoff
Reboot
Shutdown
Poweroff
Standby
Hibernate
Lock
WOL
Turn off Monitor
Turn on Monitor

You can remote control other computers, run it as a service, use command line options, even do schedule things. I've used it to control my music server from a remote machine.

To bring a system out of sleep, I've used wolcmd.exe from Depicus. It is a neat little command line utility that I use in a .bat file to wake the music server then start a thin client on a remote machine. I also use it to wake the server from my mediaPVR just by pressing a button on a Hauppauge remote which in turns runs a .bat file in the background of Got All Media.

Hope this gives some additional ideas.
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: Global Event to force PC to Sleep?

Postby art on Mon Jan 14, 2008 4:23 pm

dalanik wrote:
homepc wrote:And is there a simular command to bring it out of suspend?


I'm afraid this is a little out of XLobby's possibilities... since, when in S3 or whatever, the PC is not working, the only way to wake it up is to have it enabled in BIOS to wake on LAN or USB or such....

D.


BIOS/WOL/USBUIRT is one possibility, but yes, you can also schedule "wake from suspend" from within the PC itself (OS is not completely dead in S3). I do it in one of my plug-ins, also (I don't have a link now), but I know there is a utility that does that as well. I found it when I was doing research for my plug-in...

EDIT: Ithink "Scheduled Tasks" can do that too.
art
 
Posts: 284
Joined: Sat Mar 20, 2004 8:40 am
Location: Allen, TX

Re: Global Event to force PC to Sleep?

Postby dalanik on Mon Jan 14, 2008 9:39 pm

art wrote:BIOS/WOL/USBUIRT is one possibility, but yes, you can also schedule "wake from suspend" from within the PC itself (OS is not completely dead in S3). I do it in one of my plug-ins, also (I don't have a link now), but I know there is a utility that does that as well. I found it when I was doing research for my plug-in...

EDIT: Ithink "Scheduled Tasks" can do that too.


Hmmmm, if the AT command would work, we might have something to use from within XLobby (via command line)....
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic