SageTV Community  

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

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-06-2011, 07:26 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Post Google Weather API v1

Since the weather.com feed has been closed, weather data in SageTV is now provided via the Google Weather plugin. To assist anyone updating the weather display in a customization, here are the available API calls that can be used directly in Studio:

First get an instance of this class using:
Weather = sage_google_weather_GoogleWeather_getInstance()

The version of this class can be obtained from:
sage_google_weather_GoogleWeather_getWeatherVersion()


The location for Google Weather can be set using: (can be a zip code, postal code, city,state, city,country, etc.)
sage_google_weather_GoogleWeather_setGoogleWeatherLoc(Weather, "CityName")

To clear the Google Weather location:
sage_google_weather_GoogleWeather_removeGoogleWeatherLoc(Weather)


The Zip Code location for NWS Weather can be set using: (must be a zip code in the US)
sage_google_weather_GoogleWeather_setNWSZipCode(Weather, "01234")

To clear the NWS Weather zip code location:
sage_google_weather_GoogleWeather_removeNWSZipCode(Weather)


The the units can be set using: (mus be "s" or "m", for standard/english or metric, respectively; default: "s")
sage_google_weather_GoogleWeather_setUnits(Weather, "s")


To cause an update to occur (it respects caching, returns a boolean):
sage_google_weather_GoogleWeather_updateAllNow(Weather)

To use an ISO 639-1 Language Code with Google weather:
sage_google_weather_GoogleWeather_updateAllNow(Weather,"LangCode")

To update only Google weather (with or w/o a lang code):
sage_google_weather_GoogleWeather_updateGoogleNow(Weather)
sage_google_weather_GoogleWeather_updateGoogleNow(Weather,"LangCode")

To update only NWS weather (with or w/o a lang code):
sage_google_weather_GoogleWeather_updateNWSNow(Weather)


To Get more info:
sage_google_weather_GoogleWeather_getGoogleWeatherLoc(Weather) returns String
sage_google_weather_GoogleWeather_getNWSZipCode(Weather) returns String
sage_google_weather_GoogleWeather_getUnits(Weather) returns String, "s" (default) or "m"

sage_google_weather_GoogleWeather_isCurrentlyUpdatingAll(Weather)
sage_google_weather_GoogleWeather_isCurrentlyUpdatingGW(Weather)
sage_google_weather_GoogleWeather_isCurrentlyUpdatingNWS(Weather)

sage_google_weather_GoogleWeather_getLastError(Weather) return String

sage_google_weather_GoogleWeather_getLastUpdateTime(Weather) returns long
sage_google_weather_GoogleWeather_getLastUpdateTimeGW(Weather) returns long
sage_google_weather_GoogleWeather_getLastUpdateTimeNWS(Weather) returns long


Get Google weather info:

sage_google_weather_GoogleWeather_getGWCityName(Weather) return String
Get current condition for properties: (propName can be one of: CondText, HumidText, Temp, iconURL, WindText)
sage_google_weather_GoogleWeather_getGWCurrentCondition(Weather,propName) return String
sage_google_weather_GoogleWeather_getGWCurConditionProperties(Weather) returns a Map
sage_google_weather_GoogleWeather_getGWDayCount(Weather) return int
Get forecast condition for properties on day #: (propName can be one of: CondText, high, iconURL, low, name)
sage_google_weather_GoogleWeather_getGWForecastCondition(Weather,dayNum,propName) return String
sage_google_weather_GoogleWeather_getGWForecastConditionProperties(Weather,dayNum) returns a Map


Get NWS weather info:

sage_google_weather_GoogleWeather_getNWSCityName(Weather) return String
sage_google_weather_GoogleWeather_getNWSPeriodCount(Weather) return int
Get forecast condition for properties in 12h period #: (propName can be one of: forecast_text, icon_url, name, precip, summary, temp, tempType - returns h or l)
sage_google_weather_GoogleWeather_getNWSForecastCondition(Weather,periodNum,propName) return String
sage_google_weather_GoogleWeather_getNWSForecastConditionProperties(Weather,periodNum) returns a Map
__________________
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.
Reply With Quote
  #2  
