Gearbest super deals

How to connect Xiaomi smart home kit and Apple HomeKit

ByAdan Flannigan 2019-07-23 45578

About HomeKit and Smart Home, Apple was trying to create a very brainwashing ecosystem as early as iOS 8. However, after opening the Apple Store, you will find that mose Xiaomi smart devices Apple don't offers. Well, there are two ways that you can connect HomeKit and Xiaomi Smart Kit with an old computer or an Android phone.

Xiaomi Smart Kit 

About Xiaomi Smart Kit

Xiaomi Smart Kit 

● Mijia Multifunction Gateway x 1

● Mijia Smart socket (Zigbee Edition) x 1

● Mijia wireless switch x 1

● Mijia human body sensor x 1

● Mjjia door & window sensor x 1

A number of accessories are included (back glue, button needle, manual / three packs of documents)

Of course, in addition to this, there are other different types of smart homes in Xiaomi Mall, such as smoke alarms, temperature and humidity sensors and so on. I don't introduce them here, I can buy them according to my own needs. But please note that a smart gateway is a must.

Connect to HomeKit Method 1:

The method 1 is to use a computer that does not shut down. Linux, Mac, and Windows can all build HomeBridge. Since I only use macOS, I will follow the tutorial on macOS.

Step 1 : install Xcode

The latest version of Xcode can be downloaded from MAS.

Step 2 : install Node.js

Node.js There are Windows versions, macOS versions, and Source Code available for download. The website should not be downloaded by the wall.

Note: Node.js must be installed or the following steps will not work.

Step 3: install Homebridge

You need to open the terminal on your Mac. If you can't find it, you can open it by focusing on the search input terminal.

Open it and enter it inside   Sudo npm -g install homebridge

After the terminal has been scrolling for a long time, long after a long time, when your terminal displays the image, it is already installed.

Step 4: download the Mijia App.

download the Mijia App

In the application you can choose to add existing accessories.

add existing accessories 

Then click on the smart gateway - Three white dots in the upper right corner - on

Crazy click on the white blank area until new information appears.

At this time we need to click on the LAN communication protocol and refresh it to open the refresh password. This is the Sid to be used later.

Then return to the previous menu, click on the gateway information , find the mac in the dense text, you will find that there is a relevant gateway address. Remember this, it is recommended to copy it in other applications (remove the (:) symbol and change it to lowercase). This is the password to be used later.

relevant gateway address 

Step 4: create a new configuration file

Then we will create a new configuration file that you can choose to copy to the terminal. Please don't forget to change "Username" to your computer username. (Segmented input)

Cd ~

Mkdir .homebridge

Nano .homebridge/config.json

Then we need to configure the json file

You can choose to copy the code below to the terminal.

copy the code  

In this code, name can be customized; username is not recommended to modify; port can be customized, as long as it is not occupied; pin can be customized, the format needs to be saved as xxx-xx-xxx; sid is The LAN communication protocol mentioned above, password is the gateway information.

After copying is complete, you can enter Command + O to save, then enter Command + X to exit the edit mode and return to the terminal window.

Step 5: run HomeBridge

Continue to input in the terminal (segment input)



When you see the QR code as shown below or a number appears, it means the operation is successful. (The number is the password you set in the json file)

You can choose to scan the QR code or add a number using the add-on accessory in the Home App.

Then you can add gateways and other accessories to Home and use them happily.

Note: Of course you may encounter different errors. Here are some of the problems you will encounter.

Q: What should I do if the terminal installs Homebridge with a loop code error?

A: If you are a macOS High Sierra user, use   Sudo npm -g install homebridge   The installation will show the error below. So please change the input   Sudo npm -g install homebridge --unsafe-perm   Install it.

installation failed

Q: What should I do if I run HomeBridge?

A: Check if the Pin file in the configuration file is wrong, check (gateway mac) and (LAN protocol password (mainly pay attention)), after success, it will jump out of the small box, in fact, just configure the pin file number in config.json .

Q: Home display accessories have been added, need to be reset, what should I do?

A: After modifying the username and pin files in the config.json file, go through it again.

Connect to HomeKit Method 2:

Method 2 uses an idle Android device as the smart home hub. Required equipment: 1. Rooted Android device, one computer, Xiaomi multi-function gateway.

