|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Google Weather API v2.0.2
Weather data in SageTV is now provided via the Google Weather plugin, version 2.0.1. To assist anyone updating the weather display in a customization, here are the available API calls that can be used directly in Studio:
Code:
/* * Version History: * * 2.0.0 * - Initial inclusion of W.U. data in the GoogleWeather plugin. * 2.0.1 Oct 16, 2012 * - Changed default icon set to 'c' instead of 'k'. * - Clear data for each section when WU data is updated & section is encountered. * - Check for Not Available data and substitute with appropriate N/A value. * - Added call to retrieve text used to indicate Not Available. * - Added call to get a unique ID (hash code) for the current set of alerts. If the ID changes, then the alerts changed. * - Added local weather stations to search results list when available. * */ /* * Usage of version updated for SageTV integration in the Studio: * * The version of this class can be obtained from: * sage_google_weather_WeatherUnderground_getWeatherVersion() * * The text used to indicate data is Not Available can be obtained from: * sage_google_weather_WeatherUnderground_getNotAvailableText() * * * First get an instance of this class using: * Weather = sage_google_weather_WeatherUnderground_getInstance() * * Or, to get an instance of this class for an alternate weather locale: * Note: the AltLocName string must contain valid filename characters only. * Weather = sage_google_weather_WeatherUnderground_getInstance("AltLocName") * * * To get a list of alternate weather locales, including the primary "" locale: * sage_google_weather_WeatherUnderground_getAllWeatherLocales() returns a Vector * * To get a list of alternate weather locales, not including the "" locale: * sage_google_weather_WeatherUnderground_getAlternateWeatherLocales() returns a Vector * * To remove an alternate locale by removing its weather cache properties file: * sage_google_weather_WeatherUnderground_removeLocale(Weather) returns boolean * * * Searching for a locale's location: * Params: * Weather: The weather class instance. * query: The name of the location to search for. * lang: The 2-letter code for the language to use in the search results. * Returns: * a Vector of location Maps * sage_google_weather_WeatherUnderground_ java.util.Vector searchLocations( Weather, query) returns a Vector * sage_google_weather_WeatherUnderground_ java.util.Vector searchLocations( Weather, query, lang) returns a Vector * * To get information about a location Map: * Params: * Weather: The weather class instance. * LocationMap: The Map of the location info. * sage_google_weather_WeatherUnderground_getLocationCity( Weather, LocationMap ) returns String * sage_google_weather_WeatherUnderground_getLocationState( Weather, LocationMap ) returns String * sage_google_weather_WeatherUnderground_getLocationCountry( Weather, LocationMap ) returns String * sage_google_weather_WeatherUnderground_getLocationNeighborhood( Weather, LocationMap ) returns String * sage_google_weather_WeatherUnderground_getLocationCode( Weather, LocationMap ) returns String * * To set the location for a locale's Weather instance: * sage_google_weather_WeatherUnderground_setWeatherLoc( Weather, LocationMap ) Returns nothing * * To get a locale's Weather instance's current LocationMap setting: * sage_google_weather_WeatherUnderground_getWeatherLoc( Weather ) returns a Map * * To clear a locale's Weather instance's current location, use: * sage_google_weather_WeatherUnderground_removeWeatherLoc( Weather ) returns nothing * * * To get & set the current units setting: * Params: * Weather: The weather class instance. * Units: The units string, (must be "s" or "m", for standard/english or metric, respectively; default: "s") * sage_google_weather_WeatherUnderground_setUnits(Weather, Units ) returns nothing * sage_google_weather_WeatherUnderground_getUnits(Weather ) returns String * * * To handle updating the weather data (Data is cached and updates only actually occure after time limits expire): * Params: * Weather: The weather class instance. * lang: The 2-letter code for the language to use in the search results. * sage_google_weather_WeatherUnderground_updateNow(Weather) returns boolean * sage_google_weather_WeatherUnderground_updateNow( Weather, lang ) returns boolean * sage_google_weather_WeatherUnderground_isCurrentlyUpdating(Weather) returns boolean * sage_google_weather_WeatherUnderground_getLastUpdateTime(Weather) returns long * * * To get information about weather condition icons: * Retrieve a list of all icon condition names: * sage_google_weather_WeatherUnderground_getAllWeatherIconConditions() returns Vector * Retrieve a reduced list of icon condition names: * sage_google_weather_WeatherUnderground_getReplacementWeatherIconConditions() returns Vector * Get the reduced icon style replacement icon name for a single icon condition: * sage_google_weather_WeatherUnderground_getIconReplacementString(IconName) returns String * * Support for multiple sets of condition icons: * Params: * Weather: The weather class instance. * IconSet: The icon set to use; must be one from the list returned by getAllWeatherIconSets() * sage_google_weather_WeatherUnderground_getAllWeatherIconSets(Weather) returns Vector * sage_google_weather_WeatherUnderground_getIconSet(Weather) returns String * sage_google_weather_WeatherUnderground_setIconSet( Weather, IconSet ) returns nothing * * To get icon URLs for weather conditions: * Params: * Weather: The weather class instance. * IconName: The icon condition name. * IconSet: The icon set to use; must be one from the list returned by getAllWeatherIconSets() * * Get an icon URL for the given icon condition name: * sage_google_weather_WeatherUnderground_getIconURL( Weather, IconName ) returns String * sage_google_weather_WeatherUnderground_getIconURL( Weather, IconName, IconSet ) returns String * * Get an icon URL for reduced set replacement name for an icon condition name: * sage_google_weather_WeatherUnderground_getIconReplacementURL( Weather, IconName ) returns String * sage_google_weather_WeatherUnderground_getIconReplacementURL( Weather, IconName, IconSet ) returns String * * * Misc info calls: * Params: * Weather: The weather class instance. * Units: The units string, (must be "s" or "m", for standard/english or metric, respectively; default: "s") * sage_google_weather_WeatherUnderground_getLastError(Weather) returns String * * sage_google_weather_WeatherUnderground_getTempSymbol(Weather) returns String * sage_google_weather_WeatherUnderground_getTempUnit(Weather) returns String * sage_google_weather_WeatherUnderground_getTempUnit( Weather, Units ) returns String * * sage_google_weather_WeatherUnderground_getDistUnit(Weather) returns String * sage_google_weather_WeatherUnderground_getDistUnit( Weather, Units ) returns String * * sage_google_weather_WeatherUnderground_getSpeedUnit(Weather) returns String * sage_google_weather_WeatherUnderground_getSpeedUnit( Weather, Units ) returns String * * sage_google_weather_WeatherUnderground_getPressureUnit(Weather) returns String * sage_google_weather_WeatherUnderground_getPressureUnit( Weather, Units ) returns String * * sage_google_weather_WeatherUnderground_getRainUnit(Weather) returns String * sage_google_weather_WeatherUnderground_getRainUnit( Weather, Units ) returns String * * sage_google_weather_WeatherUnderground_getSnowUnit(Weather) returns String * sage_google_weather_WeatherUnderground_getSnowUnit( Weather, Units ) returns String * * * Once the weather data has been updated, retrieve data via these calls: * Params: * Weather: The weather class instance. * * Get the location place names: * sage_google_weather_WeatherUnderground_getCityName(Weather) returns String * sage_google_weather_WeatherUnderground_getStateName(Weather) returns String * sage_google_weather_WeatherUnderground_getCountryName(Weather) returns String * * Get current condition info for these property names: * Description * Dewpoint * DisplayLocFull * FeelsLike * HeatIndex * Humidity * IconName * ObservationLocCity * ObservationLocCountry * ObservationLocState * ObservationTime * Precip1Hr * PrecipToday * Pressure * PressureTrend returns: -, 0, or + * Temp * UV * Visibility * WindChill * WindDir * WindGust * WindSpeed * sage_google_weather_WeatherUnderground_getCurrentCondition( Weather, propName ) returns String * sage_google_weather_WeatherUnderground_getCurConditionProperties(Weather) returns Map * * Get 12 hour forecast for period number for these property names: * Note: Days have even period numbers; nights have odd period numbers * ChancePrecip * FCText * IconName * PeriodName * sage_google_weather_WeatherUnderground_get12hrForecastStartPeriod(Weather) returns int * sage_google_weather_WeatherUnderground_get12hrForecastEndPeriod(Weather) returns int * sage_google_weather_WeatherUnderground_get12hrForecast( Weather, periodNum, propName ) returns String * sage_google_weather_WeatherUnderground_get12hrForecastProperties( Weather, periodNum ) returns Map * * * Get 24 hour forecast for period number for these property names: * ChancePrecip * Conditions * DateDayNum * DateMonthName * DateMonthNum * DateWeekDay * DateWeekDayShort * DateYear * High * HumidAvg * HumidMax * HumidMin * IconName * Low * RainAllDay * RainDay * RainNight * SnowAllDay * SnowDay * SnowNight * WindAvgDir * WindAvgSpeed * WindMaxDir * WindMaxSpeed * sage_google_weather_WeatherUnderground_get24hrForecastStartPeriod(Weather) returns int * sage_google_weather_WeatherUnderground_get24hrForecastEndPeriod(Weather) returns int * sage_google_weather_WeatherUnderground_get24hrForecast( Weather, periodNum, propName) returns String * sage_google_weather_WeatherUnderground_get24hrForecastProperties( Weather, periodNum) returns Map * * * Get weather alert information properties for an alert number: * StartTime * ExpireTime * Title1 * Title2 * Message1 * Message2 * Message3 * sage_google_weather_WeatherUnderground_getAlertCount(Weather) returns int * sage_google_weather_WeatherUnderground_getAlertUniqueID(Weather) returns int * sage_google_weather_WeatherUnderground_getAlertInfo( Weather, AlertNum, propName) returns String * sage_google_weather_WeatherUnderground_getAlertInfoProperties( Weather, AlertNum) returns Map * * Get Astronomy information for these property names: * SunriseHour * SunriseMinute * SunsetHour * SunsetMinute * MoonPercentIlluminated * MoonAge * sage_google_weather_WeatherUnderground_getAstronomyInfo( Weather, propName) returns String * sage_google_weather_WeatherUnderground_getAstronomyInfoProperties( Weather, AlertNum) returns Map * * Get the moon image URL for the current moon age: * sage_google_weather_WeatherUnderground_getMoonImageURL(Weather) returns String * Get the moon image URL for a specified moon age, in number of days: * sage_google_weather_WeatherUnderground_getMoonImageURL( Weather, MoonAge) returns String * * * Get radar image URLs: * sage_google_weather_WeatherUnderground_getRadarNewestFrameNum(Weather) returns int * sage_google_weather_WeatherUnderground_getRadarOldestFrameNum(Weather) returns int * * Get a radar image URL, using the following parameters: * Params * Weather The weather class instance. * radius The radius from the location, in miles. * width Width of image, in pixels * height Height of image, in pixels * frameNum The frame number, from getRadarOldestFrameNum() to getRadarNewestFrameNum() (5 - 0) * sage_google_weather_WeatherUnderground_getRadarURL( Weather, radius, width, height, frameNum ) returns String * */ If anyone implements the animated radar maps in a customization, please be sure to refer to the code I wrote which unloads the older radar images that are being replaced with new radar images and unloads all radar images in the ApplicationExiting hook - this was put in to help prevent the radar images from pushing out most other graphics, which could otherwise occur if you just sat on the radar screen. (The radar images automatically update after a while to keep the radar current.) The NWS related calls in the v1 Google Weather API should still function. The reference for those calls can be found here: Google Weather API v1
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#2
|
||||
|
||||
The weather condition and moon phase icons can be themed. If any of the images are included in a theme, they will be used instead of the downloaded versions. Any icons not in the theme will be downloaded instead.
All weather icons should be placed in the directory defined by this existing theme line: Code:
# Define the location of the weather icons, as a path relative to the STV directory: String/gWeatherRelPath=WeatherIcons For a list of all weather condition icons, call: Code:
sage_google_weather_WeatherUnderground_getAllWeatherIconConditions() Code:
sage_google_weather_WeatherUnderground_getReplacementWeatherIconConditions() - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#3
|
||||
|
||||
Who says SageTV is dead?
__________________
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 |
#4
|
|||
|
|||
Thanks Opus4!! It is good to see accurate WX data again.
Also thanks for posting the API's so other WX plugins can access the data. We need some optional icons for the online and main menu displays. I didn't find any of the icon sets built in to my liking. They were all too "cartoony" for my taste. Hopefully someone can get a set of icons similar to the original WX Channel ones. Please don't take that as a slam on your efforts, they are MASSIVELY appreciated!
__________________
Wayne Dunham |
#5
|
||||
|
||||
Quote:
Here are the icon condition names retrieved using the above-mentioned calls in Studio: Found 40 total weather icon conditions: [chanceflurries, chancerain, chancesleet, chancesnow, chancetstorms, clear, cloudy, flurries, fog, hazy, mostlycloudy, mostlysunny, partlycloudy, partlysunny, sleet, rain, snow, sunny, tstorms, unknown, nt_chanceflurries, nt_chancerain, nt_chancesleet, nt_chancesnow, nt_chancetstorms, nt_clear, nt_cloudy, nt_flurries, nt_fog, nt_hazy, nt_mostlycloudy, nt_mostlysunny, nt_partlycloudy, nt_partlysunny, nt_sleet, nt_rain, nt_snow, nt_sunny, nt_tstorms, nt_unknown] Found 12 replacement weather icon conditions: [flurries, rain, sleet, snow, tstorms, sunny, cloudy, fog, partlysunny, nt_clear, nt_partlycloudy, nt_unknown] - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. Last edited by Opus4; 11-08-2012 at 02:07 PM. Reason: Updated list of icon names |
#6
|
|||
|
|||
Quote:
I do appreciate the attention you still find time to give to us and our petty needs.
__________________
Wayne Dunham |
#7
|
||||
|
||||
Another thought: If anyone implements the animated radar maps in a customization, please be sure to refer to the code I wrote which unloads the older radar images that are being replaced with new radar images and unloads all radar images in the ApplicationExiting hook - this was put in to help prevent the radar images from pushing out most other graphics, which could otherwise occur if you just sat on the radar screen. (The radar images automatically update after a while to keep the radar current.)
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#8
|
|||
|
|||
Awesome! Thanks for the work!
__________________
Dell PE 2800 - Dual Xeon - 2gb RAM - Windows 2003 sp2 - 2 Video Cards: Hauppauge WINTV HVR 1600 digital |
#9
|
|||
|
|||
Is the Icon set user customizable? The icons that are in the \SageTV\SageTV7\WeatherIcons\Images folder don't appear to be used but they look much better than the ones that I can select from in Options.
* merged; see above *
__________________
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 |
#10
|
||||
|
||||
The first post has been updated for the v2.0.1 Google Weather API.
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#11
|
|||
|
|||
Quote:
If I inspect the results of calling the weather underground api it appears that "rain" is a valid condition. Am I missing something? Thanks! Brian |
#12
|
||||
|
||||
Yes, somehow I missed those. I'll double check the entire list.
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#13
|
|||
|
|||
Thanks!
|
#14
|
||||
|
||||
The plugin has been updated to v2.0.2 to include the rain icon names -- those were the only ones I found to be missing. I have no idea how they got left out, since rain shouldn't be a new weather condition... although for my area they need to update the icon to show the rain going sideways instead of almost straight down.
No functionality changed -- just the list of possible icon names has changed. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#15
|
||||
|
||||
Quote:
__________________
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 |
#16
|
||||
|
||||
Quote:
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Phoenix Google weather | routerunner | Phoenix | 5 | 10-30-2012 11:54 AM |
Google weather - not working !!!! | jusjoken | SageTV Software | 95 | 10-12-2012 03:09 PM |
Google Weather API v1 | Opus4 | SageTV Studio | 13 | 12-05-2011 08:03 AM |
FYI - Google Weather Broken | peterjb | SageTV Australia/New Zealand | 1 | 11-21-2011 03:07 PM |
Downloaded Google Weather Update, No weather? | symgryph | SageTV v7 Customizations | 3 | 11-18-2011 08:55 AM |