Page 1 of 2

Weather Information

Posted: Sun Nov 01, 2009 1:11 am
by peter
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.

Re: Weather Information

Posted: Mon Nov 02, 2009 6:39 am
by krambriw
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

Re: Weather Information

Posted: Sat Jan 09, 2010 7:05 am
by kalia
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!

Re: Weather Information

Posted: Sun Feb 28, 2010 6:41 am
by kalia
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

Re: Weather Information

Posted: Tue Mar 02, 2010 3:17 pm
by jitterjames
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.

Re: Weather Information

Posted: Sat Jun 19, 2010 5:58 pm
by Killedbyalbany
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?

Re: Weather Information

Posted: Sat Jun 19, 2010 10:02 pm
by jitterjames
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}

Re: Weather Information

Posted: Tue Aug 28, 2012 6:33 am
by storstenson
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

Re: Weather Information

Posted: Tue Aug 28, 2012 11:23 am
by krambriw
Service Unavailable
Image1.jpg

Re: Weather Information

Posted: Tue Aug 28, 2012 12:20 pm
by jitterjames
Google pulled the plug on another one of its free apis. The message is "misleading" to say the least.

Re: Weather Information

Posted: Tue Aug 28, 2012 3:53 pm
by storstenson
Ok! Many thanks for the replays! That's a shame:( any suggestions for another way of getting weather forecast to eventghost?

Re: Weather Information

Posted: Tue Aug 28, 2012 6:37 pm
by krambriw
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

Re: Weather Information

Posted: Thu Aug 30, 2012 7:29 am
by storstenson
Hi!

Nice! The "SunTracker: GetSunStateWithTimeStamp" works nice:) But how can I get forcast and temps?

Re: Weather Information

Posted: Thu Aug 30, 2012 7:32 am
by storstenson
*SunTracker: GetWeatherCondition

Re: Weather Information

Posted: Sun Aug 24, 2014 5:32 pm
by thahim
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 10273 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'