banner
半米牙

半米牙的笔记

分享技术、记录生活
email

Initialize HomeKit with Homebridge

Recently moved house and needed a power strip. Bought a Xiaomi smart power strip, which feels convenient to control with a phone. Noticed that Apple has its own Home App to manage smart homes, so wanted to try if Xiaomi's smart devices can be integrated into Apple's HomeKit. First, need to set up a HomeKit server.

Install Node.js and npm#

Node.js v10.x:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs

Install Compilation Components#

sudo apt-get install libavahi-compat-libdnssd-dev
sudo apt-get install build-essential libtool

Install HomeBridge#

sudo npm install -g --unsafe-perm homebridge

Add HomeBridge Configuration File#

Go to the directory:

cd ~/.homebridge/

Create a file:

vim config.json

Add:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    }
}

Save and exit:

wq!
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.