The software you need to download is: Linux Deploy, BusyBox (Android); Xshell, Xftp, Termius, VNC Viewer (PC/Mac/Chrome Store) Note: Other software can be used instead

Note: Android recommends using Lineage OS or other native system ROM, please also avoid running out of background background is killed, if there is automatic cleaning or super power saving function, please set a white list to avoid being killed.

Step 1: install BusyBox

Just click "Install" and you're done.

Connect to HomeKit Method  

Step 2: configure Linux Deploy

Open the software and click on the top left corner of the screen to open the menu bar - Settings - Update Environment

Connect to HomeKit Method  

Step 3: install Linux Deploy

Root permissions are necessary, and the first step of BusyBox can't be omitted. If your Android device is 6.0 and above, you need to give Linux Deploy access to storage permissions within the app permissions settings.

Opening Linux Deploy will see a default configuration, which needs to be modified here.

Release, default Debian modified to Ubuntu

The architecture is optional by default or adjusted to arm 64

The source address can be modified

The username and password can be defaulted, and if you forget, you can return to the App to view it.

Connect to HomeKit Method  

Connect to HomeKit Method  

Check "Allow SSH server to start"

After setting, return to the main interface and click on the three white points in the upper right corner to select the installation.

After waiting for a while, you can see the Deploy character, which is almost successful.

Then click Start and wait until Start appears to Okay.

At this point, the operation on the phone has been temporarily over, and the rest will be transferred to the computer.

Step 4: install HomeBridge

● Ready to work

Ubuntu deployed with this software defaults to not installing the curl command, which requires a manual installation:

Sudo apt-get install -y curl

● Directly use the script provided by the official website (you can go to the official website provided above to choose)

Curl -sL | sudo -E bash -

Sudo apt-get install -y nodejs

● Install the Avahi dependency package

Also one of the must-have tools

Sudo apt-get install libavahi-compat-libdnssd-dev

● Install HomeBridge

Sudo npm install -g --unsafe-perm homebridge

Next execute the following command to create a configuration file for HB.

Mkdir ~/.homebridge

Cd ~/.homebridge

Nano config.json

Sudo apt-get install nano

Here is an example that is the same as the one I asked, remember to modify:

You can choose to copy the code below to the terminal.

Connect to HomeKit Method  

In this code, name can be customized; username is not recommended to modify; port can be customized, as long as it is not occupied; pin can be customized, the format needs to be saved as xxx-xx-xxx; sid is The LAN communication protocol mentioned above, password is the gateway information.

After copying is complete, you can enter Command + O to save, then enter Command + X to exit edit mode.

Unlike Mac, you need to pay attention before running Linux Deploy.

First edit the configuration file for the avahi-daemon service.

Sudo nano /etc/avahi/avahi-daemon.conf

We need to comment out all the parameters of publish in the document, and add the # before the corresponding configuration item.

.Connect to HomeKit Method

Then you need to modify the startup parameters of the avahi-daemon service.

Sudo nano /etc/init.d/avahi-daemon

Find the place to start the service d start ( ) This section, add the --no-drop-root parameter after $DAEMON.

Connect to HomeKit Method ​ 

Try to start the service manually after you have finished.

Sudo /etc/init.d/dbus start

Sudo /etc/init.d/avahi-daemon start

If both services are started successfully, you can try to start the HB service, that is, run directly:


 You may also want to read:
 All we know about the AMAZFIT GTR smartwatch
 Xiaomi Qin 2 student feature phone starts crowdfunding
 AMD R9 3950X and Intel i9-9900KS will be released in October

Gearbest Clearance sale

Extensive Product Selection

● Over 300,000 products

● 20 different categories

● 15 local warehosues

● Multiple top brands

Convenient Payment

● Global payment options: Visa, MasterCard, American Express

● PayPal, Western Union and bank transfer are accepted

● Boleto Bancario via Ebanx (for Brazil)

Prompt Shipping

● Unregistered air mail

● Registered air mail

● Priority line

● Expedited shipping

Dedicated After-sales Service

● 45 day money back guarantee

● 365 day free repair warranty

● 7 day Dead on Arrival guarantee (DOA)

You might also like