Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Event on monitor standby?

If you have a question or need help, this is the place to be.
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Event on monitor standby?

Post by Saxtus »

Is there a way to make EventGhost to create an event when Windows put the monitor to sleep
and when the opposite happens?

Thanks in advance!
eventspook
Posts: 23
Joined: Tue Mar 05, 2013 2:50 pm

Re: Event on monitor standby?

Post by eventspook »

I would like to kick off an event in this scenario as well (and when someone turns the monitor on/off). Hoping this is possible.
themaster1
Experienced User
Posts: 133
Joined: Wed Feb 03, 2010 9:02 pm

Re: Event on monitor standby?

Post by themaster1 »

2 events you can use:
System.Suspend for hibernation
System.Resume for back from hibernation

For sleep i don't know precisely probably System.Sleep ..to be confirmed?
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: Event on monitor standby?

Post by Saxtus »

Thank you for your response.
Those events you describe seem to be system-wide.

I am *NOT* talking about putting Windows in stand-by,
but instead I am trying to detect when Windows put the monitor(s) in energy-saving mode.

I don't see any event been generated at the log when that happens,
so I guess I need to get a plugin or something?
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Event on monitor standby?

Post by blaher »

viewtopic.php?f=2&t=5196#p25336 might be an option.

What are you looking to do when the monitor sleeps?
eventspook
Posts: 23
Joined: Tue Mar 05, 2013 2:50 pm

Re: Event on monitor standby?

Post by eventspook »

Personally, I want to activate the cameras in my office when the screen is turned off. I am doing this with the SessionLock method, but would like to control this with the power state of the monitors.
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: Event on monitor standby?

Post by Saxtus »

I want to start/stop a CPU intensive background program when my PC idles (and stop it when I am back).
Unfortunately I can't use the idle event, because it fires up even when I am watching a movie.

The thread you referred, requires controlling monitor sleep status from EG instead of Windows.
That stumbles on the same problem: It might put monitor to sleep, when it shouldn't (watching movie).

I've also thought of checking if media player software is active (XBMC in my case).
Problem with that approach is that sometimes XBMC is running, but not showing anything
(so monitor again goes automatically to sleep and I want to fire up that background application again).

I've even tried to use screensaver to do that thing, but Windows 7 shuts down the screensaver once it's time for the monitor power saving state to kick-in.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Event on monitor standby?

Post by jonib »

Saxtus wrote:I've also thought of checking if media player software is active (XBMC in my case).
Problem with that approach is that sometimes XBMC is running, but not showing anything
(so monitor again goes automatically to sleep and I want to fire up that background application again).
I can't help with the other stuff. But you can get an event from XBMC when its builtin screensaver activates using the test version of my XBMC2 plugin, instructions how to activate events here. You can also get information if somethings playing.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Event on monitor standby?

Post by blaher »

Saxtus wrote: I've also thought of checking if media player software is active (XBMC in my case).
Problem with that approach is that sometimes XBMC is running, but not showing anything
As Jonib says, his plugin is great for that.
I've even tried to use screensaver to do that thing, but Windows 7 shuts down the screensaver once it's time for the monitor power saving state to kick-in.
Here's how I get around that problem below. I don't want my monitor going to sleep when winamp is playing because I use HDMI audio and windows thinks of it as a second monitor. When the monitor is disabled the sound stops, so this fixes that.
Attachments
monitor sleep.xml
(4.35 KiB) Downloaded 195 times
Capture.PNG
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: Event on monitor standby?

Post by Saxtus »

Thank you all for your contributions towards a solution for my problem!

jonib's proposal is the most elegant around and usable in my case so far:

Image

Then I use an if-then python script to stop the execution of the idle macro:

Code: Select all

if eg.globals.playing > 0:
    print "Idle but playing -- Skippping"
    eg.StopMacro()
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Event on monitor standby?

Post by jonib »

Saxtus wrote:jonib's proposal is the most elegant around and usable in my case so far:
:D
Then I use an if-then python script to stop the execution of the idle macro:

Code: Select all

if eg.globals.playing > 0:
    print "Idle but playing -- Skippping"
    eg.StopMacro()
An alternative is to use XBMC2\Experimental\JSONRPC.Player.GetActivePlayers to get an playerid if something is playing in XBMC. Don't know if it better just one more option.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: Event on monitor standby?

Post by Saxtus »

GetActivePlayers gives a player as active even when paused?
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Event on monitor standby?

Post by jonib »

Saxtus wrote:GetActivePlayers gives a player as active even when paused?
Yes.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: Event on monitor standby?

Post by Saxtus »

Ah, I see.
Then doesn't suit my case.
Still thanks a lot!
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Event on monitor standby?

Post by jonib »

Saxtus wrote:Ah, I see.
Hmm, so you wanna play tough eh. :lol:
Then doesn't suit my case.
If there is an active player you can then test if it's paused with XBMC2\Experimental\JSONRPC.Player.GetProperties for "speed"=0 paused or "speed">=1 playing.

jonib

Edit: @Saxtus, Thanks for the Flattr. You doubled my Flattr count yay. :D
XBMC2 plugin to control XBMC. If you want to flatter me Image
Post Reply