SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #101  
Old 10-02-2009, 12:47 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by Slugger View Post
...and I can't envision any other use for a public SRE API.
Neither can I (in fact I have near zero interest in SRE at all), but maybe you're looking at it from the wrong end. Can you envision another instance in which J. Random Plugin might want to use a SageAlert API to get the attention of a sysadmin? I can.
__________________
-- Greg
  #102  
Old 10-02-2009, 06:27 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
I haven't done it myself but is it not possible (through the SageAPI) for random plugin x to create system messages... then SageAlert only has to monitor the System Message Thread (like it does already).

If you wanted to go the extra mile Sage Alert could have a parser to filter system messages if X existed by Y did not (or something like that) to figure out where the alert came from (sagetv, SRE, random plugin x, etc, etc) to more customize the alert level.
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
  #103  
Old 10-02-2009, 07:43 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by GKusnick View Post
Neither can I (in fact I have near zero interest in SRE at all), but maybe you're looking at it from the wrong end. Can you envision another instance in which J. Random Plugin might want to use a SageAlert API to get the attention of a sysadmin? I can.
Very true.

Quote:
Originally Posted by razrsharpe View Post
I haven't done it myself but is it not possible (through the SageAPI) for random plugin x to create system messages... then SageAlert only has to monitor the System Message Thread (like it does already).

