merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
394 stars 62 forks source link

Micloud 2FA not working #321

Closed alexanderzeh closed 2 years ago

alexanderzeh commented 2 years ago

Hey, when using the option "Discover all devices using Micloud" in the plugin settings I get the error message that 2FA is required. After clicking the new red button and going through the required steps for the 2FA verification I get a simple "ok" in the tab I made those verification steps. When going back to the tab with the plugin settings and retrying the button "Discover all devices using Micloud" I get the same error again. It doesn't matter if I try it right away, after maybe 5, 10 or 30 seconds.

kenzyt400 commented 2 years ago

I've the same issue did you find how to resolve it ?

merdok commented 2 years ago

Did you try to refresh the homebridge ui page after the verification?

alexanderzeh commented 2 years ago

Hey @merdok, I didn't refresh the homebridge UI after the verification. (just clicking the button "Discover all devices using Micloud" again.) Now, after your message I tried that too, meaning:

merdok commented 2 years ago

Well that is unfortunate... As I do not use and do not have any account with 2FA enabled I am not sure what the issue here is. Just doing what xiaomi expects in that case... If somebody could play around with that and figure out what the issue is then it would be great.

alexanderzeh commented 2 years ago

I wish I could disable 2FA for that account (at least temporary), but Xiaomi doesn't allow that. At least I haven't found such an option. Anyway: I'm happy to support you here, but I'm not sure what kind of information would help you. Maybe you could create an account for testing? On https://www.mi.com you can create an account (it's on the generic "person" icon in the top right). What I found out so far: In general the 2FA authentication seems to work, because when following the steps until I get the "ok" in the 2FA tab, I can open a new tab, go to mi.com and login without a new 2FA process.

Another thought related to that: I'm not logged in to the pi and manage everything from the browser on my normal desktop computer. Would it maybe make a difference to use the browser on the pi itself? (Meaning, logging in to raspian and start the browser in that environment and follow all the steps there?)

merdok commented 2 years ago

It should not matter whether you do it directly on the pi or in another browser.

Tongo91 commented 2 years ago

Still not working for me, why is this closed? Is it a new error? I did 2FA got the "OK" but login is not working

mfedoseev commented 4 months ago

Same issue here!

2FA opens a new tab where Xiaomi sends you a 6-digit code, than shows a simple "ok" after entering the received code. Doing anything in the plugin leads to the same 2FA request repeatedly.

I hope this can be fixed. Xiaomi has no UI to manage the 2FA, I never enabled it and my account is a few years old. ¯_(ツ)_/¯

merdok commented 4 months ago

It is odd that some people are still facing the issue...