Old 11-06-2011, 08:56 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Thanks Andy. I installed the new STV update and all is well.
__________________

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
  #3  
Old 11-06-2011, 07:35 PM
iumgrad iumgrad is offline
Sage User
 
Join Date: Oct 2007
Location: Michigan
Posts: 33
SageMC weather update?

How do I get SageMC to use this for weather info?
Reply With Quote
  #4  
Old 11-06-2011, 07:44 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by iumgrad View Post
How do I get SageMC to use this for weather info?
If you are asking whether SageMC will be updated, please post in the SageMC forum.

If you are asking how you would do it... then you would need to edit the SageMC STV in Studio to use the new weather API calls & changed data from those calls.

- 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.
Reply With Quote
  #5  
Old 11-06-2011, 08:02 PM
iumgrad iumgrad is offline
Sage User
 
Join Date: Oct 2007
Location: Michigan
Posts: 33
SageMC weather update

so I better hope that someone else (with good knowledge of studio, I have none) posts step by step instructions. Knew I should have gotten more invovled in learning how to use studio.
Reply With Quote
  #6  
Old 11-07-2011, 07:49 PM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
Thanks for posting the details.

Is there any other information available from these sources (pressure, UV etc) or have you exposed all the data available through the API?

Thanks again

k
Reply With Quote
  #7  
Old 11-07-2011, 07:51 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
As far as I know, I made all weather data in the XML files available & displayed it all in the STV update.

- 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.
Reply With Quote
  #8  
Old 11-23-2011, 12:28 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Andy, could document the Map for the following API

Code:
sage_google_weather_GoogleWeather_getGWCurConditionProperties(Weather) returns a Map
Thanks
Reply With Quote
  #9  
Old 11-26-2011, 03:31 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
While you're at it, how about these as well:

Code:
sage_google_weather_GoogleWeather_getGWForecastConditionProperties(Weather,dayNum) returns a Map

sage_google_weather_GoogleWeather_getNWSForecastConditionProperties(Weather,periodNum) returns a Map
Thanks,

Tom
__________________

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
  #10  
Old 11-28-2011, 07:58 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Now that I'm back home...

Those calls return a map with the applicable properties mapped to their values. So, for example, getGWCurConditionProperties() would return a map of the valid propName parameters for getGWCurrentCondition() mapped to the values for each propName.

(I don't actually use those calls; they were added just to match the similar calls available in the previous 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.
Reply With Quote
  #11  
Old 12-04-2011, 07:02 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Hi,

I had a problem getting an image URL for a location and although I was using another API in conjunction with this plugin we thought you may have an idea as to why it wouldn't pull a valid image URL.

Here's a link to the original thead.

Thanks

Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #12  
Old 12-04-2011, 09:22 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
This is using an undocumented Google weather API that was found on the web; whatever it returns is what it returns.

If it returns no icon, maybe there is no weather. Either be careful when you go outside, or try configuring a different/better location description for where you are. In the other topic, you said "The locations I entered was Scotland and Edinburgh." How about configuring the weather to use something more specific like "Edinburgh,Scotland"?

- 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.
Reply With Quote
  #13  
Old 12-05-2011, 05:14 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I think it was just that there was no valid URL for that weather condition as I got all the other weather details... its not a problem as everything else works.

Cheers

Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #14  
Old 12-05-2011, 08:03 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
The reason I suggested trying a different location description, such as "Edinburgh,Scotland", is because I only saw a lack of info for condition & condition icon when using just "Scotland" as the location.

- 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.
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
Google weather - not working !!!! jusjoken SageTV Software 95 10-12-2012 03:09 PM
Suddenly Lost Google Weather Savage1701 SageTV v7 Customizations 2 07-09-2012 11:15 AM
Any plugin developers interested in porting Google Weather to STV3? Rezolution SageTV v7 Customizations 16 12-14-2011 08:51 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


All times are GMT -6. The time now is 12:56 PM.


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