VBScript to Standby TV server with options and using PSS++ (1 Viewer)

TiboTv

Portal Pro
June 22, 2009
244
39
Belgium Belgium
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
 

Attachments

Last edited:

doveman

Portal Pro
February 12, 2008
2,326
178
United Kingdom United Kingdom
Country flag
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.
 

TiboTv

Portal Pro
June 22, 2009
244
39
Belgium Belgium
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

OP Similar threads Forum Replies Date
M Problems with VFD Display after standby- Futaba DM140GINK Mini Display 0
horned_reaper Standby is prevented by MediaPortal client General Support 0
bta489 [solved] System goes to Standby during Amazon Prime Playback OnlineVideos 2
HTPCSourcer [fixed] [MP2-815] User not logged in when resuming from standby MediaPortal 2 17
J Resume from Standby Last Module TV Showing TV Server Settings Television (MyTV frontend and TV-Server) 2
H no standby at night Installation, configuration support 7
J Mediaportal Standby prevented by Mediaportal system/ active ports General Support 13
H TV nach Standby 1.21 5
H TV nach Standby 1.21 Pre Release 2
A Keine Aufnahmen nach Standby Allgemeines Supportforum 12
N MePo2 -HTPC only - Übersicht der notwendigen Standby Einstellungen Allgemeines Support- und Diskussionsforum 2
M [solved] Standby und Fernbedienungsprobleme Allgemeines Support- und Diskussionsforum 8
Cahliban Uhr bleibt im Standby stehen Allgemeines Supportforum 5
BlueMax1916 Problems with MP1 client process dying when resuming from standby, probably MovingPictures related Moving Pictures 2
BlueMax1916 Problems with MP1 client dying after resuming from standby General Support 2
M TV Server Preview Window is blank, sounds works Television (MyTV frontend and TV-Server) 3
catalpa ...immer mal wird der Server abgekoppelt :( Allgemeines Support- und Diskussionsforum 0
A Keine Verbindung mit Kodi auf Server Allgemeines Support- und Diskussionsforum 11
CyberSimian Unhandled exception in TV Server TV-Server 0
Grisu002 Failed to startup - TV Server funktioniert nicht Allgemeines Support- und Diskussionsforum 0
ajs [WiP] 5030: Add UHD Thumb size to TV Server MediaPortal 1 0
toricred [solved] Configuring TV Server to use NAS General 1
T Client / Server slow channel-to-channel change (zapping) General Support 1
T Server / client channel logo location Installation, configuration support 6
framug [solved] Some changes/fix in MP1 configuration client and server Submit: code patches (MediaPortal/TV-Server/etc.) 14
Similar threads

























Top Bottom