Req Inhibit Idle Shutdown Timer
#1
Hi All,

I am pretty new to this so hopefully i am posting this in the right place.

I have been searching the forum for some time now and cant find what i am looking for.

I would like to have a timer to to auto reset the "Inhibit Idle Shutdown" Feature and i have so far been unable to find an add-on to do this.

To explain a little further i have added my scenario below:

I have XBMC (Gotham) set up on a dedicated windows machine. In addition i have a standard Master control power board set up so that when the PC running XBMC shuts down (or suspends) the rest of my home theater system is also powered off.

I have done this because there a several (unnamed) people who tend to leave everything on. So i use the idle shutdown time to turn everything off.

Unfortunately this means that if someone wants to use a source other than XBMC, say conventional TV, they must first "Inhibit Idle Shutdown" to prevent XBMC shutting the whole system down. Unfortunately, for they same reason they cant just turn everything off, they invariably forget to re-enable "idle shutdown".

I want to create a system where by they can enable the "inhibit idle shutdown" function for a set period of time after which the system will automatically re-enable the idle shutdown feature.

I am just starting to read the documentation on how to writing an add-on, but this will be a steep learning curve (i have some experience in C++ for micro controllers but this is a whole other ball game). So i am hoping some has some good suggestions or options

Any help would be much appreciated.

Dylan

I am running Win7 x86 with XBMC Gotham
Reply
#2
Kind of like a dead man switch? :)

This might sound a bit weird and maybe not exactly what you're looking for, but this might work in your situation. Get a cheap USB webcam and there's various ways to use it as a motion sensor. Point it at a couch or something, and make it so it will keep the PC from sleeping/shutting down, rather than using XBMC's timer. It should be possible to set it up so it only does this if the PC is already awake, so motion won't turn on an already sleeping system. Basically, you're doing the same thing that people do for lights in a lot of commercial buildings, using just a normal motion sensor.

At least it's a thought.

As for your actual request, I'm not really sure myself. My add-on-fu is very weak.
Reply
#3
Thanks @ned Scott,

A dead man switch is exactly the idea.

Interesting idea with the web cam. I'd still like to investigate the timer option but I will also give the cam idea some thought. Not sure how well a cheap web cam is likely to work if people are sitting in the dark watching a movie but I am sure it could be made to work.

Cheers Dylan
Reply
#4
IR camera

Just remembered, our dog lies on the sofa at night so an IR camera wouldn't work here lol.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
So it turns out the goo people at XBMC have done far more towards making custom scripts easy than I expected. Thanks guys, great work.

After a few minutes getting my head around Python Syntax this is what i have come up with. I am sure you can all pick holes in but it seems to work. Still needs some tweaking, Currently no upper on the timer no settings configurable etc but it seems to do the basics.

Code:
import xbmcgui

    
MyDialog = xbmcgui.Dialog()
Disable = MyDialog.yesno('Idel Timer Sespend','Do you want to disable the Idle Shutdown Timer?')
if Disable:
    
    Hours = MyDialog.numeric(0,'Hours?')
    if Hours == '':
        Hours = '0'    
        
    Minutes = int(Hours) * 60
        
    if Minutes <= 0:
        MyDialog.notification('Idle Time Sudpend','Cannot set delay of zero hours',xbmcgui.NOTIFICATION_ERROR,5000)
    else:
        xbmc.executebuiltin('XBMC.AlarmClock(DelayTime,InhibitIdleShutdown(False),%d,silent)' % (Minutes))
        xbmc.executebuiltin('XBMC.InhibitIdleShutdown(True)', True)
        MyDialog.notification('Idle Time Sudpend','Time Set for %s hour(s), you can watch TV' % (Hours),xbmcgui.NOTIFICATION_INFO,5000)
Reply

Logout Mark Read Team Forum Stats Members Help
Inhibit Idle Shutdown Timer0