shenxn/ha-dyson

Dyson Cloud never worked, using Dyson Local only now

Opened this issue · 7 comments

erd82 commented

Hello together,

In the past, I never got the dyson cloud integration working and still had this issue until today (also solutions above did not help). Since yesterday I invested several hours again, but I did not make it to get dyson cloud integration working. Finally I found a solution (hopefully stable) which I would like to share.

Existing Problems

  • Constant dyson cloud errors in the logs and dyson appeared as "not loaded". see #171 (comment)
  • Maybe other people from DE, AU or US the same issue like me: libdyson.exceptions.DysonInvalidAuth when trying to use the python3 get_devices.py (see link). And after months and years (why not earlier ??? ) I found a suitable solution / workaround to get credentials for dyson local (see option 2 below).

Solution: Dyson Local only !

  • Finally I decided to completely switch to dyson local only and kicked out dyson cloud from my configuration at all ! (it's better local than relying on communication with the cloud!)
  • And the good news, I can use the dyson integration in parallel with the Dyson Android mobile app (what did not work for me before).

What did I did:

  1. I deleted both integrations (dyson cloud and dyson local) from HA again.
  2. I checked in the /config folder of HA, that both directories (for dyson cloud and dyson local) were gone.
  3. Restarted HA.
  4. Installed dyson local again (using HACS).
  5. In HA > integrations: Started dyson local configuration by adding it to the integrations list.
  6. As "Setup Method" I selected "Setup manually"
    6.1. Serial*: Enter the serial number of your device (e.g. K3G-EU-RA....)
    6.2. Credential*: Get the credential (see below) and enter here.
    6.3. Device Type: Select your device type (in my case "Pure Cool Formaldehyde")
  7. Press send.

Finally dyson local got successfully configured and all required data / services are available in HA! That's it!

How to get credentials?

Usually, there are two options (@Kakise, @shenxn: Wouldn't it make sense to document option 2 in the official documentation?):

  1. Using python3 get_devices.py see https://github.com/shenxn/ha-dyson#setup-manually (never worked for me)
  2. Using Android app to catch credentials locally as described by @proatwork. < the only solution that worked for me!

Using an Android phone

You can probably do this with an iOS device, but I haven't tested (https://stackoverflow.com/a/8512455)

  1. Download the Packet Capture app from Google Playstore (https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en&gl=US)
  2. Open Dyson Link and leave it running in the background
  3. Run the Packet Capture app, allow it to create a VPN if you're prompted
  4. Hit the play button with the 1 and choose the Dyson Link app
  5. Switch to the Dyson Link app, it will probably do a quick refresh of the welcome page
  6. Switch back to Packet Capture and stop capturing
  7. Look through the captured packets for something like this:
    Screenshot_20210305-024635

Hope other people can benefit from it.

Cheers

Thanks @erd82 following your Android tutorial, I got my fans connected to Home Assistant!

Is there any way to do this without an Android device? 🤔

erd82 commented

Is there any way to do this without an Android device? 🤔

I guess you need to check for a suitable network sniffer, which is able to catch the respective network package.

For Windows: maybe Wireshark?

For Apple: Is there any experienced Apple user who can recommend something? Maybe something like Intercepter-NG? https://alternativeto.net/software/wireshark/?platform=iphone

@community: Feel free to share your experience here.

Sadly the App Store seems to be missing a chunk of packet sniffers so I'm out of luck

I had managed to successfully get a network capture with the following app - Storm Sniffer. Unfortunately the SSL capture feature is behind a subscription but it’s not too bad.

https://apps.apple.com/app/id1610958307

Thanks for this @erd82. Just a note to say that Packet Capture doesn't appear to work with recent versions of Android, but I was able to get this working with an app called PCAPdroid. I'm still struggling to connect to my HP07, as described here, but I don't believe that's an issue with the captured credentials.

Unfortunately this integration is no longer maintained, but I've created a new fork and am actively working on the new Formaldehyde models. Have a look at #185 for more information, and let me know if you have any questions.

The issues with cloud login are something I've been successful working out to some degree, one of my goals over the coming weeks is to improve the reliability of consuming the API.