Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Weather plugin

Questions and comments specific to a particular plugin should go here.
Post Reply
overb
Posts: 3
Joined: Mon Dec 09, 2013 4:33 pm

Weather plugin

Post by overb »

Hi! im trying to get weather announces working in eventghost but it seems like the plugin that comes with eventghost doesent work since Googles weather Api is no longer available?
Is there any other plugin working? what is the best way to get speech engine to announce weather?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Weather plugin

Post by krambriw »

What plugin are you referring to?

Check out the latest SunTracker plugin, it uses Yahoo! weather api.

For announcing weather, you might have to write a small python script that takes the actual weather from the weather event and announces it. I guess you need to add some additional logic not to hear the current weather repeated every minute but only when the weather changes? There are many possibilities and options but you need to define your detailed requirements then.

BR
overb
Posts: 3
Joined: Mon Dec 09, 2013 4:33 pm

Re: Weather plugin

Post by overb »

Im referring to plugin "Weather" that comes with eventghost.
Actually i have tried the SunTracker plugin, tho it doesnt give that much information, for example it just says "Weather condition: Snow".
It would be nice with some information about temprature and windspeed etc.
Is there any common python script i can use for gather information from EG events and make TTS anounnce it? Im not so good at programming and python scripts.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Weather plugin

Post by krambriw »

Sorry, but you have not investigated the possibilities properly enough. This is what (location dependent) you could get from the SunTracker plugin using for instance a simple python script :

Code: Select all

23:26:30   {'date': u'Mon, 09 Dec 2013 10:50 pm CET', 'text': u'Mostly Cloudy', 'code': u'27', 'temp': u'-8', 'title': u'Conditions for Sollentuna Municipality, SE at 10:50 pm CET'}
23:26:30   {'direction': u'270', 'speed': u'1.61', 'chill': u'-8'}
23:26:30   [{'date': u'9 Dec 2013', 'high': u'-2', 'code': u'46', 'low': u'-4', 'text': u'Snow Showers Late'}, {'date': u'10 Dec 2013', 'high': u'4', 'code': u'5', 'low': u'2', 'text': u'Rain/Snow'}, {'date': u'11 Dec 2013', 'high': u'4', 'code': u'28', 'low': u'3', 'text': u'Mostly Cloudy'}, {'date': u'12 Dec 2013', 'high': u'6', 'code': u'30', 'low': u'2', 'text': u'Partly Cloudy'}, {'date': u'13 Dec 2013', 'high': u'3', 'code': u'30', 'low': u'-1', 'text': u'Partly Cloudy'}]
23:26:30   {'pressure': u'1015.92', 'rising': u'0', 'visibility': u'9.99', 'humidity': u'91'}
The script:

Code: Select all

print eg.plugins.Suntracker.GetCurrentCondition()
print eg.plugins.Suntracker.GetWindData()
print eg.plugins.Suntracker.GetForecasts()
print eg.plugins.Suntracker.GetAtmosphereData()
overb
Posts: 3
Joined: Mon Dec 09, 2013 4:33 pm

Re: Weather plugin

Post by overb »

oh thats alot of information :D

I tried post "{eg.plugins.Suntracker.GetCurrentCondition()}" in TTS and it reads it all up, is there anyway to filter
the command so it just reads the weather information and not the whole code?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Weather plugin

Post by krambriw »

Well, I assume from here and on, you will need some python. I will give you a starting point as example.

In the python code below, as a result (res) you receive a so called dictionary holding items (pairs). Each item has a key
and its value. To get access to individual values in a dictionary you just use the key and the value is yours.

BR

Code: Select all

res = eg.plugins.Suntracker.GetCurrentCondition()
value = res['text']
print value
value = res['title']
print value

#etc etc

pubsfried
Posts: 7
Joined: Thu Jul 26, 2012 5:53 pm
Location: DE-66424 Homburg

Re: Yahoo weather sends sometimes wrong current temperature

Post by pubsfried »

Just an info for all struggling with receiving wrong temperatures from the weather plugin (haven't checked the other values):
A lot of users of Yahoo! Weather currently complain that the temperature is always off the real value:
https://yahoo.uservoice.com/forums/207813
for example
https://yahoo.uservoice.com/forums/2078 ... in-7-c-off

Same happened to me yesterday: real 18-22C, Yahoo showed 1-8C, but the forecast for the next days was always ok.
The related RSS-Feed...
http://weather.yahooapis.com/forecastrss?w=641568&u=c (change ID to your location for debug)
... showed the same shit (excuse me). Today it shows the correct value, but seems to be poor reliability.

@krambriw
Walter,
is there a chance to move to or add http://www.openweathermap.org ? here' an example for the api request:
http://api.openweathermap.org/data/2.5/ ... id=2827613
EDIT: Example 7days http://api.openweathermap.org/data/2.5/ ... tric&cnt=7
Documentation: http://www.openweathermap.org/api_station
It covers 100000+ stations all over the world and the one near to my home (only 7km away) updates accurately every 10 minutes. And everybody can add his own weather station.

I had a quick look into pywapi.py, doesn't look too complex, but unfortunately I've no experience with python.
Michael
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Weather plugin

Post by Pako »

I looked at OpenWeatherMap and it looks interesting.
I can create a new plugin for it.
But I do not want to do unnecessary work.
Maybe Walter already doing on it?

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Weather plugin

Post by krambriw »

No, not planned
pubsfried
Posts: 7
Joined: Thu Jul 26, 2012 5:53 pm
Location: DE-66424 Homburg

Re: Weather plugin

Post by pubsfried »

Pako wrote:I looked at OpenWeatherMap and it looks interesting.
I can create a new plugin for it.
But I do not want to do unnecessary work.
Maybe Walter already doing on it?

Pako
I am glad to hear that! :D I hope this will help a lot of other users, too.
Many thanks in advance, Pako!
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Weather plugin

Post by Pako »

Post Reply