Skip to content
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

Update xiaomi (miio) retrieve token documentation #3872

Closed
wants to merge 2 commits into from

Conversation

drgx
Copy link

@drgx drgx commented Nov 2, 2017

Description:
Add easier way to retrieve miio token by using nodejs and miio package

Pull request in home-assistant (if applicable): home-assistant/home-assistant#

Add easier way to retrieve miio token by using nodejs
@arsaboo
Copy link
Contributor

arsaboo commented Nov 3, 2017

Those instructions are not working...can you please double check:

arsaboo@aloknuc:~$ sudo npm install --save miio
[sudo] password for arsaboo:
arsaboo@1.0.0 /home/arsaboo
└─┬ miio@0.13.0
  └─┬ mkdirp@0.5.1
    └── minimist@0.0.8

npm WARN arsaboo@1.0.0 No description
npm WARN arsaboo@1.0.0 No repository field.
arsaboo@aloknuc:~$ miio --discover
miio: command not found

@arsaboo
Copy link
Contributor

arsaboo commented Nov 3, 2017

Looks like the installation command should be npm install -g miio as indicated here https://github.com/aholstenson/miio/blob/master/docs/missing-devices.md

@syssi
Copy link
Member

syssi commented Nov 3, 2017

What about using python-miio (the underlying library of the component) and the provided tools of the upstream: https://github.com/rytilahti/python-miio#miio-extract-tokens

@drgx
Copy link
Author

drgx commented Nov 4, 2017

@arsaboo yaaa, it should be npm install -g miio why the hell i'm typing sudo npm install --save miio .... I think' I'm drunk 😕... sorry will fix it ASAP

@syssi I never try python-miio lib, but i'll try it and create another pull request when it's works

Add easier way to retrieve miio token by using nodejs
@drgx
Copy link
Author

drgx commented Nov 5, 2017

@arsaboo is this pull-request acceptable? or i need to create using python-miio?

@rytilahti
Copy link
Member

The described method of using the automatic discovery (which is what miio --discover afaik does) is also doable with python-miio (mirobo discover --handshake 1), but this way of extracting tokens only works on specific set of devices, and sometimes only when the device has not been previously connected with the official app. This in turn requires pointing those users to extract the tokens from backups / sqlite databases which is what the current documentation here explains: https://home-assistant.io/components/vacuum.xiaomi_miio/#retrieving-the-access-token .

The python-miio documentation is currently being reworked in this incomplete PR rytilahti/python-miio#93 which I hope can be used as a reference for an easy obtaining tokens: https://github.com/rytilahti/python-miio/pull/93/files#diff-3b734457dc9f0169aa39ce25f6b0c89aR36 . Unfortunately I do not have access to iOS devices, but I would happily accept contributions.

Considering homeassistant is using python-miio for supporting those devices (and its therefore installed for those users), it may make sense to avoid pointing users to install nodejs-based miio, which is to my experience not a simple feat to do e.g. on raspbian. Just my 0.05€ :-)

@drgx
Copy link
Author

drgx commented Nov 8, 2017

Thank you for the explanation @rytilahti. Yah based on your explenation, I think it's more make sense using python-miio since the users don't need to install nodejs. (IMO nodejs is easier becuase every day I work with nodejs 🤣)
I will close this pull request since there is a better solution using python-miio. 👍

@drgx drgx closed this Nov 8, 2017
@rytilahti
Copy link
Member

Ok! I will try to get the documentation ready and to be shipped hopefully this weekend, then we can modify the documentation to point to that :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants