SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-05-2019, 08:12 AM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Question Switches?

Would it be possible to add CLI switches to Sage?

I'd like to be able to launch Sage directly to Live TV (not the interface/menu) pretuned to a particular channel.
Reply With Quote
  #2  
Old 10-06-2019, 11:44 PM
xjim1's Avatar
xjim1 xjim1 is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: colorado
Posts: 221
There no longer is any formal development, though you might want to post your question in either the github or V9 customization forums. Any support or enhancements would be done by another user in their spare time.

BTW, welcome to SageTV.
Reply With Quote
  #3  
Old 10-07-2019, 05:25 AM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
Quote:
Originally Posted by Mugsy View Post
Would it be possible to add CLI switches to Sage?

I'd like to be able to launch Sage directly to Live TV (not the interface/menu) pretuned to a particular channel.
The simplest approach may be to customize the stv (UI) to do this. Its not too hard to do so you may want to start reviewing the customization forum on tips and examples.

k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page
Reply With Quote
  #4  
Old 10-07-2019, 09:08 AM
JustFred JustFred is offline
Sage Expert
 
Join Date: May 2015
Location: Sunnyvale, Ca
Posts: 572
There's already some CLI capability. Have a look at the Sage TV User's Guide (pdf), Appendix D, "SageTV Command Line Parameters". It'll take a bit of work on your part to translate the channel # digits to Sage's "event #", but it seems doable.
__________________
System #1: Win7-64, I7-920, 8 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HDHR-US (1st gen white) tuners. HD-200.
System #2: Win7-64, I7-920, 8 GB mem, 4TB HD. Java 1.8.0_131. Sage v9.1.6.747. ClearQAM: 2x HDHR3-US tuners. HD-200.
System #3: Win7-64, I7-920, 12 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HVR2250; Spectrum Cable via HDPVR & USB-UIRT. 3x HD-200.
Reply With Quote
  #5  
Old 10-07-2019, 09:50 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jusjoken View Post
The simplest approach may be to customize the stv (UI) to do this. Its not too hard to do so you may want to start reviewing the customization forum on tips and examples.

k
Yes, this would be a simple plug in to write. I'm not really interested in making a "formal" plugin but would be willing to make a "one off" for you.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 10-07-2019, 10:15 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Another way to do this could be to send keystrokes from a programmable remote like a Harmony after waiting 30 seconds or so for the extender to turn on, assuming an extender. Or send keystrokes to a PC if using a PC.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #7  
Old 10-07-2019, 10:51 AM
doodeedoo doodeedoo is offline
Sage User
 
Join Date: Apr 2007
Location: Romeoville, IL
Posts: 21
EventGhost is another option that would allow sending of keystrokes based on the program start. The program already has a dedicated SageTV pluging that would allow you to send direct commands to Sage.
Reply With Quote
  #8  
Old 10-07-2019, 10:58 AM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Quote:
Originally Posted by JustFred View Post
There's already some CLI capability. Have a look at the Sage TV User's Guide (pdf), Appendix D, "SageTV Command Line Parameters". It'll take a bit of work on your part to translate the channel # digits to Sage's "event #", but it seems doable.
Thanks. I've already reviewed the available switches and there does not seem to be a way to do it using the options already available.
Reply With Quote
  #9  
Old 10-07-2019, 02:28 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
What is your client for this instance of SageTV? An extender? A PC running the full server edition of SageTV? An AndroidTV box?

You could probably use curl from the CLI to do what you are looking for via the SageTV API or hit to the Sage Web client. That may require knowledge of the MAC or IP address of the client/miniclient.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #10  
Old 10-07-2019, 03:06 PM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Quote:
Originally Posted by tmiranda View Post
Yes, this would be a simple plug in to write. I'm not really interested in making a "formal" plugin but would be willing to make a "one off" for you.
If you could do that, that would be awesome.

TIA
Reply With Quote
  #11  
Old 10-07-2019, 03:11 PM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Quote:
Originally Posted by doodeedoo View Post
EventGhost is another option that would allow sending of keystrokes based on the program start. The program already has a dedicated SageTV pluging that would allow you to send direct commands to Sage.
Thx, but I don't think there is a way to switch to "LiveTV" using keystrokes.

Is there a shortcut key combo to do this from the Main Menu?
Reply With Quote
  #12  
Old 10-07-2019, 03:14 PM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Quote:
Originally Posted by wayner View Post
What is your client for this instance of SageTV? An extender? A PC running the full server edition of SageTV? An AndroidTV box?
I'm running v9 of the software on a Win7 PC.

The shortcut says "Server Edition" but I don't know if it is the "Full" version or not.
Reply With Quote
  #13  
