Xiaomi platform is supported since version 0.50; it becomes very easy.
关于获取mac和key,这个帖子的讲述非常清晰。不过下面的配置部分就不必那么麻烦了。
https://bbs.hassbian.com/thread-31-1-1.html
# ~/.homeassistant/configuration.yaml
xiaomi:
gateways:
- mac:
key: xxxxxxxxxxxxxxxx