Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to Dyson Pure Cool Link TP02 purifying fan (White/Silver) #86

Open
Agile-Travel opened this issue Nov 5, 2023 · 15 comments

Comments

@Agile-Travel
Copy link

Agile-Travel commented Nov 5, 2023

It is discovered using my cloud account, and I've identified the IP address via an IP Scanner (has name matching serial # so sure that is correct IP).

I get the error:
Failed to connect. The IP Address may be required if your Home Assistant installation is running in a Container or a VM.

No complicated networking or firewalls in between.

image

I've also tried getting my credentials manually and using manual setup, but still can't connect.

Is the Dyson Pure Cool Link TP02 supported?

@dotvezz
Copy link
Contributor

dotvezz commented Nov 9, 2023

Hi @Agile-Travel! Sorry for the slow reply. The TP02 is supported, but you're not the only person who has reported issues with it in the past few weeks. Are you able to enable debug logging for the integration, then re-attempt connection to the device? That would be awesome!

Let me know if you would like any more info for debug logging.

@charlesomer
Copy link

I believe I may have the same issue with a HP04, the debug logs just show:

2023-11-19 02:02:23.276 DEBUG (MainThread) [custom_components.dyson_local.config_flow] Failed to connect to device: 

@SungFeng-Huang
Copy link

I have a similar issue with my HP04, while the error message shows "unknown error occurred" and the debug logs are as follow:

2023-11-19 01:58:38.597 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 422, in _async_handle_step
    result = await self.async_finish_flow(flow, result.copy())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 978, in async_finish_flow
    title=result["title"],
          ~~~~~~^^^^^^^^^
KeyError: 'title'

@charlesomer
Copy link

Just tried again and it worked... 🤷‍♂️ No idea why though

@ufu-
Copy link

ufu- commented Nov 23, 2023

I have the same issue with my Dyson Pure Hot+Cold ( Device model 527 ). Dyson app works and I can ping the address but it looks like setup times out. I have tried config flow and manual setup as well as moving the device in different subnets to no avail.
As per what charlesomer posted all I get with debug logging enabled :
"2023-11-23 10:20:02.347 DEBUG (MainThread) [custom_components.dyson_local.config_flow] Failed to connect to device:"
Nothing after the ":" .

Thanks

@dotvezz
Copy link
Contributor

dotvezz commented Nov 26, 2023

It feels like something has changed. The past few weeks people have been having difficult-to-reproduce errors with a wide variety of Dyson Fan devices. One thing clear to me is this: I need to improve the error logging to make this easier to reproduce.

I'll get a release out that improves logging, hopefully we can find an answer for you all soon!

@dotvezz
Copy link
Contributor

dotvezz commented Nov 28, 2023

Okay, better logging is still forthcoming, but in the meantime I wonder if the new release happens to have improved the situation. @ufu- @SungFeng-Huang @Agile-Travel any changes after updating?

@dotvezz
Copy link
Contributor

dotvezz commented Dec 2, 2023

I've also released the logging improvement in v1.3.4. If you happen to have time, please update then enable debug logging so we can get a clearer picture of what's happening.

Thanks!

@Agile-Travel
Copy link
Author

Thanks so much for working on this plugin and this issue.

Here is the updated error when on 1.3.4:

2023-12-02 20:01:37.471 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/config/custom_components/dyson_local/config_flow.py", line 400, in _async_try_connect
device.connect(host)
File "/config/custom_components/dyson_local/vendor/libdyson/dyson_device.py", line 115, in connect
raise DysonConnectTimeout
custom_components.dyson_local.vendor.libdyson.exceptions.DysonConnectTimeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dyson_local/config_flow.py", line 309, in async_step_host
data = await self._async_get_entry_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dyson_local/config_flow.py", line 358, in _async_get_entry_data
await self._async_try_connect(serial, credential, device_type, host)
File "/config/custom_components/dyson_local/config_flow.py", line 404, in _async_try_connect
_LOGGER.debug(f"Failed to connect to device: {err.name}, {err}")
^^^^^^^^^^^^
AttributeError: 'DysonConnectTimeout' object has no attribute 'name'

@dotvezz
Copy link
Contributor

dotvezz commented Dec 18, 2023

@Agile-Travel wow I could have sworn I'd already replied here. I owe you an apology.

In your logs, you're getting DysonConnectTimeout with a whole bunch of noise. The noise is my fault for trying to log the error incorrectly (I fixed that in 1.3.5 lol).

DysonConnectTimeout means that the fan is not acknowledging the connection attempt. This is the first time I've seen that behavior for the TP02, which is frustrating. There isn't much we can do unfortunately. Can you unplug and plug-in your device, then try to connect again?

@SungFeng-Huang
Copy link

Okay, better logging is still forthcoming, but in the meantime I wonder if the new release happens to have improved the situation. @ufu- @SungFeng-Huang @Agile-Travel any changes after updating?

Problem solved in v1.3.6! Thanks @dotvezz!

@Agile-Travel
Copy link
Author

Agile-Travel commented Dec 19, 2023 via email

@codyc1515
Copy link
Contributor

How did you get on with this?

@ufu-
Copy link

ufu- commented Jan 12, 2024

I hope this will help some of you; I had the issue for quite a long time and nothing seemed to solve it: I kept getting time out errors, and if I checked the IP address it would respond to pings, but the MQTT port seemed close or unavailable ( 1883/TCP ).
Finally the solution was to factory reset the unit ( simultaneously hold power on both the unit and the remote for 10 seconds while the device is on ) and re-connect it to wifi and it started to work instantly.

@Geoff47
Copy link

Geoff47 commented Mar 3, 2024

Hi,

I can't connect my HP04 too. It worked fine two month ago.... I treid to factory reset and re-add the HP04 on my mobile app several times but can't detect on homeassitant.
Here the debug logs :

Logger: homeassistant.config_entries
Source: config_entries.py:605
First occurred: 18:17:17 (1 occurrences)
Last logged: 18:17:17
Error unloading entry MyDyson: [email protected] (FR) for dyson_local

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 605, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dyson_local/init.py", line 187, in async_unload_entry
device = hass.data[DOMAIN][DATA_DEVICES][entry.entry_id]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'a5a9de0eb6a03cadcc3adff98e121a9a'

Thanks for some help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants