[Resolved] No Key Error

Posted on
Fri Sep 18, 2015 8:39 pm
TheTechnoPilot offline
Posts: 46
Joined: Mar 31, 2014
Location: Montreal, QC, Canada

[Resolved] No Key Error

Hi again Dave,

I guess my exuberance was fairly short lived, the plugin is loading data fine now when I manually refresh it, however when it tries to on its own schedule, the device state is showing "No key." however just hitting refresh now in the plugin menu and it loads the data fine. This is what I am getting on debug medium during the auto reload:

Code: Select all
  WUnderground Debug              Sleeping for 5 seconds.
  WUnderground Debug              callDay() method called.
  WUnderground Debug                callDay: False
  WUnderground Debug              dailyCallLimitReached: 2015-09-18
  WUnderground Debug                Is todays_date: 2015-09-18 greater than dailyCallDay: 2015-09-18?
  WUnderground Debug                  Today is not a new day.
  WUnderground Debug                Has the call limit been reached?
  WUnderground Debug                  The daily call limit has not been reached.
  WUnderground Error              The WUnderground Plugin requires an API Key. See help for details.

Yet when I do Refresh Data Now...:

Code: Select all
  WUnderground Debug              refreshWeatherData() method called.
  WUnderground Debug              callDay() method called.
  WUnderground Debug                callDay: False
  WUnderground Debug              dailyCallLimitReached: 2015-09-18
  WUnderground Debug                Is todays_date: 2015-09-18 greater than dailyCallDay: 2015-09-18?
  WUnderground Debug                  Today is not a new day.
  WUnderground Debug                Has the call limit been reached?
  WUnderground Debug                  The daily call limit has not been reached.
  WUnderground Debug              Parse weather data for device: Environmental - Local Daily Forecast
  WUnderground Debug              pushPluginProps() method called.
  WUnderground Debug              getGlobalProps() method called.
  WUnderground Debug                Device Model: WUnderground Ten Day Forecast
    self.configMenuUnits: M
    self.configWindDirUnits: DEG
    self.configWindSpdUnits: MAX
    self.distanceUnits: 
    self.itemListUiUnits: S
    self.location: pws:IQCLAVAL15
    self.percentageUnits: %
    self.pressureUnits: 
    self.rainAmountUnits:
    self.rainUnits: 
    self.snowAmountUnits:
    self.temperatureUnits: °
    self.weatherSummaryEmail: 
    self.weatherSummaryEmailSent: 
    self.windUnits: 
  WUnderground Debug              getWeatherData() method called.
  WUnderground Debug              Weather Underground URL supressed. Set debug level to [High] to write it to the log.
  WUnderground Debug              Getting weather data for location: pws:IQCLAVAL15
  WUnderground Debug              Adding weather data for pws:IQCLAVAL15 to Master Weather Dictionary.
  WUnderground Debug              callCount() method called.
  WUnderground Debug                498 callsLeft = (500 - 2)
  WUnderground Debug                Daily call limit not yet reached. No problems here.
  WUnderground Debug              parseWeatherTenDay() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              Parse weather data for device: Environmental - Local Hourly Forecast
  WUnderground Debug              pushPluginProps() method called.
  WUnderground Debug              getGlobalProps() method called.
  WUnderground Debug                Device Model: WUnderground Hourly Forecast
    self.configMenuUnits: M
    self.configWindDirUnits: DEG
    self.configWindSpdUnits: AVG
    self.distanceUnits: 
    self.itemListUiUnits: S
    self.location: pws:IQCLAVAL15
    self.percentageUnits: %
    self.pressureUnits: 
    self.rainAmountUnits: 
    self.rainUnits: 
    self.snowAmountUnits: 
    self.temperatureUnits: °
    self.weatherSummaryEmail: 
    self.weatherSummaryEmailSent: 
    self.windUnits: 
  WUnderground Debug              getWeatherData() method called.
  WUnderground Debug              Location already in master weather dictionary.
  WUnderground Debug              parseWeatherHourly() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              functionalHourlyIconName() method called.
  WUnderground Debug              Parse weather data for device: Environmental - Local Weather
  WUnderground Debug              pushPluginProps() method called.
  WUnderground Debug              getGlobalProps() method called.
  WUnderground Debug                Device Model: Weather Underground
    self.configMenuUnits: M
    self.configWindDirUnits: DIR
    self.configWindSpdUnits: AVG
    self.distanceUnits:  mi.
    self.itemListUiUnits: M
    self.location: pws:IQCLAVAL15
    self.percentageUnits: %
    self.pressureUnits:  in.
    self.rainAmountUnits: 
    self.rainUnits:  in.
    self.snowAmountUnits: 
    self.temperatureUnits: °C
    self.weatherSummaryEmail:
    self.weatherSummaryEmailSent: False
    self.windUnits:  mph
  WUnderground Debug              getWeatherData() method called.
  WUnderground Debug              Location already in master weather dictionary.
  WUnderground Debug              parseWeatherData() method called.
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              itemListTemperatureFormat() method called.
  WUnderground Debug                Temperature precision: 1
  WUnderground Debug                Returning value unchanged.
  WUnderground Debug              functionalIconName() method called.
  WUnderground Debug              Day Night Icon: nt_clear
  WUnderground Debug              All Day Icon: clear
  WUnderground Debug              fixPressureSymbol() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              uiTemperatureFormat() method called.
  WUnderground Debug                uiTempDecimal: 1
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              fixCorruptedData() method called.
  WUnderground Debug              parseAlerts() method called.
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              uiHumidityFormat() method called.
  WUnderground Debug                uiHumidityDecimal: 0
  WUnderground Debug              Locations Polled: [u'pws:IQCLAVAL15']
  Weather Underground cycle complete.