Old 10-07-2019, 03:22 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Quote:
Originally Posted by Mugsy View Post
Thx, but I don't think there is a way to switch to "LiveTV" using keystrokes.

Is there a shortcut key combo to do this from the Main Menu?
It sure seems like the SendMessage utility could do what you're looking for. It's described in Appendix J in the manual. It essentially pushes the same buttons a user would to navigate (i.e. HOME, DOWN, SELECT, etc.). If you use the same sequence starting with HOME, it should be repeatable.
Reply With Quote
  #14  
Old 10-07-2019, 03:22 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Quote:
Originally Posted by Mugsy View Post
I'm running v9 of the software on a Win7 PC.

The shortcut says "Server Edition" but I don't know if it is the "Full" version or not.
Anything that isn't not a miniclient (i.e. extender or Android) is "full".
Reply With Quote
  #15  
Old 10-07-2019, 03:58 PM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Quote:
Originally Posted by wnjj View Post
It sure seems like the SendMessage utility could do what you're looking for. It's described in Appendix J in the manual.


Quite by accident, I discovered if you simply hit the left arrow, it switches to LiveTV (the "long" way is PgUp... in case you were last on another menu... Right, Down, [Enter].)

Now, how do I decipher how to use the cryptic "SendMessage" command?

I created a bat file to call "SendMessage.exe" with switches, but it wants a Class name, a windowname, a "Message" and parameters.
Reply With Quote
  #16  
Old 10-07-2019, 04:09 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by Mugsy View Post


Quite by accident, I discovered if you simply hit the left arrow, it switches to LiveTV (the "long" way is PgUp... in case you were last on another menu... Right, Down, [Enter].)

Now, how do I decipher how to use the cryptic "SendMessage" command?

I created a bat file to call "SendMessage.exe" with switches, but it wants a Class name, a windowname, a "Message" and parameters.
Code:
Appendix J: Using the SendMessage Utility 
 
When SageTV is installed, SendMessage.exe (version 2.2) is also placed in your SageTV directory. If that file is not in your SageTV directory it may be downloaded from the attachment to this forum post: http://forums.sagetv.com/forums/showthread.php?p=125680&postcount=1
This utility was created by a SageTV user and is provided by SageTV “as-is”. Use of this utility is not supported by SageTV’s technical support. If you need help using this utility, please go to our discussion forum at forums.sagetv.com/forums.
The SendMessage utility can be used to send commands to SageTV as Windows messages, using the command event numbers. See: Sending Commands via Windows Messages. While SageTV itself can also do this with its -event parameter, SendMessage has a few advantages: 
 
1. The SendMessage exe file is smaller than the SageTV exe file, so it will load and run faster. 
 
2. Unlike the -event parameter, the SendMessage utility is capable of sending multiple commands each time the program is run, making it easier to ‘batch process’ a series of commands. 
 
3. SendMessage can be used to send messages to any Windows program. 
 
Usage 
 
If SendMessage is run without any parameters, it will display a dialog with a brief outline of its usage instructions. The utility uses the following command line format: 
 
SendMessage WindowClass WindowName MsgID wParam lParam <repeat param list> … 
 
The above-referenced Sending Commands via Windows Messages section lists the values to be used for each of those parameters in order to send command event numbers to SageTV or SageTVClient. To send multiple messages, simply send another series of those five parameters after the first five. 
 
In addition to those parameters, default values for each parameter can be defined when you wish to send multiple messages: once a default value is set, that value can be skipped in the list of parameters for additional messages to be sent. To define default values, use the following options. Note that the values are not case sensitive (-c is the same as –C): 
 
-C WindowClass – Define the window class name to receive multiple messages. 
 
-N WindowName – Define the name of the window to receive multiple messages. 
 
SageTV V7.0 User’s Guide Appendix J: Using the SendMessage Utility Page 282 
Copyright 2010 SageTV, LLC All rights reserved For additional support, go to www.sagetv.com/support.htmlor email us at support@sagetv.com
-M MsgID – The Windows message number to be sent; decimal value. 
 
-W wParam – The message’s wParam value to be sent; decimal value. 
 
-L lParam – The message’s lParam value to be sent; decimal value. 
 
-D DelayTime – Time, in milliseconds, to delay between each message sent. This parameter is not usually needed, but was added in case such a delay was ever desired. 
 
Any parameters that contain spaces, perhaps the WindowClass or WindowName of some application, can be enclosed in quotes, such as: -C “Window Class”. 
 
Example Use 
 
To show how the parameters might be put into use to control SageTV, let’s take a look at a common desire: to have SageTV go directly to a menu that currently has no direct-access command. The Plugin Manager’s All Available Plugins menu is one such location. The following series of commands will go to that location from anywhere within SageTV: 
 
