VBScript to Standby TV server with options and using PSS++

Discussion in 'MediaPortal 1 Plugins' started by TiboTv, July 22, 2013.

  1. TiboTv

    TiboTv Portal Pro

    Joined:
    June 22, 2009
    Messages:
    244
    Likes Received:
    29
    Ratings:
    +38 / 2
    Home Country:
    Belgium Belgium
    Show System Specs
    Hi,

    I wrote this little vb script to solve 2 problems that can't be solved with PowerScheduler or PowerScheduler++ plugins :



    1) I want to standby my TV server when there's no more "TV activities" (live streaming, recordings,...) even if one or more clients are still one. This idea come from the fact that my tv server is on about 6 hours a day (when clients are running to watch tv series, movies, listen music ) to do nothing! Now with my VBScript, Tv server is only on when needed (about 2 hours a day). So when I'm not using tv service on clients, after a while the tv server goes into standby, I get a "tv connexion lost" message on clients but everything is still running (database are local and medias are on a NAS). When I need tv service again, I enter into TV pages and WOL PowerMgt plugin send a WOL message to wake up my TV server.
    2) With PowerScheduler and PowerScheduler++, we can start a batch file when entering in a standby mode but the plugin can't wait until the end of the batch file cause windows has already started the standby process and the batch file has approximately 2sec to do his job.

    So this VBscript is just a kind of workaround.

    How it works :

    The script is started when windows starts (simply by adding a shortcut) and run in background (no interface).
    The script need PowerScheduler ++ installed. The script periodically check the TV log file to find and interpret power scheduler ++ messages. When all messages of tv log file are read, the script check if a standby can be started or not and when this standby can be started. If conditions remain the same until a idle timeout (which must be smaller than the PSS++ or Windows idle timout), the script start a batch file to execute a custom action, wait the end of the batch file and start a second batch file to start the windows standby.

    This script works fine for now about one week and I thing it could be interesting for some of you. This is VB script so you can edit and change it to get what you want if needed.

    If you try this script and get issues, don't hesitate to give me feedback but I have not many times to improve this script. If you want to report an issues, please post tv log file and also script log file.

    I only tested on my home configuration : Multiseat setup with one dedicaced TV server and 3 MP clients. Tested on both MP1.3 and MP1.4. Pay attention that log files are different from these 2 MP versions and a flag must be changed in the script config file to indicated if you use MP1.3 or MP1.4

    TODO List : Improvement :
    - Get windows standby timeout value in vbscript : If someone could help, it's great because I don't fin anyway to do it.

    Who to install :

    - Copy the attached files on your TV server (eg : C:\StandbyTVServer)
    - Edit StandbyTVServer.config to change some settings
    - Edit Custom.bat and standby.bat files
    - Start the StandbyTVServer.vbs
    - Check the result into StandbyTVServer.log
     

    Attached Files:

    Last edited: July 22, 2013
    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,424
    Likes Received:
    2,504
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,168 / 13
    Home Country:
    France France
    Show System Specs
  4. doveman

    doveman Portal Pro

    Joined:
    February 12, 2008
    Messages:
    2,326
    Likes Received:
    166
    Ratings:
    +182 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    I guess what we really want is for Mediaportal to be modified so that it doesn't send keep-alive messages to the server unless it's using the TV functions but in the meantime, good job coming up with this workaround TiboTV.
     
  5. TiboTv

    TiboTv Portal Pro

    Joined:
    June 22, 2009
    Messages:
    244
    Likes Received:
    29
    Ratings:
    +38 / 2
    Home Country:
    Belgium Belgium
    Show System Specs
    Yes you're right. This is what we need and what I've asked to @michael_t without succes :-( my workaround is just a way to make it working at home. I hope that one day this option comes. The ideal one is on client side as it's the most flexible: you can chose which client keep or not alive the server when tv service is not needed.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!