initialstate/wunderground-sensehat

Error running sensehat_wunderground.py

Closed this issue · 6 comments

I receive an error when running sensehat_wunderground.py.
Traceback (most recent call last):
File "sensehat_wunderground.py", line 196, in
main()
File "sensehat_wunderground.py", line 138, in main
streamer.log(":house: Location",conditions['current_observation']['display_location']['full'])
KeyError: 'current_observation'

I also receive I also receive a similar error in line 131 of underground.py when this is ran.

Thank you
Perry Cannon

Perry,

That error typically occurs if you don’t have a location specified that Wunderground recognizes. If the location is good, a bad API key entry is the next likely culprit.

To figure out if either is the issue, use this url in your web browser (filing in the API key and location fields):
http://api.wunderground.com/api/YOUR_API_KEY/conditions/q/THE_DESIRED_STATE/THE_DESIRED_CITY.json

For example, using an existing API key and viewing London, UK, the URL is:
http://api.wunderground.com/api/0def10027afaebb7/conditions/q/UK/London.json

When entered into the browser, you should get a valid response returned. What is your location? Let me know if this helps.

Jamie Bailey
Founder/CEO
Initial State

tel 859-475-3291

On Jan 2, 2016, at 1:55 AM, perrycannon notifications@github.com wrote:

I receive an error when running sensehat_wundergroundpy
Traceback (most recent call last):
File "sensehat_wundergroundpy", line 196, in
main()
File "sensehat_wundergroundpy", line 138, in main
streamerlog(" Location",conditions['current_observation']['display_location']['full'])
KeyError: 'current_observation'

I also receive I also receive a similar error in line 131 of undergroundpy when this is ran

Thank you
Perry Cannon


Reply to this email directly or view it on GitHub #1.

Thank you for your help. I had extra characters on my wunderground key. I copied the same string from one program to the next. I had the same mistake in two places.

I live and work in Japan. I work at Camp Zama Army base as a US Government employee.

I would like to use my city Ayase-shi. I don't know how to enter the City name with a dash in the program.

Thank you for your help.
Perry

On Jan 2, 2016, at 10:53 PM, jrbail01 notifications@github.com wrote:

Perry,

That error typically occurs if you don’t have a location specified that Wunderground recognizes. If the location is good, a bad API key entry is the next likely culprit.

To figure out if either is the issue, use this url in your web browser (filing in the API key and location fields):
http://api.wunderground.com/api/YOUR_API_KEY/conditions/q/THE_DESIRED_STATE/THE_DESIRED_CITY.json

For example, using an existing API key and viewing London, UK, the URL is:
http://api.wunderground.com/api/0def10027afaebb7/conditions/q/UK/London.json

When entered into the browser, you should get a valid response returned. What is your location? Let me know if this helps.

Jamie Bailey
Founder/CEO
Initial State

tel 859-475-3291

On Jan 2, 2016, at 1:55 AM, perrycannon notifications@github.com wrote:

I receive an error when running sensehat_wundergroundpy
Traceback (most recent call last):
File "sensehat_wundergroundpy", line 196, in
main()
File "sensehat_wundergroundpy", line 138, in main
streamerlog(" Location",conditions['current_observation']['display_location']['full'])
KeyError: 'current_observation'

I also receive I also receive a similar error in line 131 of undergroundpy when this is ran

Thank you
Perry Cannon


Reply to this email directly or view it on GitHub #1.


Reply to this email directly or view it on GitHub.

Perry,

I couldn’t find a listing for Ayase-shi on Wunderground either. I am not sure why Wunderground has no listing for Ayase-shi.

However, I did find Atsugi, Japan using:
http://api.wunderground.com/api/0def10027afaebb7/conditions/q/JP/Atsugi.json

I could also get a listing for Zama, Japan using:
http://api.wunderground.com/api/0def10027afaebb7/conditions/q/JP/Zama.json

I could also get a listing for Fujisawa, Japan using:
http://api.wunderground.com/api/0def10027afaebb7/conditions/q/JP/Fujisawa.json

Let me know if that helps.

Jamie Bailey
Founder/CEO
Initial State

tel 859-475-3291

On Jan 2, 2016, at 11:29 PM, perrycannon notifications@github.com wrote:

Thank you for your help. I had extra characters on my wunderground key. I copied the same string from one program to the next. I had the same mistake in two places.

I live and work in Japan. I work at Camp Zama Army base as a US Government employee.

I would like to use my city Ayase-shi. I don't know how to enter the City name with a dash in the program.

Thank you for your help.
Perry

On Jan 2, 2016, at 10:53 PM, jrbail01 notifications@github.com wrote:

Perry,

That error typically occurs if you don’t have a location specified that Wunderground recognizes. If the location is good, a bad API key entry is the next likely culprit.

To figure out if either is the issue, use this url in your web browser (filing in the API key and location fields):
http://api.wunderground.com/api/YOUR_API_KEY/conditions/q/THE_DESIRED_STATE/THE_DESIRED_CITY.json

For example, using an existing API key and viewing London, UK, the URL is:
http://api.wunderground.com/api/0def10027afaebb7/conditions/q/UK/London.json

When entered into the browser, you should get a valid response returned. What is your location? Let me know if this helps.

Jamie Bailey
Founder/CEO
Initial State

tel 859-475-3291

On Jan 2, 2016, at 1:55 AM, perrycannon notifications@github.com wrote:

I receive an error when running sensehat_wundergroundpy
Traceback (most recent call last):
File "sensehat_wundergroundpy", line 196, in
main()
File "sensehat_wundergroundpy", line 138, in main
streamerlog(" Location",conditions['current_observation']['display_location']['full'])
KeyError: 'current_observation'

I also receive I also receive a similar error in line 131 of undergroundpy when this is ran

Thank you
Perry Cannon


Reply to this email directly or view it on GitHub #1.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #1 (comment).

I have the same issue as listed before but I realize that Underground API works fine just if there is no duplicate city names. In my case, I choose city = Toronto, State = ON (Ontario) and I got an answer with 6 Toronto cities ... 5 in USA and just 1 in Canada. How can I improve the script to get correct one? Should I use azimuth ?

Regards,

Edison

Edison,

I am trying to figure this one out myself. Still looking and will update you as soon as I figure out how to make it work for Ontario.

Edison, I am sorry for the delay. I finally figured out how to get Toronto to show properly. You need city = Toronto and state = canada (e.g. http://api.wunderground.com/api/0def10027afaebb7/conditions/q/canada/Toronto.json).