StandbyControl Plugin - revamped

Questions and comments specific to a particular plugin should go here.
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

StandbyControl Plugin - revamped

Post by phlox » Thu Feb 09, 2012 9:51 pm

New version 1.13 (from 2012-08-26) (change log see below)

A few years ago user Prinz published first versions of the StandbyControl plugin. I'm using this plugin as the heart of my own EventGhost configuration in order to control standby / resume behavior of my own media center PC.

So far, the plugin didn't make its way into the official EventGhost distribution, however, I'm convinced that it has its value and right to exist, since it provides handy actions and events in order to build a sophisticated standby control environment using EG.

In the last weeks I've reworked parts of the plugin, extended with new functionality, fixed some bugs and last but not least, written documentation about it. Without losing more words about, if you're interested in, just have a look to the inline documentation of the plugin.

Feel free to ask in case of questions, comments and feedbacks are welcome.
Attachments
StandbyControl_1.13.zip
the plugin
(30.41 KiB) Downloaded 440 times
StandbyControlPlugin.png
Last edited by phlox on Sun Aug 26, 2012 1:19 pm, edited 6 times in total.

kalia
Experienced User
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: StandbyControl Plugin - revamped

Post by kalia » Tue Feb 14, 2012 6:40 am

Thanks for sharing phlox. I was thinking about this (sending PC into Sleep mode) lately and will definitely try it out sometime in the near future. Thanks again.

phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: StandbyControl Plugin - revamped

Post by phlox » Fri Feb 17, 2012 1:56 pm

I've uploaded the new version StandbyControl v1.09 with the following changes:
  • Add: New events "KeepAlivePeriodStarted", "KeepAlivePeriodEnded", "AllKeepAlivePeriodsEnded" and "AllMonitoredProcessesTerminated" implemented.
  • Fix: Config dialog > processNameCtrl combo box was empty after adding StandbyControl Plugin to a new EG configuration.
  • Doc: Help page updated. Event list implemented and documented.

phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: StandbyControl Plugin - revamped

Post by phlox » Wed Mar 21, 2012 1:38 pm

Here's the latest stable relase 1.12 of StandbyControl plugin (download in the first post).

Changes since last published release 1.09b:
  • Refactored and improved 'monitored processes' functionality. For example, monitored process names are no longer case sensitive and the number of running instances is counted up and down properly.
  • Fixed deadlock situation in ForceReleaseThread (broken in 1.08)
  • EnableStandbyByApplication: Mode "Don't trigger" fixed (recovers previously set trigger time instead of using default pending time)
  • Documentation updated
As long as no one cries, this will probably be the last release for a while.

kalia
Experienced User
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: StandbyControl Plugin - revamped

Post by kalia » Sat Mar 24, 2012 5:24 am

Is it possible to make the configuration window (Settings Tab) scrollable if it does not fit in the screen.

phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: StandbyControl Plugin - revamped

Post by phlox » Sun Mar 25, 2012 9:11 am

not sure if it pays the effort
on what kind of device / monitor are you using it?

kalia
Experienced User
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: StandbyControl Plugin - revamped

Post by kalia » Mon Mar 26, 2012 4:58 am

Just a PC with low resolution (1024x768). I can always increase resolution. Don't bother if additional coding is required.

phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: StandbyControl Plugin - revamped

Post by phlox » Tue Mar 27, 2012 1:25 pm

some additional coding will be required, but at the moment I cannot say, if it's a mini change or not. I'll look at it next time when I'm coding something anyway - but that wont be today or tomorrow, the weather is too nice atm. :)

phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: StandbyControl Plugin - revamped

Post by phlox » Sun Aug 26, 2012 1:17 pm

Here's a minor update Standby Control plugin 1.13
(download in the 1st post)

Change log

Code: Select all

# 1.13 Impr: ShowOSDCountDown: Supports now i18n (internationalization) for the text to be displayed. 
#        Syntax: ${expression} will be replaced by the evaluated result of the Python 'expression'.
#      Impr: Stop threads on app exit
#      Fix: avoid exception during app exit
#      Fix: avoid PyDeadObject exception 

Moditril
Posts: 2
Joined: Mon Jun 10, 2013 9:40 am

Re: StandbyControl Plugin - revamped

Post by Moditril » Mon Jun 10, 2013 9:47 am

Hello everybody,
i hope some of you can help me.
Im using your really fantastic plugin to get my htpc to sleep when it should. I am using DVBViewer in combination with xbmc.
My question is, is there any chance to let the htpc go to sleep, only when the cpu load of a monitored exe like xbmc.exe is above a specified limit?
This would be great, because with this option i could suspend the htpc if xbmc is in idle mode (low cpu load) and stay awake if a video file is playing (higher cpu load)?
Or is there any other possibility to reach that goal?

Kind regards
Dominik
Last edited by Moditril on Mon Jun 10, 2013 12:12 pm, edited 2 times in total.

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: StandbyControl Plugin - revamped

Post by Luca Brasi » Wed Aug 12, 2015 5:31 pm

Hi,

