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

Failed to connect #66

Closed
fabltd opened this issue Sep 13, 2021 · 16 comments
Closed

Failed to connect #66

fabltd opened this issue Sep 13, 2021 · 16 comments

Comments

@fabltd
Copy link

fabltd commented Sep 13, 2021

Attempting to setup Dyson Cloud

Region UK ( GB)

Enter email address and get the error - Failed to connect.

@smallbitt
Copy link

I have the same problem here IT (Italy)

@damiano75
Copy link

Any news?
image

@magix66
Copy link

magix66 commented Sep 24, 2021

same here... Australia

@51av0sh
Copy link

51av0sh commented Sep 28, 2021

Reposting from another open issue so it might help here as well....

So I have the original super old desk fan (DP01) and I've been having issues with the cloud integration since the latest update. I wanted to try local but I'm on hassOS and can't clone the repo and install python (or couldn't figure out how to). I didn't bother with the wifi setup for the local integration since I assumed there was no wifi ssid on this thing since it's so old. Well I was wrong. I was changing the filter today and noticed a sticker inside that can only be seen after removing the filter. Sure enough I saw the ssid and password. Connected flawlessly. If my DP01 has this option then I assume they all do.

@gfawkes66
Copy link

Same here 'Failed to Connect'

@MishaelRosenthal
Copy link

Same here US

@appler1d3r
Copy link

Refer issue #59. To the end of the thread there are few instructions on how to overcome this problem. My device (Hot and Cool) works fine after using get_devices.py method.

I followed this method and worked for my device #59 (comment)

I had the connection issue again from HA today and followed steps and was able to connect again. So the steps are still valid.

@damiano75
Copy link

damiano75 commented Oct 18, 2021

Refer issue #59. To the end of the thread there are few instructions on how to overcome this problem. My device (Hot and Cool) works fine after using get_devices.py method.

I followed this method and worked for my device #59 (comment)

I had the connection issue again from HA today and followed steps and was able to connect again. So the steps are still valid.

I tried it a lot of times, every time I got this error

Traceback (most recent call last): File "C:\Users\100027434\Downloads\libdyson-main\get_devices.py", line 22, in <module> verify = account.login_email_otp(email, region) File "C:\Users\100027434\Downloads\libdyson-main\libdyson\cloud\account.py", line 127, in login_email_otp response = self.request( File "C:\Users\100027434\Downloads\libdyson-main\libdyson\cloud\account.py", line 119, in request raise DysonInvalidAuth libdyson.exceptions.DysonInvalidAuth

@appler1d3r
Copy link

Only way I could replicate DysonInvalidAuth libdyson.exceptions.DysonInvalidAuth is when I provide invalid username or password. Please make sure that you are able to login using that email/password in the app. Other option is to use a new email for Dyson account and use that. Also, if you try lot of time in quick succession, Dyson could potentially block the requests thinking it as some sort of SPAM

@lolongan
Copy link

lolongan commented Oct 24, 2021

After getting through the step "Verification code" but get the following error.
Does someone know what it means and how to fix it ? Thanks.
Edit: I have 2 devices in my accounts, 1 Pure Hol+Cool which is already configured in HA and 1 new device, a Purifier Hot+Cool Formaldehyde. Maybe the error below has something to do with the new device ?

Traceback (most recent call last):
  File "/Users/comedie/Downloads/libdyson-main/get_devices.py", line 30, in <module>
    devices = account.devices()
  File "/Users/comedie/Downloads/libdyson-main/libdyson/cloud/account.py", line 180, in devices
    devices.append(DysonDeviceInfo.from_raw(raw))
  File "/Users/comedie/Downloads/libdyson-main/libdyson/cloud/device_info.py", line 31, in from_raw
    decrypt_password(raw["LocalCredentials"]),
  File "/Users/comedie/Downloads/libdyson-main/libdyson/cloud/utils.py", line 31, in decrypt_password
    json_password = json.loads(_unpad(decrypted))
  File "/Users/comedie/Downloads/libdyson-main/libdyson/cloud/utils.py", line 19, in _unpad
    return string[: -ord(string[len(string) - 1 :])]
TypeError: ord() expected a character, but string of length 0 found

@pcambra
Copy link

pcambra commented Oct 24, 2021

I was getting this until I registered the device with the Dyson app, using the same email worked for me, when you enter an email that is not recognized by Dyson, this seems to trigger the Failed to connect message before prompting for the password

@damiano75
Copy link

Only way I could replicate DysonInvalidAuth libdyson.exceptions.DysonInvalidAuth is when I provide invalid username or password. Please make sure that you are able to login using that email/password in the app. Other option is to use a new email for Dyson account and use that. Also, if you try lot of time in quick succession, Dyson could potentially block the requests thinking it as some sort of SPAM

I'm sure the email is valid, I checked it a lot of times, I tried it logging in the app many times (and before it worked on HA). I tried also to create a new account with another email address but, as soon as click on send on HA frontend or I pressed enter on python idle, I got the error

@appler1d3r
Copy link

Only way I could replicate DysonInvalidAuth libdyson.exceptions.DysonInvalidAuth is when I provide invalid username or password. Please make sure that you are able to login using that email/password in the app. Other option is to use a new email for Dyson account and use that. Also, if you try lot of time in quick succession, Dyson could potentially block the requests thinking it as some sort of SPAM

I'm sure the email is valid, I checked it a lot of times, I tried it logging in the app many times (and before it worked on HA). I tried also to create a new account with another email address but, as soon as click on send on HA frontend or I pressed enter on python idle, I got the error

sorry mate, can't think of any other reasons.

FYI, This is a similar issue #59 (comment)

also make sure the country code is same country code in the app. From the code, the request is responding with either 401 or 403 and that means, the Dyson API is rejecting email and country code combination.

Also, this link has lots of information and troubleshooting via Postman in figuring out the response.
etheralm/libpurecool#37

Basically this python call we are using a different end point than the end point the Dyson App is using, I reckon. So working via the app doesn't mean the API used here can authenticate is.

@gabe-seomoon
Copy link

Same here KR

@w3ihang
Copy link

w3ihang commented Nov 18, 2021

get_devices.py didn't work out of the box for me. After sorting out cert issues, I was getting http error 401. I then moved on to try the dyson cloud config flow and was getting failed to connect like most of you here. I switched back to get_devices.py in a last-ditch attempt and it finally worked! The only extra thing I did was to log out from the app.

@Kakise
Copy link
Collaborator

Kakise commented Dec 15, 2021

Honestly there's nothing I can do about it except adding a section in the readme. It has to do with how the Dyson API itself works. If someone has a workaround I'll gladly merge it but until then there's not much I can do.

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