sampsyo / hass-smartthinq

Home Assistant component for LG SmartThinQ HVAC devices
MIT License
281 stars 98 forks source link

smartthinq: Error on device update! #71

Closed mihail4anov closed 3 years ago

mihail4anov commented 3 years ago

Getting this error all the time. Only new token fixes this, but after a while I am getting the error again:

Logger: homeassistant.components.climate Source: custom_components/smartthinq/climate.py:256 Integration: Климат (documentation, issues) First occurred: 21:39:11 (1 occurrences) Last logged: 21:39:11

smartthinq: Error on device update! 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 211, in lgedm_post raise API_ERRORS[code](code, message) wideq.core.NotConnectedError: ('0106', '장치가 접속중이 아닙니다.')

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

But I can control the AC by the LG ThinQ app after the error.

mihail4anov commented 3 years ago

Usage of one of my old tokens does not help. It seems that a new token works only for 24 hours. But maybe I am wrong.