Closed proatwork closed 3 years ago
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? :)
@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
@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?
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
@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! :)
@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==
@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.
@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
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.
Same here @krazar. The bfayers
fork was working for me until the most recent HA update :/
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: my@email.com
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
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!
@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.
@eiddor i am guessing it's related to the new 2FA issue? lol
@eiddor i am guessing it's related to the new 2FA issue? lol
Yeah, that's what I suspect.
@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.
@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.
@eiddor , you are right, but let's see what developer can do.
if the developer can figure this out, big thank you in advance!
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
@monsieurlatte you're not supposed to run that :) create a new .py file and paste the snippet from the first comment then run that
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.
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
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 anX
, at least in my case
that's awesome, dont see anything for iOS in my first look through the app store.
Haven't tested, but maybe you can make it work with Bluestacks
@monsieurlatte this might help if you've used Wireshark before https://stackoverflow.com/a/8512455
I'll work on the new 2FA over the weekend. Hopefully that will fix the problem.
@monsieurlatte this might help if you've used Wireshark before https://stackoverflow.com/a/8512455 Thanks, I'll look into that!
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.
Confirmed! Just opening the app and then rerunning the script with no changes fixed it for me! Thanks so much ❤️
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
.
Now, I can get the credentials. Thank you !
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?
@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.
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
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.
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.
cheers.
I am on iOS so was looking for it's equivalent, but Apple won't let you do it (security).
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
You may wish to make friends with Android people
Ha, yes! 👍
Maybe this post helps you: https://github.com/shenxn/ha-dyson/issues/178
Update:
@shenxn: https://github.com/shenxn/ha-dyson/issues/5#issuecomment-791887983
Old
Not an actual issue, but wanted to make this available for other people
I've managed to get credentials in two ways:
1. Using
libpurecool
Use this fork of libpurecool (fix_auth branch): https://github.com/bfayers/libpurecool/tree/fix_auth
python3 -m pip install https://github.com/bfayers/libpurecool/archive/fix_auth.zip
whatever.py
Paste this in:
python3 whatever.py
2. Using an Android phone
You can probably do this with an iOS device, but I haven't tested (https://stackoverflow.com/a/8512455)
Packet Capture
app from Google Playstore (https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en&gl=US)1
and choose the Dyson Link app