Skip to content

Add Xiaomi router device tracker documentation #1751

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

Merged
merged 1 commit into from
Jan 14, 2017
Merged

Add Xiaomi router device tracker documentation #1751

merged 1 commit into from
Jan 14, 2017

Conversation

RiRomain
Copy link
Contributor

@RiRomain RiRomain commented Jan 12, 2017

Description: Documentation for new component Xiaomi Device Tracker

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

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🐦

@fabaff fabaff added the new-integration This PR adds documentation for a new Home Assistant integration label Jan 14, 2017
@fabaff fabaff merged commit 85f0b5e into home-assistant:next Jan 14, 2017
@joaoasilva
Copy link

Hi,

After some time, for some reason the plugin doesn't refresh the token:

17-01-18 10:53:37 homeassistant.components.device_tracker.xiaomi: No list in response from mi router. {'msg': 'Invalid token', 'code': 401}
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/device_tracker/xiaomi.py", line 139, in _extract_result
return result[key_name]
KeyError: 'list'

Thanks

@RiRomain
Copy link
Contributor Author

Hi @joaoasilva ,

Which Xiaomi device are you using? With which firmware?

On my Xiaomi Mini, as long as the token is reused, he seems to be kept alive and considered valid by the router. It might be different on other Xiaomi router/Firmware.

I'll see to implement a token refresh method.

@joaoasilva
Copy link

Xiaomi router 3. Oh, maybe it's because I have the auto-restart everyday at 5am?
A token refresh method would be awesome though, please. :)

Thanks!

@RiRomain
Copy link
Contributor Author

A yes that make sense, after the restart the token is not valid anymore.

I will implement a refresh method. If it fails, the program will search a new token and retry to get the list one more time.

@RiRomain
Copy link
Contributor Author

@joaoasilva Good news, the change where merged in the dev branch:
home-assistant/core#5437

The correction should therefore be available to you at the beginning of February with the next home-assistant release (0.37)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-integration This PR adds documentation for a new Home Assistant integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants