Weather Information

Questions and comments specific to a particular plugin should go here.

Weather Information

Postby peter » Sun Nov 01, 2009 1:11 am

Hi,

I have just created a NEW eventghost plugin for retrieving weather information (from a webservice) to use in EventGhost.
Attached is the zip file with the new plugin.

to use it:
1) Extract attached zipfile in the plugins directory of eventghost.
2) Add the Weather plugin in the tree.
3) Add / configure the actions from the weather plugin as needed.

Have also attached a sample eventghost configuration file (SampleWeather.xml).

PS: this is quite nice in combination with the Speech plugin to let the PC tell the current weather and weatherforecast on command, and becomes very powerfull in conjunction with my SpeechRecognition Plugin posted somewhere else in this forum, to just ask for the weather / weather forecast.

Feel free to add in next release as plugin.
Also Let me know any issues. This is tested on Windows xp and since it is a webservice an internetconnection is needed :-)

02-11-2009: I deleted version 1 and version 1.1 and have attached a new version 1.2 of the weather plugin, which also includes a getter for the individual field values. Please use this version instead in case you already downloaded the old version. See new attached sample file for how to retrieve the info.
Limitation Note: Before configuring the GetWeatherFieldValue Action, first execute GetWeatherFromGoogle Action Once sucessfully to retrieve the available configuration fields to select from in the GetWeatherFieldValue Action .

Also added a ResultLogger Action for convenience while configuring, and for demo, and updated sample xml file again


NOTE: Icon path returned needs to be prefixed with http://www.google.com to get the picture, in case you want to use these icons I recommend loading them local and refering from the local directory to them in your code.
Attachments
Weather - v1.2.zip
(18.52 KiB) Downloaded 790 times
SampleWeather - v1.2.xml
(5.11 KiB) Downloaded 752 times
Last edited by peter on Mon Nov 02, 2009 12:38 pm, edited 2 times in total.
peter
 
Posts: 19
Joined: Sat Jul 05, 2008 6:46 pm
Location: Belgium (NL)

Re: Weather Information

Postby krambriw » Mon Nov 02, 2009 6:39 am

Thanks Peter,
I have been thinking about how to get weather information like this. It solves an old idea I had how to improve my SunTracker plugin to adjust settings automatically to the weather conditions (if cloudy, turn on the lights earlier at sunset)

Best regards, Walter
My latest plugins
http://plugins.krambriw.net/index.html

Two men in front of a huge excavator...
- that beast steels work from 100 men with shovels
- well, a 1000 men could do the same using teaspoons
krambriw
Plugin Developer
 
Posts: 2569
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden

Re: Weather Information

Postby kalia » Sat Jan 09, 2010 7:05 am

Thank you Peter for sharing the Weather Information plug-in.

I had a question. How can you can the forecast values in Celsius instead of Fahrenheit? I took a look at the sample Eventghost configuration file (SampleWeather.xml). I can see the "['temp c']" value for the current condition, but how can I get the future forecast temperature in Celsius?

Thanks!
kalia
Experienced User
 
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: Weather Information

Postby kalia » Sun Feb 28, 2010 6:41 am

Well since there was no reply to my question, I will just share my work around solution if anyone is interested. Convert Fahrenheit to Celsius by using the following equation:

(Fahrenheit - 32 ) * 5/9
Attachments
Forcast in Celsius.jpg
kalia
Experienced User
 
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: Weather Information

Postby jitterjames » Tue Mar 02, 2010 3:17 pm

kalia wrote:Well since there was no reply to my question, I will just share my work around solution if anyone is interested. Convert Fahrenheit to Celsius by using the following equation:

(Fahrenheit - 32 ) * 5/9


that is a good workaround solution. the problem exists because the information supplied by google is not very good. They only provide imperial units for the forecast for some strange reason. They also provide to few cities (in Canada anyway). The nearest city to where I live has significantly different weather from what I get.

Peter, I notice you are using code that includes a function to lookup weather from yahoo. It may vary depending on your country, but in Canada the yahoo lookup is a much better choice and it allows you to specify what units to use (metric or imperial) for both the current and forecasted conditions.

Maybe one day you will add support for the yahoo lookup?

All the same, thanks for your work on this plugin. It is very nicely done.
User avatar
jitterjames
Experienced User
 
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada

Re: Weather Information

Postby Killedbyalbany » Sat Jun 19, 2010 5:58 pm

How are you getting the speech plugin to read the results? Can you configure it to read something other than the line of text in the configuration?
Killedbyalbany
 