If you wanted to go the extra mile Sage Alert could have a parser to filter system messages if X existed by Y did not (or something like that) to figure out where the alert came from (sagetv, SRE, random plugin x, etc, etc) to more customize the alert level.
Yes... excellent idea! SRE (or any plugin) could just generate a system message, which SageAlert already knows how to handle (and best of all, I don't have to go create some public API on top of SageAlert).
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #104  
Old 10-02-2009, 03:13 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Ok, I ended up going with GKusnick's idea and created a public API for SageAlert that allows apps to fire a new event type: RemoteEvent. Snapshot 598 of SageAlert adds the RPC server abilities to SageAlert and also provides the client RPC API package to allow other apps/STV(i)s to incorporate SageAlert into their projects.

Basically, I decided against my original idea of using the SageTV system message facility for two reasons:
  1. The SageTV SystemMessage API is more for relaying important info about your Sage system; I didn't feel it was appropriate to fill the SystemMessage list with SageAlert messages
  2. Through this public API, any app can submit a RemoteEvent type to SageAlert and have all listeners notified.
Under the hood, I chose to implement this as XML-RPC. So even though I'm only providing a Java API to submit these events, anyone could easily duplicate the API in another language by using XML-RPC bindings for their language of choice. If you're actually interested in that, then the class com.google.code.sagetvaddons.sagealert.server.RemoteEventLauncher contains all of the remote RPC calls available on the RPC server (there's actually only one, again making it rather trivial for someone to write a client in another language).

Formal docs will follow, but if you wanted to add SageAlert support to your app/STV(i) in the mean time, here's an example Java program that will do it:

Code:
package sagealert.rpc.test;

import java.net.URL;

import com.google.code.sagetvaddons.sagealert.rpc.RemoteEventLauncher;


public final class TestSageAlertRpc {

	/*
	 * First, ensure all the jars from the sagealert-rpc zip file are in your classpath then a simple program like this will allow you to trigger RemoteEvents to
	 * all registered listeners in SageAlert
	 */
	public static void main(String[] args) {
		try {
			// URL must point to base SageAlert URL (with no trailing slash)
			RemoteEventLauncher rpcClnt = new RemoteEventLauncher(new URL("http://192.168.0.1/sagealert"));
			
			// If you must login to SageAlert (which is the default) then you must set the id/pwd before calling fire()
			rpcClnt.setUserId("your_jetty_id");
			rpcClnt.setPassword("your_jetty_pwd");
			
			// Fire a RemoteEvent in SageAlert; arg 1 is the alert's title/subject and the second arg is the body of the alert text
			if(!rpcClnt.fire("Test alert title", "This is a test alert fired via a remote RPC call!"))
				throw new RuntimeException("Attempt to fire RemoteEvent failed!");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}
When the above app is executed, all registered listeners of the new RemoteEvent type in SageAlert will be notified of the event. My SRE plugin will have a snapshot build before the end of the weekend that supports this ability (and will provide a more complete example of how to incorporate SageAlert support into an app).
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #105  
Old 10-03-2009, 02:31 PM
eric3a eric3a is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Houston by the Sea
Posts: 226
Thanks again. It'll be nice when other apps use SageAlert.

Just to make sure I understand correctly: Updating to latest snapshot will still work with previsouly configured alerts/growler?

Eric
  #106  
Old 10-03-2009, 04:48 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by eric3a View Post
Thanks again. It'll be nice when other apps use SageAlert.

Just to make sure I understand correctly: Updating to latest snapshot will still work with previsouly configured alerts/growler?

Eric
Yes
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #107  
Old 10-03-2009, 07:11 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
If SRE is successfully monitoring an event will it generate a SageAlert event? What types of SRE messages will come through SageAlert - just problems? I don't see a message tonight from SageAlert that SRE is successfully monitoring HNIC even though I believe it is doing so.
__________________
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
  #108  
Old 10-03-2009, 08:13 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
If SRE is successfully monitoring an event will it generate a SageAlert event? What types of SRE messages will come through SageAlert - just problems? I don't see a message tonight from SageAlert that SRE is successfully monitoring HNIC even though I believe it is doing so.
SRE generates remote alerts with SageAlert. Install the latest version of SageAlert and SRE then add servers to receive the remote alert notifications in SageAlert.

SRE (snapshot 603) will generate an info remote alert when it's monitoring an active recording and will generate an error remote alert when it can't find event data for a recording it expects to be monitoring.

The first builds that supported this feature only had a single remote alert type. I've since switched that to three different remote alert types that apps can trigger (info, warning, error). And so you need the latest builds of SRE (603) and SageAlert (604) for it all to work together. Mixing and matching will not work (i.e. SRE less than 603 cannot talk to SageAlert 604+, which is why I deleted all the snapshots that can't talk to each other). If you're running SRE 603 and SageAlert 604, you've properly configured the SageAlert settings in SRE, and you've attached servers to the various remote alerts in SageAlert and you're still not getting the alerts then I need to see some log files from SRE and SageAlert (sre.log and sagealert.log in the root sagetv dir).

Everything seems to be working for me. I just received an alert for the hockey game I'm monitoring right now:

Quote:
SRE is currently monitoring 'NHL Hockey: Calgary Flames at Edmonton Oilers' #SageAlert
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #109  
Old 10-03-2009, 08:16 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thanks - I upgraded both last night but I guess I need to do so again as I am on SRE 600 and Sagealert 598.
__________________
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
  #110  
Old 10-04-2009, 02:30 AM
sleonard's Avatar
sleonard sleonard is offline
Sage Icon
 
Join Date: Nov 2003
Posts: 1,506
What is the "sagealert-rpc-client-0.0.3.604.zip" file for and is it required?

S
  #111  
Old 10-04-2009, 07:29 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by sleonard View Post
What is the "sagealert-rpc-client-0.0.3.604.zip" file for and is it required?

S
The RPC client allows other developers to generate alerts within their own applications. If you are just a user of SageAlert then you do not need the RPC client package.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #112  
Old 10-07-2009, 06:58 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
v1.0.0 released. You may want to subscribe to the new release notification thread to receive future notifications when new releases (official releases, snapshot builds will not be mentioned in the notification thread) are made available.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #113  
Old 10-08-2009, 09:35 PM
eric3a eric3a is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Houston by the Sea
Posts: 226
Thanks for your continued efforts and the warning of a new built.


Thread subscribed to of course.
Eric
  #114  
Old 10-14-2009, 01:35 PM
brandypuff brandypuff is offline
Sage Aficionado
 
Join Date: Mar 2008
Location: Berlin, MA
Posts: 378
Can't get SageAlert working with Windows 7 x64

Not sure if i'm doing something wrong but i configured SageAert with my email address and fired off a test email and that worked OK. I also configured a Twitter alert and performed a test but that did not work and i received no tweets.

I then set up alert for all events but never receive any email. What do i do to debug this thing?

Also, does this have to be started manually each time my server gets rebooted?
__________________
- James M -

Capture Devices: HDHomerunXTEND, HDHomerunPrime
  #115  
Old 10-14-2009, 02:11 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Have a look inside sagealert.log, which is located in the root install dir of sagetv. If alerts are failing to be sent then that log file will have all the errors.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #116  
Old 10-14-2009, 05:07 PM
Skirge01's Avatar
Skirge01 Skirge01 is offline
SageTVaholic
 
Join Date: Jun 2007
Location: New Jersey
Posts: 2,599
@ Slugger: Just wanted to say that I managed to set this up with my already working Jetty SSL in a matter of 10 minutes. Works perfectly, as does every other Jetty app I currently use. Thank you so much for this!!!
__________________
Server: XP, SuperMicro X9SAE-V, i7 3770T, Thermalright Archon SB-E, 32GB Corsair DDR3, 2 x IBM M1015, Corsair HX1000W PSU, CoolerMaster CM Storm Stryker case
Storage: 2 x Addonics 5-in-3 3.5" bays, 1 x Addonics 4-in-1 2.5" bay, 24TB
Client: Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion
Tuners: 2 x HD-PVR (HTTP tuning), 2 x HDHR, USB-UIRT
Software: SageTV 7
  #117  
Old 10-20-2009, 05:05 PM
mtyme mtyme is offline
Sage Advanced User
 
Join Date: Jan 2007
Posts: 98
Mine aren't working either and all the log says is

2009-10-20 17:56:32,207 ERROR [TwitterServer]: 'New notification server test event...' notification FAILED to 'Twitter @ <mytwitteracct>'

Edit: nevermind, stopped and started sage service and now it's working.

Last edited by mtyme; 10-20-2009 at 05:15 PM.
  #118  
Old 10-20-2009, 05:15 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by mtyme View Post
Mine aren't working either and all the log says is

2009-10-20 17:56:32,207 ERROR [TwitterServer]: 'New notification server test event...' notification FAILED to 'Twitter @ <mytwitteracct>'
Upgrade to this v1.0.1 snapshot build. It fixes the logging so Twitter posts that fail will also dump the exception to the log by default. After upgrading, reproduce the failure and check for the exception dump in the log; paste the exception here.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
  #119  
Old 10-23-2009, 07:34 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I don't think that SageAlert is being notified by SRE of events. Should SageAlert notify mean that SRE is monitoring a recording? FYI I am running SRE 2.2.0.603 and SageAlert 0.0.3.604. I will upgrade to V1.01 and let you know how it goes
__________________
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
  #120  
Old 10-23-2009, 08:19 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
SRE 2.2.0 can only talk to SageAlert 1.0.0 (or newer). Once you upgrade SageAlert it should all work fine (be sure to enable SageAlert support in the SRE settings).

When working, SRE will trigger an alert as soon as it starts monitoring a recording. An example tweet that SRE will post to SageAlert is attached. Again, however, you must have a proper version of SRE and SageAlert running together. (SRE 2.2.0 requires SageAlert 1.0.0+)

The incompatibilities you are seeing should be well documented in the sre.log file found in your root SageTV install dir (each failed attempt to post an alert should produce an error message and exception dump in the log file, if it is not then check your SRE settings to ensure that SageAlert support is enabled in SRE - it is turned off by default). But even if you did not turn it on, you will still need to upgrade SageAlert for it to work.
Attached Images
File Type: gif sre_tweet.gif (4.0 KB, 175 views)
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Closed Thread


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
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) cslatt SageTV Customizations 48 06-11-2012 10:44 AM
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 PM
Hulu: Possible to Use XBMC Hulu Plugin to create SageTV Plugin? Brent SageTV Customizations 8 02-24-2009 04:16 PM
Netflix Plugin DwarF SageTV Customizations 8 01-23-2006 08:40 PM
REMOTE WONDER II Plugin? casperse Hardware Support 13 11-08-2004 05:17 PM


All times are GMT -6. The time now is 10:02 AM.


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