BOOMER74 / node-red-contrib-mihome

Add nodes to get data from devices connected to Mi Home
MIT License
2 stars 0 forks source link

Mi Home: Cloud: Login step 2 failed #2

Closed pastukhov closed 3 years ago

pastukhov commented 3 years ago

Common Info

Describe the bug

I'm trying to use it with nodered/node-red:1.3.3-12

and get Mi Home: Cloud: Login step 2 failed

How can i fix it?

BOOMER74 commented 3 years ago

Hello. Step 2 directly related to login and password authorization. Please check if you enter your login and password correctly (the same as what you enter in Mi Home app). If it's OK try to run node-red with node-mihome debugging like DEBUG=mihome:micloud node-red.

pastukhov commented 3 years ago

Thsnks for the reply With DEBUG i'm getting:


2021-04-27T16:03:44.400Z mihome:micloud Login step 1: OK - &&&START&&&{"serviceParam":"{\"checkSafePhone\":false,\"checkSafeAddress\":false,\"lsrp_score\":0.0}","qs":"%3Fsid%3Dxiaomiio%26_json%3Dtrue","code":70016,"captchaUrl":null,"callback":"https://sts.api.io.mi.com/sts","location":"https://account.xiaomi.com/fe/service/login?_json=true&sid=xiaomiio&qs=%253Fsid%253Dxiaomiio%2526_json%253Dtrue&callback=https%3A%2F%2Fsts.api.io.mi.com%2Fsts&_sign=XXXXXXX&serviceParam=%7B%22checkSafePhone%22%3Afalse%2C%22checkSafeAddress%22%3Afalse%2C%22lsrp_score%22%3A0.0%7D&showActiveX=false&theme=&needTheme=false&bizDeviceType=","securityStatus":0,"pwd":0,"_sign":"XXXXXXX","sid":"xiaomiio","desc":"登录验证失败"}

2021-04-27T16:03:45.306Z mihome:micloud Login step 2: OK - &&&START&&&{"notificationUrl":"https://account.xiaomi.com/identity/authStart?sid=passport&context=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&_locale=en_US","code":0,"captchaUrl":null,"location":"","securityStatus":1,"pwd":0,"desc":"成功"}

27 Apr 16:03:45 - [error] [mihome-cloud:4207460f.70c558] Mi Home: Cloud: Login step 2 failed```
BOOMER74 commented 3 years ago

Do you have 2FA activated? As I see node-mihome don't have 2FA support at now (unfortunately Xiaomi account don't have options to generate application passwords). Try to disable 2FA and check again.

pastukhov commented 3 years ago

 No, i have no 2FA enabled

BOOMER74 commented 3 years ago

As seem you enter incorrect login (in first step desc field translation of 登录验证失败 - Login verification failed). What do you use as login? If it's phone try to enter full number with country code, like +79123456789. Or try to change password and enter with new one.

pastukhov commented 3 years ago

Поменял пароль, логинюсь с ним из браузера и ми хоума. в качестве логина и почту и телефон попробовал

BOOMER74 commented 3 years ago

Проверил на чистой усновке node-red (конфиг для Docker теперь есть в репозитории), вход по Email работает корректно. Некоторые также сталкиваются с такой проблемой, например тут https://github.com/Maxmudjon/Get_MiHome_devices_token/issues/3. Возможно также стоит создать баг в https://github.com/maxinminax/node-mihome/issues (работа с Mi Home построена на этом пакете).

pastukhov commented 3 years ago

Ок, поизучаю. Спасибо за помощь!