Giter VIP home page Giter VIP logo

Comments (40)

shenxn avatar shenxn commented on July 19, 2024 3

I'll work on the new 2FA over the weekend. Hopefully that will fix the problem.

from ha-dyson.

shenxn avatar shenxn commented on July 19, 2024 2

I've added 2FA support to libdyson (https://github.com/shenxn/libdyson). Download or clone the repo, then run python3 get_devices.py to get credentials. You may also need to install some dependencies using pip3 install -r requirements.txt.

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024 1

@ripburger you need to run that python code snippet (quoted above) after installing the libpurecool library from bfayers (linked above).
https://adamj.eu/tech/2019/03/11/pip-install-from-a-git-repository/

python -m pip install https://github.com/bfayers/libpurecool/archive/fix_auth.zip

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024 1

I also managed to get the credentials by using my android phone.
https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en&gl=US

I used this to monitor the Dyson app for a couple of seconds (by pressing the triangle icon with the 1, and selecting Dyson Link), and lo and behold, the credentials.
The serial and credentials are separated by an X, at least in my case

Screenshot_20210305-024635

from ha-dyson.

Anto79-ops avatar Anto79-ops commented on July 19, 2024 1

cheers.

I am on iOS so was looking for it's equivalent, but Apple won't let you do it (security).

Probably, You may wish to make friends with Android people LOL

from ha-dyson.

ripburger avatar ripburger commented on July 19, 2024

Thx! But I am still stuck on getting the credentials. I am running Home Assistant on a PI4, and have no idea how to get them. Any suggestions? :)

from ha-dyson.

soffes avatar soffes commented on July 19, 2024

@proatwork I keep getting Unable to login to Dyson account. I can use the email and password I supplied to sign in on the website. I can also curl https://appapi.cp.dyson.com/v1/userregistration/userstatus and see that my account is active with the US country.

Any tips?

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024

Hey @soffes
Are you using the libpurecool fork above?
The credentials should be the ones you use for the Dyson mobile app
If I have some free time tomorrow I will write a step by step of how I managed to make it work

from ha-dyson.

soffes avatar soffes commented on July 19, 2024

@proatwork I tried this:

$ python3 -m pip install https://github.com/bfayers/libpurecool/archive/fix_auth.zip
$ python3 dyson.py

dyson.py is your script from above. From reading the integration documentation it says US is a known working language. From reading the libpurecool code it actually passes the "language" as a country in the URL so I think US is correct.

I verified that the credentials I used work in the iOS app and can control my fan.

Any help would be awesome. Super appreciate your time on this! :)

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024

@soffes

pi@raspberrypi:[~]$ python3.7 -m pip install https://github.com/bfayers/libpurecool/archive/fix_auth.zip

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting https://github.com/bfayers/libpurecool/archive/fix_auth.zip
  Using cached https://github.com/bfayers/libpurecool/archive/fix_auth.zip
Requirement already satisfied: netifaces in /home/pi/.local/lib/python3.7/site-packages (from libpurecool==0.6.4) (0.10.9)
Requirement already satisfied: paho_mqtt in /home/pi/.local/lib/python3.7/site-packages (from libpurecool==0.6.4) (1.5.1)
Requirement already satisfied: pycryptodome in /home/pi/.local/lib/python3.7/site-packages (from libpurecool==0.6.4) (3.10.1)
Requirement already satisfied: requests<3,>=2 in /usr/lib/python3/dist-packages (from libpurecool==0.6.4) (2.21.0)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from libpurecool==0.6.4) (1.12.0)
Building wheels for collected packages: libpurecool
  Running setup.py bdist_wheel for libpurecool ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-gm2k7gt0/wheels/7f/8a/a5/8fa837fd233e6ab9b9c1fa2d26046d8db278c5279547827ba9
Successfully built libpurecool
Installing collected packages: libpurecool
Successfully installed libpurecool-0.6.4

pi@raspberrypi:[~]$ python3.7 ~/test.py

yZZpyItgEttmmWqzUxY5HzC+y66j4K51u/O****Kpt5n6DrbrDDBtilqbImu7BcUJNPyBBy6ZIxqd+TTZsI3w==

from ha-dyson.

krazar avatar krazar commented on July 19, 2024

@soffes

pi@raspberrypi:[~]$ python3.7 -m pip install https://github.com/bfayers/libpurecool/archive/fix_auth.zip

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting https://github.com/bfayers/libpurecool/archive/fix_auth.zip
  Using cached https://github.com/bfayers/libpurecool/archive/fix_auth.zip
Requirement already satisfied: netifaces in /home/pi/.local/lib/python3.7/site-packages (from libpurecool==0.6.4) (0.10.9)
Requirement already satisfied: paho_mqtt in /home/pi/.local/lib/python3.7/site-packages (from libpurecool==0.6.4) (1.5.1)
Requirement already satisfied: pycryptodome in /home/pi/.local/lib/python3.7/site-packages (from libpurecool==0.6.4) (3.10.1)
Requirement already satisfied: requests<3,>=2 in /usr/lib/python3/dist-packages (from libpurecool==0.6.4) (2.21.0)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from libpurecool==0.6.4) (1.12.0)
Building wheels for collected packages: libpurecool
  Running setup.py bdist_wheel for libpurecool ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-gm2k7gt0/wheels/7f/8a/a5/8fa837fd233e6ab9b9c1fa2d26046d8db278c5279547827ba9
Successfully built libpurecool
Installing collected packages: libpurecool
Successfully installed libpurecool-0.6.4

pi@raspberrypi:[~]$ python3.7 ~/test.py

yZZpyItgEttmmWqzUxY5HzC+y66j4K51u/O****Kpt5n6DrbrDDBtilqbImu7BcUJNPyBBy6ZIxqd+TTZsI3w==

Hello, I have the same problem,

I reproduced what you described ☝️ and I get "Unable to login to Dyson account".

I still can logout and login to the mobile app with those credentials. I also tried with a new account without success.

Are there any other step to take into account ?
Thank you.

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024

@krazar
I created my account through https://www.dyson.com/your-dyson, if that makes any difference 🤷

you might want to make sure that you have the bfayers fork lib installed and not etheralm or CharlesBlonde

from ha-dyson.

krazar avatar krazar commented on July 19, 2024

That's really strange.

I can connect with my account on the dyson website (from my region)
And, to be sure, I uninstalled libpurecool and reinstall the version from bfayers from the snippet above.
Nothing changes.

from ha-dyson.

soffes avatar soffes commented on July 19, 2024

Same here @krazar. The bfayers fork was working for me until the most recent HA update :/

from ha-dyson.

eiddor avatar eiddor commented on July 19, 2024

Not able to get credentials here, either - I finally managed to get get_devices.py to run :-)

I have tried the mobile login/logout process already.

