Using Home Assistant Integrated with Mi Home

 Recently, Xiaomi officially open-sourced a new project called “Home Assistant Mi Home Integration” on GitHub. The Mi Home integration is an integrated component of Home Assistant officially released by Xiaomi. After logging into the Mi Home account, you can use Xiaomi IoT smart devices in Home Assistant. The project address is https://github.com/XiaoMi/ha_xiaomi_home.

Introduction to Home Assistant

Home Assistant ( Official Website ) is an open-source smart home automation platform that manages and controls smart devices at home (supporting different brands such as IKEA, Philips, Amazon, etc.) through a unified interface (web page, mobile client), and also supports automation settings, allowing you to create smart scenes according to your own needs.

Before this, integrating Mi Home devices into Home Assistant was a very complicated and device-selective task, but it will be different in the future. Let’s try using the Home Assistant Mi Home integration on K1 today.

Integration

First, you need to install Home Assistant. After running hass, a configuration folder named .homeassistant will be generated in the home directory. We enter this folder to start installing the Mi Home integration.

cd ~/.homeassistant 
git clone https://github.com/XiaoMi/ha_xiaomi_home.git
cd ha_xiaomi_home
./install.sh../

After completion, restart hass.

Configuration

1. Log in

Find Settings > Devices & Services > Add Integration > Search for “Xiaomi Home” > Next > Please click here to log in > Log in with your Mi account.

 The login authorization requires a callback to the address homeassistant.local:8123. We need to configure this address in the system’s host. Since I am connecting to K1 via ssh and my K1 device is 192.168.3.138, the configuration in the host is as follows:

homeassistant.local 192.168.3.138

If you are operating on the K1 device itself, then it is:

homeassistant.local 127.0.0.1

The host configuration is now complete. Log in with your Xiaomi account following the process. 

Add MIoT Devices

After successful login, a session box “Select Home and Devices” will pop up. You can select the Mi Home family that needs to be added, and all the devices in that family will be imported into Home Assistant. 

Device Control

Now you can control Xiaomi devices in Home Assistant. 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top