merdok / homebridge-miot

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

Cannot get past 2FA authentication #409

Closed maaezis closed 1 year ago

maaezis commented 1 year ago

Hi, I'm new to homebridge and miot is actually my first plugin, so I might be doing something wrong, but I just can't get past the 2FA authentication of xiaomi account when trying to discover all my devices. I have my homebridge installed on Synology NAS. When I try to login, I get the 2FA prompt, I authenticate myself, get the webpage with "ok" and when I click on "discover all devices" again, nothing happens. When searching Google, I found only one way to result this and that was to deactivate the 2FA. However, the option is not available in Xiaomi account anymore. Someone else suggested to create new account without a phone number and skipping a prompt for 2FA, but no prompt popped up for me. With the new account, I still get the 2FA prompt in miot and after authenticating, nothing happens. Am I missing some simple solution or doing something wrong?

merdok commented 1 year ago

It is very strange that 2FA cannot be deactivated, but i know that a lot of accounts have it somehow not active, including mine. I know that there were some issue with 2FA, the problem i guess is that you need to do the 2FA verification in the same window where you login, if you do it in another tab or window then i guess it will not work.

maaezis commented 1 year ago

Okay, so I had to wait 24 hours, because I got locked out for more than 5 authentication tries. When I click on the authenticate button, new tab automatically opens. I tried what you suggested and instead of clicking on authenticate, I copied the link and opened it in the same tab, authenticated myself and then typed the IP address of my homebridge into the same tab to go back to the plugin. I also tried using the back button to go back to homebridge after authenticating, but neither option works. When I try to login to my Xiaomi account again, I still get the same message to authenticate. Any other suggestions?

merdok commented 1 year ago

Yeah well that was the best guess which i had for that... Unfortunately i cannot help you with any other suggestions here as i do not have the 2FA enable myself. Maybe someone else has a suggestion?

vedmant commented 1 month ago

For me it worked when I logged in to Mi Home account in the browser first https://account.xiaomi.com/