Open solvek opened 1 year ago
Basically what I eventually need to achive just for my each device get information whether it is currently online (or when it was online recently) from my python script. Is it possible?
Version 0.6 changed how the cli works and I've forgotten to update the documentation. Now you have to specify what command you want to run:
Usage: micloud [OPTIONS] COMMAND [ARGS]...
Tool for fetching xiaomi cloud information.
Options:
-d, --debug
--help Show this message and exit.
Commands:
get-devices Get device information, including tokens.
miot Commands for miotspec fetching.
Your example would be:
micloud get-devices -u <email> --pretty
or if you want the debug output:
micloud -d get-devices -u <email>
I'll update the documentation asap.
Thanks. Tried this command
micloud get-devices
It asked for username then password. I provided both but then received error:
Error: Got unexpected extra argument (get-devices)
I cannot reproduce that error running Python 3.11.0 and micloud 0.6 installed by pip.
What basically is username for xiaomi? Will email work?
Yes email should work. Also check if you are effected by issue #6 edit: wrong issue link
It seems on the login step 2 server returned unexpected json content.
{
"notificationUrl":"https://account.xiaomi.com/identity/authStart?...&_locale=en_US",
"result":"ok",
"code":0,
"captchaUrl":null,
"description":"\u6210\u529f",
"location":"",
"securityStatus":16,
"pwd":0,
"child":0,
"desc":"\u6210\u529f"
}
But it expects to have json attributes userId
, ssecurity
and so on.
Seems to be a similar problem, did you try going to the "notificationUrl" in a browser as described in issue #6 ?
Seems to be a similar problem, did you try going to the "notificationUrl" in a browser as described in issue #6 ?
Yes, but the content in the page is different.
I do verification and getting "ok" on web page but still login from python code does not work for me.
I'm having the same problem as @solvek described. Completing the two factor authentification by following the url back steps in #6 didn't help. Specifically, when I run micloud
again to login, it returns to the same situation.
The installed version is 0.6 Trying commmand line from the example:
!micloud -d -u '<Email Login>' --country 'cn' --pretty
The output:Error: no such option: -u
The code:
The most recent command returns such error:
ERROR:root:Cannot execute request. service token or userId missing. Make sure to login.
Just for information: I am running the code in Google Colab