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
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
Attachments
Last edited: