bpaauwe / udi-apixu-poly

Other
0 stars 0 forks source link

Exception in thread controller #1

Open ToddLorey opened 4 years ago

ToddLorey commented 4 years ago

Hi, This might be a bit premature, but I was trying to install some new test polyglot nodes on my new Polisy. Seems like there might be an issue with this node on the Polisy, or maybe it's a change in their API. Here's the log file after a startup. Hope it helps! No big crisis in fixing this. I was just testing but I thought you'd like to know.

`2019-10-31 13:57:13,456 [MainThread] [INFO ] UDI Polyglot v2 Interface 2.0.31 Starting... 2019-10-31 13:57:14,006 [Interface ] [INFO ] Connecting to MQTT... localhost:1883 2019-10-31 13:57:14,044 [Interface ] [INFO ] MQTT Connected with result code 0 (Success) 2019-10-31 13:57:14,046 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/ns/2 - MID: 1 Result: 0 2019-10-31 13:57:14,047 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2019-10-31 13:57:14,048 [Interface ] [INFO ] Sent Connected message to Polyglot 2019-10-31 13:57:14,269 [NodeServer] [INFO ] Starting node server 2019-10-31 13:57:14,270 [NodeServer] [INFO ] Add node for forecast 2019-10-31 13:57:14,273 [NodeServer] [INFO ] Adding node Forecast 1(forecast_1) 2019-10-31 13:57:14,415 [NodeServer] [INFO ] Adding node Forecast 2(forecast_2) 2019-10-31 13:57:14,419 [NodeServer] [INFO ] Adding node Forecast 3(forecast_3) 2019-10-31 13:57:14,424 [NodeServer] [INFO ] Adding node Forecast 4(forecast_4) 2019-10-31 13:57:14,429 [NodeServer] [INFO ] Adding node Forecast 5(forecast_5) 2019-10-31 13:57:14,433 [NodeServer] [INFO ] Adding node Forecast 6(forecast_6) 2019-10-31 13:57:14,436 [NodeServer] [INFO ] Sending customParams to Polyglot. 2019-10-31 13:57:14,439 [NodeServer] [INFO ] api id = xxxxxxx 2019-10-31 13:57:14,440 [NodeServer] [INFO ] Configure drivers --- 2019-10-31 13:57:14,441 [NodeServer] [INFO ] Write new node definitions and publish to ISY 2019-10-31 13:57:14,444 [NodeServer] [INFO ] profile: Writing profile/nodedef/nodedef.xml 2019-10-31 13:57:14,449 [NodeServer] [INFO ] write_profile_zip: profile/version.txt as version.txt 2019-10-31 13:57:14,453 [NodeServer] [INFO ] write_profile_zip: profile/editor/editors.xml as editor/editors.xml 2019-10-31 13:57:14,458 [NodeServer] [INFO ] write_profile_zip: profile/nls/en_us.txt as nls/en_us.txt 2019-10-31 13:57:14,462 [NodeServer] [INFO ] write_profile_zip: profile/nodedef/nodedef.xml as nodedef/nodedef.xml 2019-10-31 13:57:14,465 [NodeServer] [INFO ] profile: done. 2019-10-31 13:57:14,465 [NodeServer] [INFO ] Sending Install Profile command to Polyglot. 2019-10-31 13:57:14,469 [NodeServer] [INFO ] Node server started 2019-10-31 13:57:14,470 [NodeServer] [DEBUG] request = https://api.apixu.com/v1/current.json?key=xxxxxxxxxx&q=36.9,-121.8 2019-10-31 13:57:14,865 [NodeServer] [DEBUG] {'0': '#################################################################################################################################', '1': '# #', '2': '# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT #', '3': '# #', '4': '# This API endpoint is deprecated and has now been shut down. To keep using the apixu API, please update your integration #', '5': '# to use the new weatherstack API endpoint, designed as a simple drop-in replacement. #', '6': '# You will be required to create an account at https://weatherstack.com and obtain an API access key. #', '7': '# #', '8': '# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/apilayer/weatherstack#readme #', '9': '# #', 'a': '#################################################################################################################################'} 2019-10-31 13:57:14,874 [NodeServer] [ERROR] Exception in thread NodeServer: Traceback (most recent call last): File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/lib/python3.7/threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "./apixu.py", line 104, in start self.query_conditions(True) File "./apixu.py", line 166, in query_conditions self.setDriver('CLITEMP', float(jdata['current']['temp_f']), True, force) KeyError: 'current' 2019-10-31 13:59:14,184 [Controller] [DEBUG] request = https://api.apixu.com/v1/current.json?key=xxxxxxxxxx&q=36.9,-121.8 2019-10-31 13:59:14,757 [Controller] [DEBUG] {'0': '#################################################################################################################################', '1': '# #', '2': '# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT #', '3': '# #', '4': '# This API endpoint is deprecated and has now been shut down. To keep using the apixu API, please update your integration #', '5': '# to use the new weatherstack API endpoint, designed as a simple drop-in replacement. #', '6': '# You will be required to create an account at https://weatherstack.com and obtain an API access key. #', '7': '# #', '8': '# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/apilayer/weatherstack#readme #', '9': '# #', 'a': '#################################################################################################################################'} 2019-10-31 13:59:14,761 [Controller] [ERROR] Exception in thread Controller: Traceback (most recent call last): File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/lib/python3.7/threading.py", line 870, in run self._target(self._args, **self._kwargs) File "/var/polyglot/.local/lib/python3.7/site-packages/polyinterface/polyinterface.py", line 775, in _parseInput self.shortPoll() File "./apixu.py", line 108, in shortPoll self.query_conditions(False) File "./apixu.py", line 166, in query_conditions self.setDriver('CLITEMP', float(jdata['current']['temp_f']), True, force) KeyError: 'current'

`
bpaauwe commented 4 years ago

The API is going away (or maybe has gone away at this point) and is being replaced with a new API at WeatherStack. The WeatherStack API is different so it's not just a matter of replacing the URL. I've started looking at creating a new node server for the WeatherStack API, but it has significantly less features than the APIUX API does.

Sounds like it's time to retire this node server. I guess I need to figure out how to do that.

ToddLorey commented 4 years ago

Makes sense. No worries. I have just been looking for a better weather forecast than Darksky seems to have. They are pretty unreliable in the very near term for precip forecasting. At least here in NorCal!