Posts: 7
Joined: Thu Apr 29, 2010 2:36 pm

Re: Weather Information

Postby jitterjames » Sat Jun 19, 2010 10:02 pm

Killedbyalbany wrote:How are you getting the speech plugin to read the results? Can you configure it to read something other than the line of text in the configuration?

{eg.result}
User avatar
jitterjames
Experienced User
 
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada

Re: Weather Information

Postby storstenson » Tue Aug 28, 2012 6:33 am

Hi,

It doesn't seem to work anymore. Anyone who can tell we whats wrong?

Error getting weather:

Error in Action: "Weather: GetWeatherFromGoogle: Antwerp, Belgium"
Traceback (most recent call last) (1572):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Weather\__init__.py", line 89, in __call__
self.plugin.weather_data = pywapi.get_weather_from_google(location_id, hl)
File "C:\Program Files (x86)\EventGhost\plugins\Weather\pywapi.py", line 55, in get_weather_from_google
handler = urllib2.urlopen(url)
File "urllib2.pyc", line 126, in urlopen
File "urllib2.pyc", line 397, in open
File "urllib2.pyc", line 510, in http_response
File "urllib2.pyc", line 435, in error
File "urllib2.pyc", line 369, in _call_chain
File "urllib2.pyc", line 518, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
storstenson
 
Posts: 5
Joined: Sun Jul 01, 2012 9:58 am

Re: Weather Information

Postby krambriw » Tue Aug 28, 2012 11:23 am

Service Unavailable

Image1.jpg
My latest plugins
http://plugins.krambriw.net/index.html

Two men in front of a huge excavator...
- that beast steels work from 100 men with shovels
- well, a 1000 men could do the same using teaspoons
krambriw
Plugin Developer
 
Posts: 2569
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden

Re: Weather Information

Postby jitterjames » Tue Aug 28, 2012 12:20 pm

Google pulled the plug on another one of its free apis. The message is "misleading" to say the least.
User avatar
jitterjames
Experienced User
 
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada

Re: Weather Information

Postby storstenson » Tue Aug 28, 2012 3:53 pm

Ok! Many thanks for the replays! That's a shame:( any suggestions for another way of getting weather forecast to eventghost?
storstenson
 
Posts: 5
Joined: Sun Jul 01, 2012 9:58 am

Re: Weather Information

Postby krambriw » Tue Aug 28, 2012 6:37 pm

I have just uploaded the updated version of my SunTracker plugin. It uses now Yahoo! Weather. You can use the plugin to get your weather info.

Best regards, Walter
My latest plugins
http://plugins.krambriw.net/index.html

Two men in front of a huge excavator...
- that beast steels work from 100 men with shovels
- well, a 1000 men could do the same using teaspoons
krambriw
Plugin Developer
 
Posts: 2569
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden

Re: Weather Information

Postby storstenson » Thu Aug 30, 2012 7:29 am

Hi!

Nice! The "SunTracker: GetSunStateWithTimeStamp" works nice:) But how can I get forcast and temps?
storstenson
 
Posts: 5
Joined: Sun Jul 01, 2012 9:58 am

Re: Weather Information

Postby storstenson » Thu Aug 30, 2012 7:32 am

*SunTracker: GetWeatherCondition
storstenson
 
Posts: 5
Joined: Sun Jul 01, 2012 9:58 am

Re: Weather Information

Postby thahim » Sun Aug 24, 2014 5:32 pm

kalia wrote:Well since there was no reply to my question, I will just share my work around solution if anyone is interested. Convert Fahrenheit to Celsius by using the following equation:

(Fahrenheit - 32 ) * 5/9

Hi Friend i have made this

same.png
same.png (7.33 KiB) Viewed 5963 times


But i'm getting error
Error in Action: "Speech: Speak: {"and "+ str((int(eg.result)-32)*5/9) + "degrees Celcius"}"
Traceback (most recent call last) (1669):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Speech\__init__.py", line 193, in __call__
voiceText = eg.ParseString(voiceText, filterFunc)
File "C:\Program Files (x86)\EventGhost\eg\Utils.py", line 204, in ParseString
res = eval(word, {}, eg.globals.__dict__)
File "<string>", line 1, in <module>
TypeError: int() argument must be a string or a number, not 'NoneType'
EventGhost Version 0.4.1.r1669
Windows 7
thahim
 
Posts: 17
Joined: Fri Jul 11, 2014 5:33 am

Next

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 4 guests