OpenWeatherMap

Questions and comments specific to a particular plugin should go here.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: OpenWeatherMap

Post by Pako » Tue Dec 05, 2017 2:01 pm

Medy wrote:
Mon Dec 04, 2017 6:56 pm
Can someone explain how i can create events , lets say for example temperature with this ? Im not familiar with python.
I do not understand the question. What does "how i can create events" mean?
I think it's totally intuitive.

Only two things are essential:
1) Add your city to the list (the checkbox is automatically checked)
2) Check if the "Temperature" checkbox is checked.
The event is automatically triggered as soon as the temperature changes.

Pako
Attachments
OWMplugin.png
OWMplugin2.png

Medy
Experienced User
Posts: 97
Joined: Sat Nov 15, 2014 8:33 pm
Location: Germany

Re: OpenWeatherMap

Post by Medy » Tue Dec 05, 2017 9:39 pm

I see .
Though I would have liked a command to manually get the data.

I saw in a screenshot that u can use eg.print result after get current weather ... it returns a long string with all the data ...
I want to know how to output just the temperature for example / select which data to get.

My goal was tro press a button and display just the temperature via "Onscreendisplay" message for example.

Im aware of that window with a table. Im using that for now.

When I said that I dont know python , I meant im not able to extract specific info from that eg.result string.

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: OpenWeatherMap

Post by Pako » Thu Dec 07, 2017 12:45 pm

Well, now I understand a little better what you need.
See the attached picture. This is one example of how you can do it.

Pako
Attachments
OWM-temp2.png

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: OpenWeatherMap

Post by HTPCanwender » Sat Jul 21, 2018 5:59 pm

When configuring the "Get current weather" command I geht the following error message. It is similar to the message I got with Nmap. Can anybody help?


19:45:30 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
19:45:30 File "wx\_core.pyc", line 16766, in <lambda>
19:45:30 File "C:\Program Files (x86)\EventGhost\plugins\OpenWeatherMap\__init__.py", line 1568, in AfterShow
19:45:30 autoCtrl.ctrl = autoCtrl.CreateCtrl(0)
19:45:30 File "C:\Program Files (x86)\EventGhost\eg\Classes\SmartSpinNumCtrl.py", line 72, in CreateCtrl
19:45:30 **self.kwargs
19:45:30 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 115, in __init__
19:45:30 raise MaxValueError(value, max_val)
19:45:30 MaxValueError: The set value dummy is higher then the maximum of 9999

piert
Experienced User
Posts: 321
Joined: Tue Jun 14, 2011 2:53 pm

Re: OpenWeatherMap

Post by piert » Tue Aug 07, 2018 7:03 am

Hi Pako,

I started using your plugin and I am, like yourself, still on the 'old Eventghost'. I would like to use the property 'wind direction', which in the Open Weather Map dictionary is 'deg', I believe. However there appears to be something wrong, because I can get temperatures from the plugin (I use an action to retrieve the weather data), but for the wind direction there are errors in the log.
Do you know where to look and how I can solve this?

08:45:27 Open Weather Map: Get current weather: 2747891
08:45:27 Error in Action: "Open Weather Map: Get current weather: 2747891"
08:45:27 Traceback (most recent call last) (1722):
08:45:27 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
08:45:27 return self(*args)
08:45:27 File "C:\Program Files (x86)\EventGhost\plugins\OpenWeatherMap\__init__.py", line 1497, in __call__
08:45:27 return self.plugin.GetShortData(data)
08:45:27 File "C:\Program Files (x86)\EventGhost\plugins\OpenWeatherMap\__init__.py", line 1024, in GetShortData
08:45:27 u'deg':self.WindDir(data[u'wind'][u'deg'])
08:45:27 KeyError: u'deg'

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: OpenWeatherMap

Post by Pako » Tue Aug 14, 2018 6:59 am

You can try the test version. There, it seems that the bug is fixed.
The test version has extra "Get forecast" action.
That's incomplete. Only "Dictionary (umodified, full form)" version of the result is valid.
If anyone is interested in it, I can improve it somehow.

Pako
Attachments
__init__.py
Test version 0.1a
(62.54 KiB) Downloaded 72 times

piert
Experienced User
Posts: 321
Joined: Tue Jun 14, 2011 2:53 pm

Re: OpenWeatherMap

Post by piert » Tue Aug 14, 2018 9:34 pm

Many thanks, Pako!
Works great, I now have the wind direction as well.
Just out of curiosity I checked the weather forecast, but that gives a huge amount of information that is difficult to analyze.
Is there a way to print that information in a way that it is easier to see?

Thanks again,
Regards,
Perry

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: OpenWeatherMap

Post by HTPCanwender » Wed Aug 15, 2018 7:57 pm

It's not possible to add the plugin to the egtree. Here is the log:

21:52:00 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
21:52:00 File "C:\Program Files (x86)\EventGhost\plugins\OpenWeatherMap\__init__.py", line 511, in Create
21:52:00 self.itemHeight = self.lb.GetItemHeight()
21:52:00 AttributeError: 'CheckListBox' object has no attribute 'GetItemHeight'
21:52:00 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
21:52:00 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
21:52:00 self.Configure(*args, **kwargs)
21:52:00 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
21:52:00 treeItem.Configure(*args)
21:52:00 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
21:52:00 return self.executable.Configure(*args)
21:52:00 File "C:\Program Files (x86)\EventGhost\plugins\OpenWeatherMap\__init__.py", line 1374, in Configure
21:52:00 mainSizer.AddGrowableCol(1)
21:52:00 File "wx\_core.pyc", line 15368, in AddGrowableCol
21:52:00 PyAssertionError: C++ assertion "!m_cols || idx < (size_t)m_cols" failed at ..\..\src\common\sizer.cpp(1980) in wxFlexGridSizer::AddGrowableCol(): invalid column index

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: OpenWeatherMap

Post by Pako » Fri Aug 17, 2018 6:36 am

@piert
Unfortunately, so far I have not tried to work with the forecast data.
Here are many options to do.
You can look for inspiration in the ClimateDataCalculation plugin.
If you want to make some charts, then you can use https://www.highcharts.com/ for example.

@HTPCanwender
It looks like you are using EG version 5.
Unfortunately, I can not help you in that case. I'm still using version 4.
I have not installed version 5 so far.

Pako

Medy
Experienced User
Posts: 97
Joined: Sat Nov 15, 2014 8:33 pm
Location: Germany

Re: OpenWeatherMap

Post by Medy » Sat Aug 18, 2018 1:43 am

Do you plan on updating for eventghost 0.5 ?


I just changed to this version because another plugin requires it.
Im using your plugin in a couple of makros & I like the the little UI.


this is the error in EG 5
Traceback (most recent call last) (0.5.0-rc4):
File "C:\EventGhostNEW\plugins\Open Weather Map\__init__.py", line 509, in Create
self.itemHeight = self.lb.GetItemHeight()
AttributeError: 'CheckListBox' object has no attribute 'GetItemHeight'
Traceback (most recent call last) (0.5.0-rc4):
File "C:\EventGhostNEW\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
self.Configure(*args, **kwargs)
File "C:\EventGhostNEW\eg\Classes\ConfigDialog.py", line 106, in Configure
treeItem.Configure(*args)
File "C:\EventGhostNEW\eg\Classes\ActionItem.py", line 80, in Configure
return self.executable.Configure(*args)
File "C:\EventGhostNEW\plugins\Open Weather Map\__init__.py", line 1353, in Configure
mainSizer.AddGrowableCol(1)
File "wx\_core.pyc", line 15368, in AddGrowableCol
PyAssertionError: C++ assertion "!m_cols || idx < (size_t)m_cols" failed at ..\..\src\common\sizer.cpp(1980) in wxFlexGridSizer::AddGrowableCol(): invalid column index

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: OpenWeatherMap

Post by topix » Fri Feb 08, 2019 3:51 pm

Here is a version that works with 0.5 and 0.4.
Attachments
OpenWeatherMap_0.2.egplugin
(18.16 KiB) Downloaded 65 times

gsaundry
Posts: 4
Joined: Wed Feb 13, 2019 4:26 pm

Re: OpenWeatherMap

Post by gsaundry » Thu Jan 23, 2020 6:08 am

Does anyone have a copy of the recent versions of this plugin - one which contains the ability to pull forecasts? (The previous posts are missing their attachments due to the forum issues a while back).

Hoping to get OpenWeatherMap working as a functional replacement to the weather features in SunTracker, since weather.com appears to have made changes which have broken SunTracker's ability to pull data from that site.

Thanks,
Garrett

loveleejohn
Experienced User
Posts: 133
Joined: Thu Dec 10, 2015 12:09 am

Re: OpenWeatherMap

Post by loveleejohn » Fri Jan 24, 2020 8:53 pm

gsaundry wrote:
Thu Jan 23, 2020 6:08 am
Does anyone have a copy of the recent versions of this plugin - one which contains the ability to pull forecasts? (The previous posts are missing their attachments due to the forum issues a while back).

Hoping to get OpenWeatherMap working as a functional replacement to the weather features in SunTracker, since weather.com appears to have made changes which have broken SunTracker's ability to pull data from that site.

Thanks,
Garrett
Here's the copy of it that I have. Hope that helps.
OpenWeatherMap_0.2.egplugin
(18.16 KiB) Downloaded 35 times

gsaundry
Posts: 4
Joined: Wed Feb 13, 2019 4:26 pm

Re: OpenWeatherMap

Post by gsaundry » Thu Jan 30, 2020 3:37 am

Thanks very much - works great :D

omberski
Posts: 2
Joined: Sun Mar 15, 2020 3:41 am

Re: OpenWeatherMap

Post by omberski » Sun Mar 15, 2020 3:53 am

loveleejohn wrote:
Fri Jan 24, 2020 8:53 pm
gsaundry wrote:
Thu Jan 23, 2020 6:08 am
Does anyone have a copy of the recent versions of this plugin - one which contains the ability to pull forecasts? (The previous posts are missing their attachments due to the forum issues a while back).

Hoping to get OpenWeatherMap working as a functional replacement to the weather features in SunTracker, since weather.com appears to have made changes which have broken SunTracker's ability to pull data from that site.

Thanks,
Garrett
Here's the copy of it that I have. Hope that helps.

OpenWeatherMap_0.2.egplugin
It doesn't seem to work for me on 0.5.0-rc6 with the correct city name and city id.
I've been getting <Response [400]> since the first call (never worked). If I remove the API key, I get <Response [401]> which means it can communicate with the server.

Can anyone confirm if this plugin still works?
Attachments
owm.PNG
owm.PNG (3.32 KiB) Viewed 1256 times

Post Reply