phlox, thank you, youre plugin is great.
I have one problem which is bugging me for some time now.
From time to time it happens that standby control fires the trigger for the standby even though there are blocking counters active.
I have not the slightest idea why and when it happens. It just happens every few days.
Have a look at the screenshot. I had the plugin's config open and waited for trigger. I can even refresh the blocking counters list before and after the trigger and the ones active show up with the "1".
standbycontrollbug.PNG
Only thing that helps is to close eg and start it up again.

I'd be very greatful if you could have a look...

[Edit:] If more odd, I could just watch the standby being triggered even though the plugin was disabled... Maybe this could be helpful information for finding the bug.
Screenshot_2015-08-15-14-06-33.png
@moditril
I know it's been some time since you posted but it still might be of help to you:
I wouldn't bother with the cpu. You can get events like playing/pausing/stoping from kodi with the xbmc2 plugin. Let them trigger actions for the standby control accordingly. Like play triggers an blocking counter/inhibit "playing".
Or you can do it like I am doing it atm. I let kodi take care of all this and only use the screensaver activated event from kodi to trigger an eggtimer which will lead to standy after some time. If you resume kodi you'll get a screensaver deactivated event which you can use to interrupt the eggtimer.
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: StandbyControl Plugin - revamped

Post by Luca Brasi » Tue Jun 20, 2017 6:44 am

Hey guys,

is there any way we could get this to work with eg 5? It looks like this is the last plugin which prevents me from going to 5 on my htpc.
Or did some other plugin with the same functionality evolve in the meantime?

I installed 5 over 4 and on startup it looks fine. I even can see its actions being executed in the log but as soon as I try to access the plugin's settings I get:

Code: Select all

08:37:14   Traceback (most recent call last) (0.5.0-rc2):
08:37:14     File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
08:37:14       self.Configure(*args, **kwargs)
08:37:14     File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
08:37:14       treeItem.Configure(*args)
08:37:14     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
08:37:14       return self.executable.Configure(*args)
08:37:14     File "C:\Program Files (x86)\EventGhost\plugins\StandbyControl\__init__.py", line 974, in Configure
08:37:14       tableSizer.Add(applPanel.BuildPanel(), (rowCount,0), flag=wx.EXPAND)
08:37:14     File "C:\Program Files (x86)\EventGhost\plugins\StandbyControl\__init__.py", line 447, in BuildPanel
08:37:14       appTblSizer.AddGrowableCol(1)
08:37:14     File "wx\_core.pyc", line 15368, in AddGrowableCol
08:37:14   PyAssertionError: C++ assertion "!m_cols || idx < (size_t)m_cols" failed at ..\..\src\common\sizer.cpp(1980) in wxFlexGridSizer::AddGrowableCol(): invalid column index
Thanks! Any help is highly appreciated!
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: StandbyControl Plugin - revamped

Post by kgschlosser » Tue Jun 20, 2017 7:01 am

I have updated the plugin so now it can be installed and the dialogs should work properly.
Attachments
StandbyControl-1.14.egplugin
(37.76 KiB) Downloaded 78 times
If you like the work I have been doing then feel free to Image

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: StandbyControl Plugin - revamped

Post by Luca Brasi » Tue Jun 20, 2017 7:07 am

Dude. You are amazing! How fast can a solution be...
I'll check it out right now.
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: StandbyControl Plugin - revamped

Post by Luca Brasi » Tue Jun 20, 2017 7:16 am

Ok I checked. And I can access the plugin's config and it seems to work. Thanks!

There are still some errors on startup of eg though:

Code: Select all

09:08:37   Error reading help file C:\Program Files (x86)\EventGhost\plugins\StandbyControl\StandbyControl-Help.html, error=Invalid mode ('rtb')
09:08:37   Traceback (most recent call last) (0.5.0-rc2):
09:08:37     File "C:\Program Files (x86)\EventGhost\plugins\StandbyControl\__init__.py", line 80, in GetHelp
09:08:37       f = codecs.open(HELPFILE, mode="rt", encoding="latin_1", buffering=-1)
09:08:37     File "codecs.pyc", line 896, in open
09:08:37   ValueError: Invalid mode ('rtb')
09:08:37   ---> Willkommen beim EventGhost <---
09:08:38   XBMC2: Error opening: actions.dat
09:08:38   Error compiling script.
09:08:38   Traceback (most recent call last):
09:08:38   TypeError: compile() expected string without null bytes
09:08:38   Traceback (most recent call last) (0.5.0-rc2):
09:08:38     File "wx\_core.pyc", line 16766, in <lambda>
09:08:38     File "C:\Program Files (x86)\EventGhost\eg\Core.py", line 218, in Notify
09:08:38       listener(value)
09:08:38     File "C:\Program Files (x86)\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 801, in OnNodeSelected
09:08:38       path = node.GetPath()
09:08:38     File "C:\Program Files (x86)\EventGhost\eg\Classes\TreeItem.py", line 284, in GetPath
09:08:38       path.append(parent.childs.index(item))
09:08:38   ValueError: tuple.index(x): x not in tuple
I guess part of them are not related to StandbyControl but some are...
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

Post Reply