Any ideas why this might be happening?

Android's Tasker, to a person who does home automation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

Posted on
Sat Sep 19, 2015 4:57 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: No Key Error

TheTechnoPilot wrote:
Hi again Dave,

I guess my exuberance was fairly short lived, the plugin is loading data fine now when I manually refresh it, however when it tries to on its own schedule, the device state is showing "No key." however just hitting refresh now in the plugin menu and it loads the data fine.

Dang. Thought we had you going.

This message is the important one:
Code: Select all
WUnderground Error              The WUnderground Plugin requires an API Key. See help for details.
The message will appear under the following four circumstances:
    1. If you try to close the plugin configuration dialog box when the API key field is completely empty.
    2. If you've asked for a complete dump of weather data to the log (and the API key field is completely empty or set to the default value of "API Key".)
    3. If you've asked for a weather refresh (and the API key field is completely empty or set to the default value of "API Key".)
    4. If the plugin has asked for it's own refresh (and the API key field is completely empty or set to the default value of "API Key".)

I believe yours is the fourth one. The only reason that the error message would print is if the API key field is empty or literally set to "API Key".

Here is the relevant code block from the main plugin section:
Code: Select all
api_key = self.pluginPrefs.get('apiKey', '')

if api_key == "" or api_key == "API Key":
    dev.updateStateOnServer('onOffState', value=False, uiValue="No key.")
    self.errorLog(u"The WUnderground Plugin requires an API Key. See help for details.")
    self.sleep(sleep_time-5)

and here is the relevant code block from the refresh weather section:
Code: Select all
api_key = self.pluginPrefs.get('apiKey', '')

if api_key == "" or api_key == "API Key":
    dev.updateStateOnServer('onOffState', value=False, uiValue="No key.")
    self.errorLog(u"The WUnderground Plugin requires an API Key. See help for details.")
    self.sleep(sleep_time-5)

The code blocks are identical, so they should work in the same way. However, all is not lost. Please turn debug to high, let the plugin try to refresh the data on its own, and PM the result to me. If we can't find it from there, I'll prepare a special plugin for you to run with some additional logging built in to help us isolate the problem.

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Sep 21, 2015 7:01 pm
TheTechnoPilot offline
Posts: 46
Joined: Mar 31, 2014
Location: Montreal, QC, Canada

Re: No Key Error

Hi Dave,

So in an effort to combat this before you responded, I tried the following which actually cleared the issue and the plugin has been updating seamlessly since.

I first restarted Indigo again to see if this fixed the problem - it didn't

I then reloaded the plugin within Indigo and after this, opened the configuration cut the API key, tried to close it, it errored saying there was no key. So I pasted the key back, closed the config and it has worked ever since.

Don't ask me why it then has worked without error, but it has.

Sent from my SM-N910W8 using Tapatalk

Android's Tasker, to a person who does home automation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

Posted on
Mon Sep 21, 2015 7:51 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: No Key Error

TheTechnoPilot wrote:
Don't ask me why it then has worked without error, but it has.

Glad to hear that you are back in business. I need to think through how your steps could've cleared the error, and I'll take another look at the code surrounding how the key value is evaluated. On the face, cutting the value and pasting back into the field shouldn't change the contents of the data itself.

In any event, sorry if there was anything that I could've done to prevent this from happening in the first place. Enjoy!
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Sep 21, 2015 7:52 pm
TheTechnoPilot offline
Posts: 46
Joined: Mar 31, 2014
Location: Montreal, QC, Canada

Re: No Key Error

No need to apologize, I just hope what I did helps you to trace the odd bug to refine your awesome plugin further.

Sent from my SM-N910W8 using Tapatalk

Android's Tasker, to a person who does home automation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

Posted on
Mon Sep 21, 2015 8:12 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: No Key Error

TheTechnoPilot wrote:
No need to apologize, I just hope what I did helps you to trace the odd bug to refine your awesome plugin further.

Sent from my SM-N910W8 using Tapatalk

You're too kind.

Cheers!
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests