winix icon indicating copy to clipboard operation
winix copied to clipboard

Startup Error

Open jhuang0 opened this issue 3 years ago • 6 comments

Hi - any ideas on what might be causing this startup error? I had the earlier December release and updated to the latest... but am now getting this error message.

2021-05-22 23:32:08 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/winix/__init__.py", line 117, in async_setup_platforms
    await self.async_update()
  File "/config/custom_components/winix/__init__.py", line 156, in async_update
    await device.update()
  File "/config/custom_components/winix/WinixDeviceWrapper.py", line 40, in update
    self._state = await self.driver.get_state()
  File "/config/custom_components/winix/WinixDeviceWrapper.py", line 243, in get_state
    payload = json["body"]["data"][0]["attributes"]
KeyError: 'data'

jhuang0 avatar May 23 '21 17:05 jhuang0

It sounds as if Winix server did not return complete json data. The data parsing is based on the work done by https://github.com/hfern/winix. Have you been continuously running into this?

iprak avatar Jun 03 '21 17:06 iprak

So the answer is yes - this was definitely repeatable. I do have a non-code root cause. I had left my machines unplugged for an extended amount of time (weeks... months?) I would get this error message consistently every time I restarted Home Assistant and I believe the components did not load at all. After plugging my devices back in AND restarting Home Assistant, it seems to have fixed the issue.

Ideally, this would not be the case... but I'll leave it in your hands as to whether you document it as a known issue and close it. Thanks for your work on this integration!

jhuang0 avatar Jun 06 '21 17:06 jhuang0

Having the same issue, but in my case only 1 of 2 filters was left unplugged for a few days, the other was on all the time, yet both are not available in HA. Both are on now and I've restarted multiple times, but still neither work.


This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/winix/driver.py:126
Integration: Winix Air Purifier (documentation, issues)
First occurred: 8:18:22 PM (1 occurrences)
Last logged: 8:18:22 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/winix/manager.py", line 100, in async_setup_platforms
    await self.async_update()
  File "/config/custom_components/winix/manager.py", line 139, in async_update
    await device_wrapper.update()
  File "/config/custom_components/winix/device_wrapper.py", line 58, in update
    self._state = await self._driver.get_state()
  File "/config/custom_components/winix/driver.py", line 126, in get_state
    payload = json["body"]["data"][0]["attributes"]
KeyError: 'data'

ILAsoft avatar Oct 10 '21 03:10 ILAsoft

It just seems that no data is being returned by the Winix server. This component is based on the work done by hfern by reverse engineering the calls, so there might be some weird data being returned. I can log a more specific error so we might know what happened but I can't resolve the missing data.

iprak avatar Oct 12 '21 10:10 iprak

Is this perhaps why I'm not able to see the Wind integration as an option? If so, I'll file a more detailed issue.

I'm using HACS on the home-assistant linux docker, confirmed wine folder and files under "custom_components" in the config directory, and have hard reset cache + host computer a bunch of times.

drew-hill avatar Jul 18 '22 18:07 drew-hill

Winix was not available as an integration when this issue was written, 1.0.0 introduced config_flow and made it available as integration from Add Integration. That release also attempts to resolve some starts issues. Winix does not allow simultaneous login from 2 sources and I wonder if that had something to do with what you were seeing.

iprak avatar Jan 05 '23 10:01 iprak