Amir974 / home-assistant-custom-components

custom components for home-assistant.io project I made for personal use...
Apache License 2.0
8 stars 6 forks source link

async_setup_platform error #1

Open larizzo opened 7 years ago

larizzo commented 7 years ago

I'm trying to setup this custom component but I'm getting the below error, I think it might be related to this new PR 6127 that was released or could be something else I'm doing wrong. Any help is appreciated.

Using HASS 0.39

Error log:

7-02-26 22:10:32 INFO (MainThread) [homeassistant.loader] Loaded climate.sensibosettingsandswitch from custom_components.climate.sensibosettingsandswitch
17-02-26 22:10:32 INFO (MainThread) [homeassistant.bootstrap] Setting up climate
17-02-26 22:10:32 INFO (MainThread) [homeassistant.components.climate] Setting up climate.sensibosettingsandswitch
17-02-26 22:10:32 INFO (Thread-12) [custom_components.climate.sensibosettingsandswitch] Initialized Sensibo CLIMATE Home
17-02-26 22:10:33 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform sensibosettingsandswitch
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "uvloop/future.pyx", line 230, in __iter__ (uvloop/loop.c:110600)
  File "uvloop/future.pyx", line 432, in uvloop.loop.BaseTask._fast_wakeup (uvloop/loop.c:113980)
  File "uvloop/future.pyx", line 101, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108900)
  File "/usr/local/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/climate/sensibosettingsandswitch.py", line 89, in setup_platform
    None, 99, None, "auto", None, my_target_temp_high, my_target_temp_low, my_api_key, my_min_temp, my_max_temp)
  File "/config/custom_components/climate/sensibosettingsandswitch.py", line 132, in __init__
    self.update()
  File "/config/custom_components/climate/sensibosettingsandswitch.py", line 149, in update
    current_settings = client.pod_ac_state(uid)
  File "/config/custom_components/climate/sensibosettingsandswitch.py", line 47, in pod_ac_state
    return result['result'][0]['acState']
IndexError: list index out of range
Amir974 commented 7 years ago

Thanks for the head's up @larizzo I myself have yet to update to 39 (I try to do these things closer to the weekend following a release so I'd have time dealing with issues such as this...)

I've seen an increase in log errors coming in from Sensibo in the past few days and I have an open ticket with them to check if this may be related to something in the platform - although it can very well be something that happened in one of the recent updates that broke compatibility.

Until I have time to dive deeper into this (probably on this weekend) I can suggest a few things you may want to try yourself:

# example log lines I would add in some strategic places in the code
        _LOGGER.debug("Sensibo CLIMATE client = %s", str(client))
        _LOGGER.debug("Sensibo CLIMATE devices = %s", str(devices))
        _LOGGER.debug("Sensibo CLIMATE uid = %s", uid)

Also be sure to add the following to the configuration file if you do:

logger:
...
..logs:...
    custom_components.climate.sensibosettingsandswitch: debug 
    custom_components.climate.sensibosettingsonly: debug

If you find some more details about this problem I'd appreciate any update, and If you don't have time to dive deeper I'll try to tackle it in the coming days.

Amir974 commented 7 years ago

Are you still seeing this issue? is it consistent and does it mean that the component does not work of partially works for you?

I am going to need more date (Mine seems to work as usual... after upgrade)

larizzo commented 7 years ago

Hi sorry, I never got back to you. I end up getting it working, I had to put a different API key for each component I'm using. I didn't realize this is need from the docs or maybe it's not even that the issue and it was fixed by me doing something else. Either way, it looks good, thanks for this component!

EDIT: Just realized you are the guy from the BRUH youtube videos, keep up the good work. I'm enjoying those videos.