shenxn / ha-dyson

HomeAssitant custom integration for dyson
MIT License
307 stars 59 forks source link

Local Dyson integration returns failed to connect #94

Open HuguesD opened 2 years ago

HuguesD commented 2 years ago

I do not succeed to make the local Dyson integration work. I have retrieved the device credentials and serial number from the python script ok. But in the integration UI, after entering serial number, credential and device type, it show failed to connect.

My device type is 438E (it is a TP09 purifier formaldehyde). Isn't this device type supported ?

MarcusKapun commented 2 years ago

Same issue here, but with Cool + Humidify device.

Fulg commented 2 years ago

Same here with a PH03 (device type 358E, sadly the same as PH04). If I enable the debug log in HA for this integration, this is what I get (serial number redacted):

...
2022-02-09 13:49:46 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:46 INFO (MainThread) [libdyson.dyson_device] Connected to device xxx-CA-xxxxxxxx
2022-02-09 13:49:46 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:48 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:48 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:50 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:50 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:51 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:51 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:53 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:53 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:54 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:54 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:56 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:56 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:49:58 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:49:58 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:50:00 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:50:00 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:50:02 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:50:02 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:50:03 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:50:03 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:50:05 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:50:05 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:50:06 DEBUG (Thread-8) [libdyson.dyson_device] Connected with result code 0
2022-02-09 13:50:06 DEBUG (Thread-8) [libdyson.dyson_device] Disconnected with result code 7
2022-02-09 13:50:07 DEBUG (MainThread) [custom_components.dyson_local.config_flow] Failed to connect to device:
...

Note that there is nothing after the "failed to connect" message, I did not cut off the message (and I did specify the fan's IP address explicitly, but not putting an address changes nothing to the log output). I looked at the libdyson source but I haven't figured out what return code 7 might be yet.

t0ny-peng commented 2 years ago

@Fulg I'm seeing exactly the same error as yours.

sersol-ai commented 2 years ago

Same thing, failed to connect, Device Type: 358E, Dyson Purifier Humidify + Cool, 2021 MY. MQTT port 1883 seems to be open on the device IP.

LunchboxNYC commented 2 years ago

I hate to pile on but experiencing the same issue, have them working in Homebridge, but get this error when I try and set them up in HA using this plugin.

Anto79-ops commented 2 years ago

I believe the issue for discussion here is that the OP cannot get his Dyson Pure Hot+Cool Formaldehyde (TP09) to integrate with the new version of the script. If so, I have the same issue, with my TP09 purifier formaldehyde (Dyson Pure Hot+Cool Formaldehyde). With the right credentials and password and the latest version that supports the machine: when I press submit, I get failed to connect, and even after pressing it multiple times (> 20).

If I may add however, when I change the machine type Dyson Pure Hot + Cool (New), it works on the first submit. So, at the moment, I’m using this configuration for my formaldehyde machine.

GitPetri commented 2 years ago

Same here with a PH03 (device type 358E, sadly the same as PH04). If I enable the debug log in HA for this integration,

I managed to configure my 358E with the latest Dyson Local which has new enough libdyson to include 358E. If both Dyson Local and Dyson Cloud are installed, at least in my setup it messes up the configurations as the libdyson version differs between Dyson Local and Dyson Cloud. See https://github.com/shenxn/ha-dyson/issues/103#issuecomment-1093872551

LunchboxNYC commented 2 years ago

I am having the issue with a PH02 and two PH04's

GitPetri commented 2 years ago

I am having the issue with a PH02 and two PH04's

@LunchboxNYC did you test the steps linked to my previous comment?

Fulg commented 2 years ago

No change for me using latest Dyson Local (I did have Dyson Cloud installed, so I removed both and only reinstalled Dyson Local). I still have the debug logs activated so I see the same errors as before (Disconnected with result code 7), regardless of the machine type I use. I have confirmed in the logs that I only have the newer libdyson installed: Attempting install of libdyson==0.8.11.

Maybe I need to wipe it out further, ensure nothing is left before trying again...

GitPetri commented 2 years ago

I do know that selecting incorrect machine type will end up in fail. So picking up the correct based on https://github.com/shenxn/libdyson/blob/7b19d1c96c151eb876d8d8fbb3a4d5f2917b86b3/libdyson/const.py#L4 is crucial too

GitPetri commented 2 years ago

No change for me using latest Dyson Local (I did have Dyson Cloud installed, so I removed both and only reinstalled Dyson Local). I still have the debug logs activated so I see the same errors as before (Disconnected with result code 7), regardless of the machine type I use. I have confirmed in the logs that I only have the newer libdyson installed: Attempting install of libdyson==0.8.11.

Maybe I need to wipe it out further, ensure nothing is left before trying again...

Had the same result myself for my 520 device but it was a S.U.E. i.e. Stupid User Error, I selected the machine type off-by-one from the libdyson list (link in my previous comment)

Fulg commented 2 years ago

Ha, thanks for writing back. Indeed after confirming that my PH03 (358E) machine is listed as Purifier Humidify+Cool Formaldehyde in libdyson and not Pure Humidify+Cool as on the product box, if I select that in the drop down, the integration works! S.U.E. indeed. :)

LunchboxNYC commented 2 years ago

I tried un-installing both from HACS after reading this comment and only reinstalling Dyson Local and still had the same issues. I have tried it using the following device types:

DEVICE_TYPE_PURE_HOT_COOL_LINK = "455" DEVICE_TYPE_PURE_HOT_COOL = "527" DEVICE_TYPE_PURE_HOT_COOL_NEW = “527E"

For both my PH04’s and PH02.

On Apr 11, 2022, at 9:57 AM, GitPetri @.***> wrote:

Same here with a PH03 (device type 358E, sadly the same as PH04). If I enable the debug log in HA for this integration,

I managed to configure my 358E with the latest Dyson Local which has new enough libdyson to include 358E. If both Dyson Local and Dyson Cloud are installed, at least in my setup it messes up the configurations as the libdyson version differs between Dyson Local and Dyson Cloud. See #103 (comment) https://github.com/shenxn/ha-dyson/issues/103#issuecomment-1093872551 — Reply to this email directly, view it on GitHub https://github.com/shenxn/ha-dyson/issues/94#issuecomment-1095086090, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHUFLC3FG67ANHUEPVKMOTVEQVTNANCNFSM5MR3DKSQ. You are receiving this because you commented.

Fulg commented 2 years ago

The correct device type to use is the one shown during the get_devices.py. Use whatever name that maps to the Device Type line that was printed during credentials generation. Looks like the actual product name or model number is not useful...

EDIT: It might also be worth confirming in the HA logs that the correct libdyson got installed.