hass-smartthinq: smartthinq: Error on device update! (self._ac.get_power())

Seems like latest update broke integration with my AC. I’m getting the following in the logs:

Traceback (most recent call last):
  File "/config/custom_components/smartthinq/climate.py", line 252, in check_power
    power = self._ac.get_power()
  File "/usr/local/lib/python3.7/site-packages/wideq/ac.py", line 299, in get_power
    value = self._get_config('InOutInstantPower')
  File "/usr/local/lib/python3.7/site-packages/wideq/client.py", line 433, in _get_config
    key,
  File "/usr/local/lib/python3.7/site-packages/wideq/core.py", line 492, in get_device_config
    'data': '',
  File "/usr/local/lib/python3.7/site-packages/wideq/core.py", line 394, in post
    return lgedm_post(url, data, self.auth.access_token, self.session_id)
  File "/usr/local/lib/python3.7/site-packages/wideq/core.py", line 213, in lgedm_post
    raise APIError(code, message)
wideq.core.APIError: ('0111', '제품 응답 지연')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 319, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    self.update  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/smartthinq/climate.py", line 283, in update
    self.check_power()
  File "/config/custom_components/smartthinq/climate.py", line 256, in check_power
    except wideq.InvalidRequestError:
NameError: name 'wideq' is not defined

Looks like import wideq is missing in that method.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 27 (3 by maintainers)

Commits related to this issue

Most upvoted comments

As a temporary workaround you may try this. Open climate.py and find the function called check_power (aprox. line 244). After the following lines:

        except wideq.InvalidRequestError:
            LOGGER.info('Power consumption not available.')
            self._has_power = False

Add this:

        except wideq.APIError:
            LOGGER.info('Power consumption not available.')
            self._has_power = False

Save the file and reboot HA. Mind the intendation! Use spaces only, not tabs. This edit will mute all APIErrors in that function. But I guess things should be fixed somewhere in wideq. Also, I’m not sure what this 0111 “Product response delay” error actually means. My AC should report power consumption afair.

The same problem with wideq.core.APIError: (‘0111’, ‘제품 응답 지연’) but climate.ac_name may work or not.

I use 2 identical LG ACs and could not understand the reason for the error. After restart HA/wifi/AC this problem can be solved… or not.

Full log: 2020-07-21 20:56:54 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.spalnia is taking over 10 seconds 2020-07-21 20:56:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.spalnia fails Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 279, in async_update_ha_state await self.async_device_update() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 472, in async_device_update await self.hass.async_add_executor_job(self.update) File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run result = self.fn(*self.args, **self.kwargs) File “/config/custom_components/smartthinq/climate.py”, line 285, in update self.check_power() File “/config/custom_components/smartthinq/climate.py”, line 254, in check_power power = self._ac.get_power() File “/usr/local/lib/python3.7/site-packages/wideq/ac.py”, line 299, in get_power value = self._get_config(‘InOutInstantPower’) File “/usr/local/lib/python3.7/site-packages/wideq/client.py”, line 433, in _get_config key, File “/usr/local/lib/python3.7/site-packages/wideq/core.py”, line 492, in get_device_config ‘data’: ‘’, File “/usr/local/lib/python3.7/site-packages/wideq/core.py”, line 394, in post return lgedm_post(url, data, self.auth.access_token, self.session_id) File “/usr/local/lib/python3.7/site-packages/wideq/core.py”, line 213, in lgedm_post raise APIError(code, message) wideq.core.APIError: (‘0111’, ‘제품 응답 지연’)

I am from Butovo too) The reason of the problem is terrible ping to LG servers. Do this (https://github.com/sampsyo/hass-smartthinq/issues/70#issuecomment-660617040) to solve the problem. It helps me)

@mihail4anov, thanks, this was missing a check. (A bug introduced in #21.)