bash-5.0# python get_devices.py                                                 
Please choose your account region                                               
1: Mainland China
2: Rest of the World
Region [1/2]: 2
Region code: US
Email: [email protected]
Password: 
Traceback (most recent call last):
  File "/config/custom_components/libdyson-main/libdyson/cloud/account.py", line 127, in login_email_password
    response = self.request(
  File "/config/custom_components/libdyson-main/libdyson/cloud/account.py", line 109, in request
    raise DysonInvalidAuth
libdyson.exceptions.DysonInvalidAuth

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get_devices.py", line 23, in <module>
    account.login_email_password(email, password, region)
  File "/config/custom_components/libdyson-main/libdyson/cloud/account.py", line 138, in login_email_password
    raise DysonLoginFailure
libdyson.exceptions.DysonLoginFailure

from ha-dyson.

kintaroju avatar kintaroju commented on July 19, 2024

ok, i'm new to this don't shoot me, but when i enter into the bash session inside my home assistant docker session, i've tried to execute the bfayers python code, except i get the following:

bash-5.0# python3 dyson.py
Traceback (most recent call last):
  File "dyson.py", line 12, in <module>
    from .dyson_pure_cool import DysonPureCool
ImportError: attempted relative import with no known parent package

is the path for the package correct:

/usr/local/lib/python3.8/site-packages/libpurecool

I think I am missing something here to get the credential info, any help is appreciated!

from ha-dyson.

eiddor avatar eiddor commented on July 19, 2024

@kintaroju I managed to get get_devices.py from https://github.com/shenxn/libdyson/ to run.

Still having a problem logging in, but that's a different problem.

from ha-dyson.

kintaroju avatar kintaroju commented on July 19, 2024

@eiddor i am guessing it's related to the new 2FA issue? lol

from ha-dyson.

eiddor avatar eiddor commented on July 19, 2024

@eiddor i am guessing it's related to the new 2FA issue? lol

Yeah, that's what I suspect.

from ha-dyson.

kintaroju avatar kintaroju commented on July 19, 2024

@eiddor totally hear you. I think if the developer can somehow trigger the 2FA email and integrate the 2FA value I think we can be in the clear.

from ha-dyson.

eiddor avatar eiddor commented on July 19, 2024

@eiddor totally hear you. I think if the developer can somehow trigger the 2FA email and integrate the 2FA value I think we can be in the clear.

That may work ok for Dyson Local and grabbing the credentials once, but I don't know how well it would scale for the native HA Dyson implementation or @shenxn's Dyson Cloud.

I'm not a dev, so maybe I'm missing something - I think it's more a matter of Dyson catching their API up with their mobile app.

from ha-dyson.

kintaroju avatar kintaroju commented on July 19, 2024

@eiddor , you are right, but let's see what developer can do.

if the developer can figure this out, big thank you in advance!

from ha-dyson.

monsieurlatte avatar monsieurlatte commented on July 19, 2024

I manually copied the github folder and when I go into the libepurcool folder and run dyson.py I get this.

C:\Python\libpurecool\libpurecool>python dyson.py
Traceback (most recent call last):
File "dyson.py", line 12, in
from .dyson_pure_cool import DysonPureCool
ImportError: attempted relative import with no known parent package

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024

@monsieurlatte you're not supposed to run that :)
create a new .py file and paste the snippet from the first comment then run that

from ha-dyson.

monsieurlatte avatar monsieurlatte commented on July 19, 2024

Thanks, that helps a ton, figured it out, now I just get the same as everyone else with the whole unable to log into dyson account.

from ha-dyson.

monsieurlatte avatar monsieurlatte commented on July 19, 2024

I also managed to get the credentials by using my android phone.
https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en&gl=US

I used this to monitor the Dyson app for a couple of seconds (by pressing the triangle icon with the 1, and selecting Dyson Link), and lo and behold, the credentials.
The serial and credentials are separated by an X, at least in my case

Screenshot_20210305-024635

that's awesome, dont see anything for iOS in my first look through the app store.

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024

Haven't tested, but maybe you can make it work with Bluestacks

from ha-dyson.

proatwork avatar proatwork commented on July 19, 2024

@monsieurlatte this might help if you've used Wireshark before https://stackoverflow.com/a/8512455

from ha-dyson.

monsieurlatte avatar monsieurlatte commented on July 19, 2024

@monsieurlatte this might help if you've used Wireshark before https://stackoverflow.com/a/8512455
Thanks, I'll look into that!

from ha-dyson.

monsieurlatte avatar monsieurlatte commented on July 19, 2024

So here's something, I updated the App on my phone, opened the dyson link app on the phone made sure it connected and all that. Then I just added in the HACS Dyson Cloud integration and now it works? Seems like you need the new Dyson app to trigger something to allow it to work.

from ha-dyson.

soffes avatar soffes commented on July 19, 2024

Confirmed! Just opening the app and then rerunning the script with no changes fixed it for me! Thanks so much ❤️

from ha-dyson.

krazar avatar krazar commented on July 19, 2024

Now, I can get the credentials.
Thank you !

from ha-dyson.

kintaroju avatar kintaroju commented on July 19, 2024

Just tried your libdyson and it works like hot cakes. Do you plan to integrate it with your Dyson local implementation @shenxn to simplify the process?

from ha-dyson.

shenxn avatar shenxn commented on July 19, 2024

@kintaroju Use ha-dyson-cloud (https://github.com/shenxn/ha-dyson-cloud). Set up Dyson Cloud with your account first, then all your devices will be shown as discovered entities.

from ha-dyson.

Anto79-ops avatar Anto79-ops commented on July 19, 2024

hey, nice managed to get my dysons fans connected using the packet readrer on my Android phone. Question, for some, I have:

Dyson Purifier Hot+Cool Formaldehyde HP09
Dyson Pure Hot+Cool™ HP04

  1. What is the difference between "Dyson Pure Hot+Cool (new)" and "Dyson Pure Hot+Cool"?
  2. Also, I manged to add the HP09 as a "Dyson Pure Hot+Cool (new)" seems to work...but definitly not seeing the formaldehyde numbers nor the catalyst life for the formaldehyde..I guess a future update?

from ha-dyson.

 avatar commented on July 19, 2024

managed to get my dysons fans connected using the packet readrer on my Android phone

How did you do this? I have been unable to get credentials using libdyson after months of trying.

I have credentials for Homebridge, but there doesn't seem to be a way to convert them to work in Homeassistant.

from ha-dyson.

Anto79-ops avatar Anto79-ops commented on July 19, 2024

managed to get my dysons fans connected using the packet readrer on my Android phone

How did you do this? I have been unable to get credentials using libdyson after months of trying.

I have credentials for Homebridge, but there doesn't seem to be a way to convert them to work in Homeassistant.

Scroll up to the instructions from monsierlatte, and that's what I followed. Once I got the username and credentials, sometimes I had to try a couple of times before it actually submitted successfully probably due to Wi-Fi connection to the fan.

from ha-dyson.

 avatar commented on July 19, 2024

cheers.

I am on iOS so was looking for it's equivalent, but Apple won't let you do it (security).

from ha-dyson.

 avatar commented on July 19, 2024

You may wish to make friends with Android people

Ha, yes! 👍

from ha-dyson.

erd82 avatar erd82 commented on July 19, 2024

Maybe this post helps you: #178

from ha-dyson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.