Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weather
#1
Hi all,
Does any of the weather plugins work? If so which one and please, how do I use it, how can I run it and see the information that gets back?
Regards
Reply
#2
A user has updated the weather_adj plugin to use the latest yahoo API. It is now available (as of May 5 2019).

It has not been fully tested yet.

You can read about the API at:
https://developer.yahoo.com/weather/

You will need to sign up for a Consumer Key and Consumer Secret at:
https://login.yahoo.com/config/login?src...Fcreate%2F

The weather Underground API is no longer usable by new users but seems to be usable by those that have an older developer key.
Reply
#3
Thanks Dan, when I fill in all the details AppID etc from yahoo, I get internal server error when I submit. How would I check to see if it is working? Under options I set the location, does it use that to get the weather? If I run it manually I get

pi@SIP:~/SIP/plugins $ sudo python weather_adj.py
Traceback (most recent call last):
  File "weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@SIP:~/SIP/plugins $
Reply
#4
I have GreenIQ V2, SIP works OK after GPIO remap. But when I added new weather plugins, I get these errors:

http://:::80/
Checking rain status...
Exception in thread Thread-1:
Traceback (most recent call last):
 File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
   self.run()
 File "/usr/lib/python2.7/threading.py", line 754, in run
   self.__target(*self.__args, **self.__kwargs)
 File "/home/pi/SIP/plugins/weather_adj.py", line 42, in weather_to_delay
   weather = get_weather_data() if data['weather_provider'] == "yahoo" else get_wunderground_weather_data()
 File "/home/pi/SIP/plugins/weather_adj.py", line 121, in get_weather_data
   app_id = options['xxxxxxxx’].encode('utf-8')
KeyError: 'xxxxxxxx’

When I try select Plugins -> Weather-Based Rain Delay I get „internal server error” and on the console:

Traceback (most recent call last):
 File "/home/pi/SIP/web/application.py", line 239, in process
   return self.handle()
 File "/home/pi/SIP/web/application.py", line 230, in handle
   return self._delegate(fn, self.fvars, args)
 File "/home/pi/SIP/web/application.py", line 423, in _delegate
   return handle_class(cls)
 File "/home/pi/SIP/web/application.py", line 399, in handle_class
   return tocall(*args)
 File "/home/pi/SIP/plugins/weather_adj.py", line 227, in GET
   return template_render.weather_adj(get_weather_options())
 File "/home/pi/SIP/web/template.py", line 1020, in template
   return self._base(t(*a, **kw))
 File "/home/pi/SIP/web/template.py", line 881, in __call__
   return BaseTemplate.__call__(self, *a, **kw)
 File "/home/pi/SIP/web/template.py", line 808, in __call__
   return self.t(*a, **kw)
 File "templates/weather_adj.html", line 64, in __template__
   <td style='text-transform: none;'>$_('Yahoo Consumer Key'):</td>
KeyError: 'yapiappid'
Reply
#5
(2019 May 06, 05:21 AM)esawyja Wrote: Thanks Dan, when I fill in all the details AppID etc from yahoo, I get internal server error when I submit. How would I check to see if it is working? Under options I set the location, does it use that to get the weather? If I run it manually I get

pi@SIP:~/SIP/plugins $ sudo python weather_adj.py
Traceback (most recent call last):
  File "weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@SIP:~/SIP/plugins $

It looks like you are running SIP from the plugins directory. That is why it can't find the urls module (urls.py).
Try running SIP from the SIP directory.
Reply
#6
(2019 May 06, 12:35 PM)marcusp Wrote: I have GreenIQ V2, SIP works OK after GPIO remap. But when I added new weather plugins, I get these errors:

http://:::80/
Checking rain status...
Exception in thread Thread-1:
Traceback (most recent call last):
 File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
   self.run()
 File "/usr/lib/python2.7/threading.py", line 754, in run
   self.__target(*self.__args, **self.__kwargs)
 File "/home/pi/SIP/plugins/weather_adj.py", line 42, in weather_to_delay
   weather = get_weather_data() if data['weather_provider'] == "yahoo" else get_wunderground_weather_data()
 File "/home/pi/SIP/plugins/weather_adj.py", line 121, in get_weather_data
   app_id = options['xxxxxxxx’].encode('utf-8')
KeyError: 'xxxxxxxx’

When I try select Plugins -> Weather-Based Rain Delay I get „internal server error” and on the console:

Traceback (most recent call last):
 File "/home/pi/SIP/web/application.py", line 239, in process
   return self.handle()
 File "/home/pi/SIP/web/application.py", line 230, in handle
   return self._delegate(fn, self.fvars, args)
 File "/home/pi/SIP/web/application.py", line 423, in _delegate
   return handle_class(cls)
 File "/home/pi/SIP/web/application.py", line 399, in handle_class
   return tocall(*args)
 File "/home/pi/SIP/plugins/weather_adj.py", line 227, in GET
   return template_render.weather_adj(get_weather_options())
 File "/home/pi/SIP/web/template.py", line 1020, in template
   return self._base(t(*a, **kw))
 File "/home/pi/SIP/web/template.py", line 881, in __call__
   return BaseTemplate.__call__(self, *a, **kw)
 File "/home/pi/SIP/web/template.py", line 808, in __call__
   return self.t(*a, **kw)
 File "templates/weather_adj.html", line 64, in __template__
   <td style='text-transform: none;'>$_('Yahoo Consumer Key'):</td>
KeyError: 'yapiappid'

Looks like it is not finding a valid user key.

Weather underground does not work any more for new users. You may be able to use the Yahoo API from the weather_adj plugin if you have a valid Consumer Key and Consumer Secret.

The update to the weather_adj plugin was provided by a user and has not bee fully tested.
Reply
#7
Thanks for reply, Dan.
But I get app_id, Consumer key and Consumer secret from Yahoo. I created new yahoo account and copy these data to plugin source code, so its are correct.
Reply
#8
(2019 May 06, 02:55 PM)dan Wrote:
(2019 May 06, 05:21 AM)esawyja Wrote: Thanks Dan, when I fill in all the details AppID etc from yahoo, I get internal server error when I submit. How would I check to see if it is working? Under options I set the location, does it use that to get the weather? If I run it manually I get

pi@SIP:~/SIP/plugins $ sudo python weather_adj.py
Traceback (most recent call last):
  File "weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@SIP:~/SIP/plugins $

It looks like you are running SIP from the plugins directory. That is why it can't find the urls module (urls.py).
Try running SIP from the SIP directory.
Hi Dan,

Still the same
pi@PI:~/SIP $ sudo python plugins/weather_adj.py
Traceback (most recent call last):
  File "plugins/weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@PI:~/SIP $ ls -ltr
total 240
-rw-r--r--  1 pi   pi    1339 May  4 12:18 ReverseProxied.py
-rw-r--r--  1 pi   pi   16259 May  4 12:18 README.md
-rwxr-xr-x  1 pi   pi    6974 May  4 12:18 gpio_pins.py
-rw-r--r--  1 pi   pi    1243 May  4 12:18 i18n.py
-rw-r--r--  1 pi   pi   17517 May  4 12:18 helpers.py
-rw-r--r--  1 pi   pi    3631 May  4 12:18 gv_reference.txt
-rw-r--r--  1 pi   pi    6828 May  4 12:18 gv.py
-rw-r--r--  1 pi   pi    4415 May  4 12:18 pigpiod.sh
lrwxrwxrwx  1 pi   pi       6 May  4 12:18 ospi.py -> sip.py
drwxr-xr-x 14 pi   pi    4096 May  4 12:18 i18n
-rwxr-xr-x  1 pi   pi   11492 May  4 12:18 sip.py
-rw-r--r--  1 pi   pi     652 May  4 12:18 rtcdev.sh
-rwxr-xr-x  1 pi   pi    4637 May  4 12:18 sip.sh
-rw-r--r--  1 pi   pi     317 May  4 12:18 sip.service
drwxr-xr-x  8 pi   pi    4096 May  4 12:18 static
-rw-r--r--  1 pi   pi    1135 May  4 12:18 urls.py
-rw-r--r--  1 pi   pi   21943 May  4 12:18 webpages.py
-rw-r--r--  1 root root  1476 May  4 12:18 i18n.pyc
drwxr-xr-x  4 pi   pi    4096 May  4 12:18 web
-rw-r--r--  1 root root  5973 May  4 12:18 gv.pyc
-rw-r--r--  1 root root 18260 May  4 12:18 helpers.pyc
drwxr-xr-x  2 pi   pi    4096 May  4 12:18 blinker
-rw-r--r--  1 root root  5350 May  4 12:18 gpio_pins.pyc
-rw-r--r--  1 root root  1260 May  4 12:18 urls.pyc
-rw-r--r--  1 root root  1804 May  4 12:18 ReverseProxied.pyc
-rw-r--r--  1 root root  6570 May  4 12:18 sip.pyc
-rw-r--r--  1 root root 23269 May  4 12:18 webpages.pyc
drwxr-xr-x  2 pi   pi    4096 May  6 07:17 templates
drwxr-xr-x  3 pi   pi    4096 May  6 07:18 plugins
drwxr-xr-x  2 pi   pi    4096 May  6 07:19 data
drwxr-xr-x  2 root root  4096 May  7 05:29 sessions
pi@PI:~/SIP $ cat urls.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-

 #### urls is used by web.py. When a GET request is received, the corresponding class is executed.
urls = [
    '/',  'webpages.home',
    '/cv', 'webpages.change_values',
    '/vo', 'webpages.view_options',
    '/co', 'webpages.change_options',
    '/vs', 'webpages.view_stations',
    '/cs', 'webpages.change_stations',
    '/sn', 'webpages.get_set_station',
    '/vr', 'webpages.view_runonce',
    '/cr', 'webpages.change_runonce',
    '/vp', 'webpages.view_programs',
    '/mp', 'webpages.modify_program',
    '/cp', 'webpages.change_program',
    '/dp', 'webpages.delete_program',
    '/ep', 'webpages.enable_program',
    '/vl', 'webpages.view_log',
    '/cl', 'webpages.clear_log',
    '/lo', 'webpages.log_options',
    '/rp', 'webpages.run_now',
    '/ttu', 'webpages.toggle_temp',
    '/rev', 'webpages.show_revision',
    '/wl', 'webpages.water_log',
    '/api/status', 'webpages.api_status',
    '/api/log', 'webpages.api_log',
    '/login', 'webpages.login',
    '/logout', 'webpages.logout',
    '/restart', 'webpages.sw_restart',
    '/rss', 'webpages.rain_sensor_state'
]pi@PI:~/SIP $

I just cannot get this to work.....
Regards
Reply
#9
(2019 May 07, 04:31 AM)esawyja Wrote:
(2019 May 06, 02:55 PM)dan Wrote:
(2019 May 06, 05:21 AM)esawyja Wrote: Thanks Dan, when I fill in all the details AppID etc from yahoo, I get internal server error when I submit. How would I check to see if it is working? Under options I set the location, does it use that to get the weather? If I run it manually I get

pi@SIP:~/SIP/plugins $ sudo python weather_adj.py
Traceback (most recent call last):
  File "weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@SIP:~/SIP/plugins $

It looks like you are running SIP from the plugins directory. That is why it can't find the urls module (urls.py).
Try running SIP from the SIP directory.
Hi Dan,

Still the same
pi@PI:~/SIP $ sudo python plugins/weather_adj.py
Traceback (most recent call last):
  File "plugins/weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@PI:~/SIP $ ls -ltr
total 240
-rw-r--r--  1 pi   pi    1339 May  4 12:18 ReverseProxied.py
-rw-r--r--  1 pi   pi   16259 May  4 12:18 README.md
-rwxr-xr-x  1 pi   pi    6974 May  4 12:18 gpio_pins.py
-rw-r--r--  1 pi   pi    1243 May  4 12:18 i18n.py
-rw-r--r--  1 pi   pi   17517 May  4 12:18 helpers.py
-rw-r--r--  1 pi   pi    3631 May  4 12:18 gv_reference.txt
-rw-r--r--  1 pi   pi    6828 May  4 12:18 gv.py
-rw-r--r--  1 pi   pi    4415 May  4 12:18 pigpiod.sh
lrwxrwxrwx  1 pi   pi       6 May  4 12:18 ospi.py -> sip.py
drwxr-xr-x 14 pi   pi    4096 May  4 12:18 i18n
-rwxr-xr-x  1 pi   pi   11492 May  4 12:18 sip.py
-rw-r--r--  1 pi   pi     652 May  4 12:18 rtcdev.sh
-rwxr-xr-x  1 pi   pi    4637 May  4 12:18 sip.sh
-rw-r--r--  1 pi   pi     317 May  4 12:18 sip.service
drwxr-xr-x  8 pi   pi    4096 May  4 12:18 static
-rw-r--r--  1 pi   pi    1135 May  4 12:18 urls.py
-rw-r--r--  1 pi   pi   21943 May  4 12:18 webpages.py
-rw-r--r--  1 root root  1476 May  4 12:18 i18n.pyc
drwxr-xr-x  4 pi   pi    4096 May  4 12:18 web
-rw-r--r--  1 root root  5973 May  4 12:18 gv.pyc
-rw-r--r--  1 root root 18260 May  4 12:18 helpers.pyc
drwxr-xr-x  2 pi   pi    4096 May  4 12:18 blinker
-rw-r--r--  1 root root  5350 May  4 12:18 gpio_pins.pyc
-rw-r--r--  1 root root  1260 May  4 12:18 urls.pyc
-rw-r--r--  1 root root  1804 May  4 12:18 ReverseProxied.pyc
-rw-r--r--  1 root root  6570 May  4 12:18 sip.pyc
-rw-r--r--  1 root root 23269 May  4 12:18 webpages.pyc
drwxr-xr-x  2 pi   pi    4096 May  6 07:17 templates
drwxr-xr-x  3 pi   pi    4096 May  6 07:18 plugins
drwxr-xr-x  2 pi   pi    4096 May  6 07:19 data
drwxr-xr-x  2 root root  4096 May  7 05:29 sessions
pi@PI:~/SIP $ cat urls.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-

 #### urls is used by web.py. When a GET request is received, the corresponding class is executed.
urls = [
    '/',  'webpages.home',
    '/cv', 'webpages.change_values',
    '/vo', 'webpages.view_options',
    '/co', 'webpages.change_options',
    '/vs', 'webpages.view_stations',
    '/cs', 'webpages.change_stations',
    '/sn', 'webpages.get_set_station',
    '/vr', 'webpages.view_runonce',
    '/cr', 'webpages.change_runonce',
    '/vp', 'webpages.view_programs',
    '/mp', 'webpages.modify_program',
    '/cp', 'webpages.change_program',
    '/dp', 'webpages.delete_program',
    '/ep', 'webpages.enable_program',
    '/vl', 'webpages.view_log',
    '/cl', 'webpages.clear_log',
    '/lo', 'webpages.log_options',
    '/rp', 'webpages.run_now',
    '/ttu', 'webpages.toggle_temp',
    '/rev', 'webpages.show_revision',
    '/wl', 'webpages.water_log',
    '/api/status', 'webpages.api_status',
    '/api/log', 'webpages.api_log',
    '/login', 'webpages.login',
    '/logout', 'webpages.logout',
    '/restart', 'webpages.sw_restart',
    '/rss', 'webpages.rain_sensor_state'
]pi@PI:~/SIP $

I just cannot get this to work.....
Regards

The plugin will not run as a stand alone program. You would need to run SIP and then try to access the plugin from within SIP to get the error from the plugin.

I will try to do some testing here and let you know the result.
Reply
#10
(2019 May 07, 03:09 PM)dan Wrote:
(2019 May 07, 04:31 AM)esawyja Wrote:
(2019 May 06, 02:55 PM)dan Wrote:
(2019 May 06, 05:21 AM)esawyja Wrote: Thanks Dan, when I fill in all the details AppID etc from yahoo, I get internal server error when I submit. How would I check to see if it is working? Under options I set the location, does it use that to get the weather? If I run it manually I get

pi@SIP:~/SIP/plugins $ sudo python weather_adj.py
Traceback (most recent call last):
  File "weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@SIP:~/SIP/plugins $

It looks like you are running SIP from the plugins directory. That is why it can't find the urls module (urls.py).
Try running SIP from the SIP directory.
Hi Dan,

Still the same
pi@PI:~/SIP $ sudo python plugins/weather_adj.py
Traceback (most recent call last):
  File "plugins/weather_adj.py", line 17, in <module>
    from urls import urls  # Get access to SIP's URLs
ImportError: No module named urls
pi@PI:~/SIP $ ls -ltr
total 240
-rw-r--r--  1 pi   pi    1339 May  4 12:18 ReverseProxied.py
-rw-r--r--  1 pi   pi   16259 May  4 12:18 README.md
-rwxr-xr-x  1 pi   pi    6974 May  4 12:18 gpio_pins.py
-rw-r--r--  1 pi   pi    1243 May  4 12:18 i18n.py
-rw-r--r--  1 pi   pi   17517 May  4 12:18 helpers.py
-rw-r--r--  1 pi   pi    3631 May  4 12:18 gv_reference.txt
-rw-r--r--  1 pi   pi    6828 May  4 12:18 gv.py
-rw-r--r--  1 pi   pi    4415 May  4 12:18 pigpiod.sh
lrwxrwxrwx  1 pi   pi       6 May  4 12:18 ospi.py -> sip.py
drwxr-xr-x 14 pi   pi    4096 May  4 12:18 i18n
-rwxr-xr-x  1 pi   pi   11492 May  4 12:18 sip.py
-rw-r--r--  1 pi   pi     652 May  4 12:18 rtcdev.sh
-rwxr-xr-x  1 pi   pi    4637 May  4 12:18 sip.sh
-rw-r--r--  1 pi   pi     317 May  4 12:18 sip.service
drwxr-xr-x  8 pi   pi    4096 May  4 12:18 static
-rw-r--r--  1 pi   pi    1135 May  4 12:18 urls.py
-rw-r--r--  1 pi   pi   21943 May  4 12:18 webpages.py
-rw-r--r--  1 root root  1476 May  4 12:18 i18n.pyc
drwxr-xr-x  4 pi   pi    4096 May  4 12:18 web
-rw-r--r--  1 root root  5973 May  4 12:18 gv.pyc
-rw-r--r--  1 root root 18260 May  4 12:18 helpers.pyc
drwxr-xr-x  2 pi   pi    4096 May  4 12:18 blinker
-rw-r--r--  1 root root  5350 May  4 12:18 gpio_pins.pyc
-rw-r--r--  1 root root  1260 May  4 12:18 urls.pyc
-rw-r--r--  1 root root  1804 May  4 12:18 ReverseProxied.pyc
-rw-r--r--  1 root root  6570 May  4 12:18 sip.pyc
-rw-r--r--  1 root root 23269 May  4 12:18 webpages.pyc
drwxr-xr-x  2 pi   pi    4096 May  6 07:17 templates
drwxr-xr-x  3 pi   pi    4096 May  6 07:18 plugins
drwxr-xr-x  2 pi   pi    4096 May  6 07:19 data
drwxr-xr-x  2 root root  4096 May  7 05:29 sessions
pi@PI:~/SIP $ cat urls.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-

 #### urls is used by web.py. When a GET request is received, the corresponding class is executed.
urls = [
    '/',  'webpages.home',
    '/cv', 'webpages.change_values',
    '/vo', 'webpages.view_options',
    '/co', 'webpages.change_options',
    '/vs', 'webpages.view_stations',
    '/cs', 'webpages.change_stations',
    '/sn', 'webpages.get_set_station',
    '/vr', 'webpages.view_runonce',
    '/cr', 'webpages.change_runonce',
    '/vp', 'webpages.view_programs',
    '/mp', 'webpages.modify_program',
    '/cp', 'webpages.change_program',
    '/dp', 'webpages.delete_program',
    '/ep', 'webpages.enable_program',
    '/vl', 'webpages.view_log',
    '/cl', 'webpages.clear_log',
    '/lo', 'webpages.log_options',
    '/rp', 'webpages.run_now',
    '/ttu', 'webpages.toggle_temp',
    '/rev', 'webpages.show_revision',
    '/wl', 'webpages.water_log',
    '/api/status', 'webpages.api_status',
    '/api/log', 'webpages.api_log',
    '/login', 'webpages.login',
    '/logout', 'webpages.logout',
    '/restart', 'webpages.sw_restart',
    '/rss', 'webpages.rain_sensor_state'
]pi@PI:~/SIP $

I just cannot get this to work.....
Regards

The plugin will not run as a stand alone program. You would need to run SIP and then try to access the plugin from within SIP to get the error from the plugin.

I will try to do some testing here and let you know the result.

After looking at the privacy statement on the Oath/yahoo sign up page I prefer not to sign up for an account. They apparently give themselves the right to read your email, track you location and more.

I am thinking of rolling back the update for the weather_adj plugin.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)