Home –Event number 28; go to the Main Menu.
Page Down – Event number 56; Page Down to make sure the bottom menu item is highlighted. 
 
Up –Event number 4; arrow Up to the Setup menu item. 
 
Right –Event number 3; arrow into the Setup submenu. 
 
Page Up –Event number 55; Page Up to make sure the top submenu item is highlighted. 
 
Down,Down –Event number 5; arrow Down to the SageTV Plugins menu item. 
 
Right –Event number 3; arrow into the SageTV Plugins submenu. 
 
Page Up –Event number 55; Page Up to make sure the top submenu item is highlighted. 
 
Select – Event number 20; Select the All Available Plugins submenu item to go to that menu. 
 
Putting all the above options together, SendMessage can be used as follows to issue this series of commands for SageTV: 
 
SendMessage.exe -C SageApp -N SageWin -m 1258 -W 0 42 28 56 4 3 55 5 5 3 55 20 
 
SageTV V7.0 User’s Guide Appendix J: Using the SendMessage Utility Page 283 
Copyright 2010 SageTV, LLC All rights reserved For additional support, go to www.sagetv.com/support.htmlor email us at support@sagetv.com
In this example, SageApp is the name of the window class receiving the message; SageWin is the name of the window to receive the message; 1258 is the message ID number; 0 is the wParam value; and “42 28 56 4 3 55 5 5 3 55 20” is the series of command event numbers to send to SageTV. 
 
Note: To control SageTVClient, use SageClientApp instead of SageApp.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #17  
Old 10-07-2019, 04:33 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Check out page 217 of the manual for details but nyplayer's post summarizes it from a different manual page. User manual: http://download.sage.tv/SageTV_Manual.pdf

Quote:
Sending Commands via Windows Messages
SageTV can also be controlled by events sent as Windows messages through the SendMessage
Windows API function call. When sending a command event via SendMessage, the following
parameters must be used:
Parameter To Control SageTV or Placeshifter To Control SageTVClient
Window Class: SageApp SageClientApp
Window Name: SageWin SageWin
Message ID: WM_USER + 234 (1258) WM_USER + 234 (1258)
wParam: 0 (not used) 0 (not used)
lParam: Event number Event number
The event numbers for each command are listed in the List of All SageTV Commands, below.
Reply With Quote
  #18  
Old 10-07-2019, 04:56 PM
Mugsy Mugsy is offline
Sage User
 
Join Date: Aug 2019
Location: Houston
Posts: 35
Quote:
Originally Posted by nyplayer View Post
[CODE]Appendix J: Using the SendMessage Utility
Thx, but you didn't need to reprint the entire appendix. I already went online and read it. It doesn't make anything any clearer.

I already tried creating a batch file based on that info. It didn't work and I have no idea what I did wrong.
Reply With Quote
  #19  
Old 10-07-2019, 05:06 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Quote:
Originally Posted by Mugsy View Post
Thx, but you didn't need to reprint the entire appendix. I already went online and read it. It doesn't make anything any clearer.

I already tried creating a batch file based on that info. It didn't work and I have no idea what I did wrong.
How about posting your batch file so we can take a look? The example shows -W but the section I posted says to use lParam. Maybe try -L instead of -W

Last edited by wnjj; 10-07-2019 at 06:40 PM.
Reply With Quote
  #20  
Old 10-07-2019, 05:27 PM
JustFred JustFred is offline
Sage Expert
 
Join Date: May 2015
Location: Sunnyvale, Ca
Posts: 572
Quote:
Originally Posted by Mugsy View Post
Thx, but I don't think there is a way to switch to "LiveTV" using keystrokes.

Is there a shortcut key combo to do this from the Main Menu?
According to the List Of All SageTV Commands, sending Event # 63 jumps to "LiveTV". See Appendix D, and then specifically page 224 in the user manual.
__________________
System #1: Win7-64, I7-920, 8 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HDHR-US (1st gen white) tuners. HD-200.
System #2: Win7-64, I7-920, 8 GB mem, 4TB HD. Java 1.8.0_131. Sage v9.1.6.747. ClearQAM: 2x HDHR3-US tuners. HD-200.
System #3: Win7-64, I7-920, 12 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HVR2250; Spectrum Cable via HDPVR & USB-UIRT. 3x HD-200.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modems and switches rfeyer Hardware Support 6 04-17-2017 02:48 PM
I have a question about switches. rnadeau Hardware Support 29 07-10-2012 08:57 PM
Change JVM switches CadErik General Discussion 0 12-30-2008 01:40 AM
Two ATX Power Switches? EdwardATeller Hardware Support 4 04-13-2008 02:31 PM
Routers, switches, et. al. ToonGal Hardware Support 23 03-13-2004 11:11 PM


All times are GMT -6. The time now is 10:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.