Sleep Timer Command Line

  • Hello

    Is there a possibility to set the sleep timer by a command?
    I would like to start the timer by a script on boot (cronjob @reboot). But it should be still possible to edit/interupt the timer in the power menu on kodi gui.

    Thanks.
    mrremo

  • Because I don't want to set every single evening the same sleep timer manualy.


    I don't know if you explicitly want sleep mode?
    But he e something similar that funnily enough was Irusak kind enough to help me with[emoji1]

    Look here showthread.php?tid=2286

    Sent from my HTC 10 using Tapatalk

    Edited once, last by DJ 1 (March 3, 2017 at 6:48 PM).

  • Thank's for this link.

    I solved the problem pretty easy:

    I create the file /storage/.kodi/userdata/autoexec.py which contains the following python code

    Code
    #!/usr/bin/env python
    
    
    import xbmc
    
    
    xbmc.executebuiltin("XBMC.AlarmClock(shutdowntimer,XBMC.Powerdown(), 90)")

    After the boot it starts the buildt-in function AlarmClock().

  • Thank's for this link.

    I solved the problem pretty easy:

    I create the file /storage/.kodi/userdata/autoexec.py which contains the following python code

    Code
    #!/usr/bin/env python
    
    
    import xbmc
    
    
    xbmc.executebuiltin("XBMC.AlarmClock(shutdowntimer,XBMC.Powerdown(), 90)")

    After the boot it starts the buildt-in function AlarmClock().


    Hmm.
    I'm not great with python or nothing but looks like it shuts off 90mins after booting each time it's on?

    Anyhow, as long as it works for what you need..

    Also,
    If you know of how.. itd be nice to use the time specified script (I linked) to do same thing on Ubuntu (16)
    I assume it could be done similarly?

    Or 'remotely shutdown of Ubuntu' i read ages ago there was a package looked for email & when it saw new mail it would run script...
    But the package was buggy, outdated etc

    Don't know If you know of any way?

    Cheers.

    Sent from my HTC 10 using Tapatalk