-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map Extractor quit working (Two factor authentication required) #157
Comments
You have to open provided link in your browser and follow steps described on the page. It is possible that your link has expired before you used it. You can use token extractor to generate a new one. You have to do it from a device that is in the same LAN as HA |
I experienced exactly the same behavior like @jscherry with our two Roborock S5 Max today: All of a sudden the extracted maps for the vacuums didn't show up anymore with Lovelace but showing the pictures "two factor authentication required (see logs)" instead. Using token extractor didn't bring up anything new: Nothing has changed but the tokens are exactly the same as they were before. So I simply just restared Home Assistant and all went automagically back to good again: The maps incl. calibration points, zones etc. are showing again in Lovelace. I don't know whether the culprit was with Xiaomi or HA. |
I just experienced the exact same thing as the OP. I suspect Xiaomi is adding some sort of MFA to their servers. However, I noticed that my ISP's DHCP-issued IP address for my private network had changed between yesterday and today, so I wonder if that might have contributed to the sudden display of the error. A simple restart of HA didn't resolve the issue, but after doing a reboot of both my pfSense server and a physical reboot of my HA VM, it started working again. |
For me The Problem exists on a per day Basis :/ |
I'm having the same issue since my HA instance froze yesterday. When trying to use token extractor to get the token. I get the exact same message. But I can log in to my Xiaomi Cloud account on the website without 2FA. Edit: Edit 2: Oh and reinstalling the map extractor doesn't make a difference either Please assist. |
@dbloom86 Have you opened the links using a device that has the same public IP as your HA instance? |
@PiotrMachowski yes I have. Like I said, I can do the 2FA authentication just fine. It just doesn't change the fact that the integration keeps coming back with the message and it doesn't show a map |
@dbloom86 try to follow these steps:
|
@PiotrMachowski Ok I tried that. But it just keeps generating the error and not showing the map. Every time I reload the Xiaomi Cloud Map Extractor, the error shows up and I get a new 2FA link. I can complete it over and over again, but to no avail unfortunately.... Edit: |
@dbloom86 Can you try using token extractor from a different public IP (e.g. using your phone as a access point)? |
@PiotrMachowski I just tried that. But it gives the same exact result. I'm starting to think, it is something in my Xiaomi Cloud account.... But Idk what... |
@dbloom86 do you use other integrations that connect to Xiaomi Cloud? |
@PiotrMachowski nope. I do have the Xiaomi Home app on my phone, and that connects fine. But that doesn't use the same way of connecting I think. I can try another integration to test though |
@PiotrMachowski ok this is weird. I installed another integration that was gonna use the Xiaomi Cloud, but I didn't set it up yet. Restarted HA after installing it, and somehow the map extractor started working again. |
Is anyone looking at a proper fix for this? Had this issue for a while. First time, restarting did the trick. A couple of weeks later it came back and nothing seems to work. Tried all the things described here😕 |
I get the same issue btw when trying to run the python token extractor. It gives me a link saying two factor authentication required. When I go to the link, I'm able to fill in the number I get in the email but nothing happens in the script. Restarting it gives me the same error |
I noticed this happening if my vaccum was in another subnet then my phone/homeassitant - but sharing the same public ip adress, maybee this helps some of you guys :) (And notice: I logged out of all my mobile apps during the extraction process, and logged back in later - not shure if this affected my setup) |
I can confirm the above.. if you open the link from the same subnet it works. However, my problem is that i simply do not receive the email... |
@almostserious it's possible that link has expired, try to reload Extractor domain in Server Controls and use the new link |
Thanks, the link is still fine. Its an issue with the Xiaomi Email.. I'm stuck in a loop now ;) Don't have a phone number connected to receive a code, and to register the phone number I first need to confirm the email which doesn't work ;) Lets see if it maybe arrives 24h later. |
@PiotrMachowski I'm with the same problem. From couple days ago the map it's STOP working. the card shows: "two factor auth required (see logs)" in my mi account in 2 step auth menu it's disable... |
Just came here to say that this worked for me. It must be like a "random" or "rare" check of the Xiaomi API to verify that the logins are not a hack attempt and that they originate from the true owner of the account. What I am about to say is not salt to any of the other users facing problems but make sure you have the right requirements in place people. Firstly and I can't stress this enough, try this from the browser, on a PC that is on the same network as your HA instance. Not from your friend's PC, not from your mobile (on cellular network) phone browser, not from a incognito window, not anything fancy. Just a simple browser window on a pc on the same network as your Home Assistant. Secondly. Xiaomi will ask for a verification (either email or phone). Don't treat your Xiaomi Accounts like garbage accounts that you created to join a giveaway. Ensure that your phone and email are in there and that you have actual access to these data. Thirdly. Go to HA > Configuration > Server Controls and reload XIAOMI_CLOUD_MAP_EXTRACTOR after you are done. Then give it a couple of minutes. |
Tried all of the above. |
@eXifreXi This is a problem with authentication in Xiaomi cloud. It is possible that this problem is on server side - a mechanism to prevent access to cloud in an "unofficial" way. Logs from map extractor won't help.
Yes, I had this problem once, but it disappeared after a reload and never appeared again.
It doesn't seem reasonable to integrate similar approach in HA, you would probably need to provide this data after every HA restart. The same problem also exists in different places:
|
@PiotrMachowski Thanks for clarifying! |
Is there a workaround for this problem? I tried modifying files e.g. xiaomi_cloud_connector.py hardcoding e.g. _serviceToken but it didn't help. (However, it is very likely that I missed something) |
The only workaround I found was to just make a new account and add the devices there. Worked like a charm. Make sure not to add your phone number to the account though, just your e-mail, it seems that if I add my phone number it believes I have 2FA on even though I do not have it, must be some change Xiaomi made. |
I can happily confirm this has worked in my case! Thanks @adocampo |
I just had the same issue and I didn't even have to accept any new TOS or anything within the app. Just starting the app and looking at the map there fixed the issue in HA. I guess you have to start the App once in a while (like once or twice a month) to avoid this issue. |
Hi. I've been trying to solve 2FA problem since june and gave up in august. But today I tryed again. I went to https://i.mi.com/#/setting and notification appeared, that my account was deactivated due to inactivity for 1 year. After activating it again, HA card started to work. Maybe it will help you too. |
Yes, it helped me. It started working again. |
This was exactly my issue, I logged into the site and it asked me to reactivate my account. Thank you. |
This solved my issue too. Just log in via the link and restart. It will work again! |
After many attempts, this worked for me:
|
I have 2 vacuums. 1 roborock and 1 viomi. The roborack is "cn" based and viomi "in" based. I don't have 2FA enabled. The integration had stopped working. After doing a password reset and agreeing to new terms the cn based roborock started working. The viomi which in based is unable to get the map. Here is the log. Log
|
@TroySK can you show your config? |
The first one doesn't work but the second one does. Earlier both used to work. Have tried to country blank and 'cn' for mop_p as well but still didn't work. |
Does any of them show 2FA message on the camera image? |
No, none of them ever did. Changing password helped enable the roborock but viomi doesn't work yet. |
@TroySK So this is not an issue related to your problem. Please check if there is already an existing issue related to your Viomi model |
@PiotrMachowski Thanks for looking into. I'll dig into the issues and hopefully will be able to get it working soon. 🙌 |
I have two roborock s5 vacuums and the map extractor has been working well for a year but today the cameras stopped loading and just display "Failed to retrieve map from vacuum". I tried the token extractor and got the 2FA warning. Successfully entered the code on the website. Tried the token extractor again and got the tokens no problem (they have not changed). Reloaded the map extractor integration. Restarted home assistant. Still no camera images. Log says:
|
Scan interval was already set to 60 sec but I'll set auto update to false and give the automation a go. Thanks. |
This has helped me as well, even without changing the password. Before confirming via the button in the pop-up (in https://account.xiaomi.com/fe/service/account/privacy ) I was getting 2FA error in Map Extractor, I was provided with a link in logs and the link seemingly worked fine (I got the code in the email, entered it, was forwarded to page with a single "OK" in it), but 2FA error did not go away. |
Just to say, this sorted it for me too! Thanks! |
add country: 'cn' it worked! |
Any way to easily and realiably surface that link in a timely manner when this incident occurs, it was quite the endeavour to dig it up from the logs. It also seems to have 1 link for each device. I had 3. |
Can confirm this works as intended. It took me a few clicks to the privacy part to get the authentication and prompt. |
The above mentioned steps didn't work for me. Is there any other ways? |
I'm having the same problem. I even tried logging from the Firefox add on. It can't get any more same IP then that. |
I've been successfully using the camera, map extractor, etc for over a year. It recently started giving me this error in the logs:
This error originated from a custom integration.
Logger: custom_components.xiaomi_cloud_map_extractor.common.xiaomi_cloud_connector
Source: custom_components/xiaomi_cloud_map_extractor/common/xiaomi_cloud_connector.py:86
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 8:45:59 PM (1 occurrences)
Last logged: 8:45:59 PM
Additional authentication required. Open following URL using device that has the same public IP, as your Home Assistant instance: https://account.xiaomi.com/identity/authStart?sid=passport&context=uTqPvO6apqW6eNzYVJGlecf1IdPlwCuf7s4kyGgAEEHJu8hAtr6hDE01YlWWNPJ1tlXWDxfLVW-XaF1FEclBzxl-WYSoMPDuPiSGPQu_kJfGzvjZ78EOMaHfXz9STWfcm2RxnfWkPN22ukly0MLQ-Q8YVb7lbyzW9ZiU7GNSlQGFHX1NKVBTa15-omitted last part for security
I pasted this address into a browser and it just came up "TIPS" on xiaomi help site?
Also the lovelace card reads:
"two factor authentication required (see logs)"
with this below:
"Your camera entity is not providing calibration_points
Enable calibration_points in camera entity or disable camera_calibration"
I had callibration points in my config so I removed it and am still getting the error and it won't load.
Here's the config I'm using:
camera:
- platform: xiaomi_cloud_map_extractor
host:
token:
username:
password:
I'm running
Any help would be greatly appreciated.
I just enabled info logging for the map extractor and will post the logs after reboot.
The text was updated successfully, but these errors were encountered: