shenxn / ha-dyson-cloud

Cloud integration for ha-dyson (https://github.com/shenxn/ha-dyson/)
MIT License
33 stars 20 forks source link

Failed to Connect #7

Open alwyntn opened 3 years ago

alwyntn commented 3 years ago

Hi All, I have recently replaced my home router and wifi ssid changed. I can no longer get my Dyson Cloud & Dyson Local to work. I have uninstalled and reinstalled both integrations and now I cant even get pass the setup screen. on Dyson Cloud, after enter my region and email address, Im getting "Failed to Connect" on Dyson Local, im getting "Failed to parse device WiFi information" on wifi setup method.

Please help :(

Thanks.

rugaard commented 3 years ago

I experience the exact same thing 😢

nfrede commented 3 years ago

Getting the same "failed to connect" issue when trying to setup Dyson Cloud.

LedariaTim1 commented 3 years ago

I experience the exact same thing 😢

christianlappin commented 3 years ago

same issue here. Failed to connect with Dyson Cloud after entering my region and email address for the username. Any updates?

alanchia67 commented 3 years ago

Exactly the same issue here. Failed to connect with Dyson Cloud after entering my region and email address.

LedariaTim1 commented 3 years ago

Hi I have found a workaround which worked for me:

As described here https://github.com/shenxn/ha-dyson under setup and manual setup on your Windows PC run the Python script (before make sure that the requirements.txt are installed) it is also important that you are NOT logged in to the account (app or website), otherwise you will get an error after the email request. If the script was successful you get the serial number of the device, the device ID and the credentials which you have to enter in hassio at Dyson local. if necessary you have to enter the IP address of the Dyson.

If this still doesn't work I have 2 more things I did, but I don't know if this helped the problem. The change to the dyson.py must be done directly in the homeassistant docker via cli when working with docker.

https://github.com/home-assistant/core/issues/38607#issuecomment-671025265

Or the following in the dyson.py https://gist.githubusercontent.com/LedariaTim1/64cbeef34ebf359b41fde5c00ca45d51/raw/e15e522f992daec87ebbb6cced6e87b630dd44a4/dyson.py

alwyntn commented 3 years ago

Hi I have found a workaround which worked for me:

As described here https://github.com/shenxn/ha-dyson under setup and manual setup on your Windows PC run the Python script (before make sure that the requirements.txt are installed) it is also important that you are NOT logged in to the account (app or website), otherwise you will get an error after the email request. If the script was successful you get the serial number of the device, the device ID and the credentials which you have to enter in hassio at Dyson local. if necessary you have to enter the IP address of the Dyson.

If this still doesn't work I have 2 more things I did, but I don't know if this helped the problem. The change to the dyson.py must be done directly in the homeassistant docker via cli when working with docker.

home-assistant/core#38607 (comment)

Or the following in the dyson.py https://gist.githubusercontent.com/LedariaTim1/64cbeef34ebf359b41fde5c00ca45d51/raw/e15e522f992daec87ebbb6cced6e87b630dd44a4/dyson.py

Thanks for the reply !!! Sorry but how do I run the python script.

LedariaTim1 commented 3 years ago

I did this by installing python on my windows and then running python3 get_devices.py in the folder where the file is downloaded. https://www.python.org/downloads/

If you have problems that your powershell still doesn't find the command python3 after the installation, you have to adjust your path variables, just let me know if you don't get along.

https://github.com/shenxn/ha-dyson#setup-manually

christianlappin commented 3 years ago

I have tried to sign out of the app but making sure the fan was still on and running and am getting the below. Still unable to connect.

`Traceback (most recent call last): File "/Library/Python/3.8/site-packages/urllib3/util/ssl_.py", line 402, in ssl_wrap_socket context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data) ssl.SSLError: [X509] PEM lib (_ssl.c:4232)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Python/3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/Library/Python/3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/Library/Python/3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/Library/Python/3.8/site-packages/urllib3/connection.py", line 411, in connect self.sock = ssl_wrapsocket( File "/Library/Python/3.8/site-packages/urllib3/util/ssl.py", line 404, in ssl_wrap_socket raise SSLError(e) urllib3.exceptions.SSLError: [X509] PEM lib (_ssl.c:4232)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Python/3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/Library/Python/3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/Library/Python/3.8/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='appapi.cp.dyson.com', port=443): Max retries exceeded with url: /v3/userregistration/email/userstatus?country=US (Caused by SSLError(SSLError(9, '[X509] PEM lib (_ssl.c:4232)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/christianlappin/libdyson/libdyson/cloud/account.py", line 107, in request response = requests.request( File "/Library/Python/3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/Library/Python/3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/Library/Python/3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/Library/Python/3.8/site-packages/requests/adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='appapi.cp.dyson.com', port=443): Max retries exceeded with url: /v3/userregistration/email/userstatus?country=US (Caused by SSLError(SSLError(9, '[X509] PEM lib (_ssl.c:4232)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "get_devices.py", line 22, in verify = account.login_email_otp(email, region) File "/Users/christianlappin/libdyson/libdyson/cloud/account.py", line 127, in login_email_otp response = self.request( File "/Users/christianlappin/libdyson/libdyson/cloud/account.py", line 117, in request raise DysonNetworkError libdyson.exceptions.DysonNetworkError `

alanchia67 commented 3 years ago

I did this by installing python on my windows and then running python3 get_devices.py in the folder where the file is downloaded. https://www.python.org/downloads/

If you have problems that your powershell still doesn't find the command python3 after the installation, you have to adjust your path variables, just let me know if you don't get along.

https://github.com/shenxn/ha-dyson#setup-manually

Thanks! I got it working! Indeed, need to logout from the Dyson mobile app to reauthenticate with Dyson to obtain information needed in get_devices.py script. Do a re-login (fill in region, email, password) i app and wait for the authentication code to be sent to email. This code is needed in the python script to obtain all information needed for the Dyson local setup.

dcnoren commented 2 years ago

@christianlappin , you might need to update the cert. First get the cert and add to root store (or system store if on Mac). Then use pip3 certifi to reference system certs.

  1. Download this Cert: https://cacerts.digicert.com/DigiCertTLSRSASHA2562020CA1-1.crt.pem and import to system/root store/keychain
  2. If on Mac:
  3. Run "pip3 install certifi"
  4. Run
    CERT_PATH=$(python3 -m certifi)
    export SSL_CERT_FILE=${CERT_PATH}
    export REQUESTS_CA_BUNDLE=${CERT_PATH}

Re-run python3 get_devices.py and see if it works.

DrBlackRat commented 2 years ago

I did this by installing python on my windows and then running python3 get_devices.py in the folder where the file is downloaded. https://www.python.org/downloads/

If you have problems that your powershell still doesn't find the command python3 after the installation, you have to adjust your path variables, just let me know if you don't get along.

https://github.com/shenxn/ha-dyson#setup-manually

hm If I open the get_devices.py the cmd opens for under a second and nothing else happens

christianlappin commented 2 years ago

Ok I ended up getting this working by installing Python https://www.python.org/downloads/ on one of my Windows instances then installing Python from the windows store. I am sure if I played around with path variables and rebooted a few times I might not have needed that but after loading the Windows store Python and logging out of the Dyson app and making sure the fan was on things worked perfectly! I suspect on Mac with OSX as @dcnoren eluded to the local certs needed to be updated but since I got it working I am leaving it along. Frustrating that running Python on Windows was the answer but HAPPY I am integrated into Home Assistant now. Hope this helps someone.

markyeew commented 2 years ago

@dcnoren I still get the unable to verify certificate error. Installed the certificates using the "install certificate.command" (on Mac) as well. Dyson Cloud still failed to connect. anyone has any fix?

lordraiden commented 2 years ago

please fix Dyson Cloud can't connect either

I get "Failed to connect" when I click on submit email

auduny commented 2 years ago

Do you guys happen to be located in Norway. For me it seems to be a case of "NO" being parsed as "false" and/or zero by somewhere in the stack.

ajfisher commented 2 years ago

Similar issue here. In a nutshell, just bought a 2021 model TP07 (region Australia) and can't connect to it via Dyson Local because there's no wifi credentials (onboarding to local WiFi is done via NFC from the mobile app instead) and trying to use the Dyson Cloud integration it gets to the point of selecting a region then asking for an email address and it simply says "failed to connect"

Screen Shot 2022-01-15 at 16 01 02

No access to a windows machine to try and do this get devices thing as am on a mac. Could probably help debug it but python these days isn't really my strong suit.

Guy-Falkes commented 2 years ago

I did this by installing python on my windows and then running python3 get_devices.py in the folder where the file is downloaded. https://www.python.org/downloads/

If you have problems that your powershell still doesn't find the command python3 after the installation, you have to adjust your path variables, just let me know if you don't get along.

https://github.com/shenxn/ha-dyson#setup-manually

Thanks, I finally got it working but only after loggin out of the app, getting a new security code from Dyson AND then looking up my Dyson IP-address in my router and putting that under host (it couldn't find it otherwise).

Pakawat75 commented 2 years ago

I did this by installing python on my windows and then running python3 get_devices.py in the folder where the file is downloaded. https://www.python.org/downloads/

If you have problems that your powershell still doesn't find the command python3 after the installation, you have to adjust your path variables, just let me know if you don't get along.

https://github.com/shenxn/ha-dyson#setup-manually

Can you walk me through here. After open get_devices.py, I get new windows ask me for region [1/2], region code, and email. After filled email and enter, windows disappear and nothing happen.

LedariaTim1 commented 2 years ago

I did this by installing python on my windows and then running python3 get_devices.py in the folder where the file is downloaded. https://www.python.org/downloads/ If you have problems that your powershell still doesn't find the command python3 after the installation, you have to adjust your path variables, just let me know if you don't get along. https://github.com/shenxn/ha-dyson#setup-manually

Can you walk me through here. After open get_devices.py, I get new windows ask me for region [1/2], region code, and email. After filled email and enter, windows disappear and nothing happen.

You have to logout from any Location, i mean Website and App I Hope this will Help you