Skip to content

Instantly share code, notes, and snippets.

@impressiver
Last active May 24, 2017 20:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save impressiver/175842e2e6272ae9a112c089a056cd19 to your computer and use it in GitHub Desktop.
Save impressiver/175842e2e6272ae9a112c089a056cd19 to your computer and use it in GitHub Desktop.
Pi 2 Wink Hub Homebridge

Wink Hub HomeKit bridge

... on a Pi 2, in 5 min.

don't be scared

pi@pi:~ $ sudo su -

dependencies

$ apt-get update
$ apt-get install avahi-utils libavahi-compat-libdnssd-dev
$ npm update -g
$ npm install -g node-gyp homebridge homebridge-wink
// browse for plugins: npm search homebridge-plugin

homebridge quickstart

$ useradd --system homebridge
$ mkdir /opt/homebridge
$ vim /opt/homebridge/config.json
--
{
  "bridge": {
    "name": "Homebridge",
    "username": "CC:22:3D:E3:CE:30",
    "port": 51826,
    "pin": "408-10-503"
  },

  "description": "Wink Hub homebridge",

  "accessories": [
  ],

  "platforms": [
    {
      "platform": "Wink",
      "name": "Wink",
      "client_id": "quirky_wink_android_app",
      "client_secret": "e749124ad386a5a35c0ab554a4f2c045",
      "username": "YOUR_WINK_EMAIL",
      "password": "YOUR_WINK_PASS",
      "hide_groups": [],
      "hide_ids": []
    }
  ]
}
--
$ chown -R homebridge:homebridge /opt/homebridge
$ vim /etc/default/homebridge
--
# Set homebridge config/data path
HOMEBRIDGE_OPTS=-U /opt/homebridge

# Uncomment for verbose logging (tail: journalctl -f -u homebridge)
# DEBUG=*
--

systemd service

$ vim /etc/systemd/system/homebridge.service
--
[Unit]
Description=Homebridge Server 
After=syslog.target network-online.target

[Service]
Type=simple
User=homebridge
EnvironmentFile=/etc/default/homebridge
ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target
--
$ systemctl daemon-reload
$ systemctl start homebridge
$ systemctl status homebridge
// If all looks good, enable service on startup
$ systemctl enable homebridge

logs

This is where you'll find the pin to register a HomeKit accessory.

$ journalctl -fu homebridge
--
...
Jun 03 01:49:56 piTV homebridge[6206]: Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
Jun 03 01:49:56 piTV homebridge[6206]:
Jun 03 01:49:56 piTV homebridge[6206]:     ┌────────────┐
Jun 03 01:49:56 piTV homebridge[6206]:     │ 408-10-503 │
Jun 03 01:49:56 piTV homebridge[6206]:     └────────────┘
Jun 03 01:49:56 piTV homebridge[6206]:
Jun 03 01:49:56 piTV homebridge[6206]: [Fri Jun 03 2016 01:49:56 GMT+0000 (UTC)] Homebridge is running on port 51826.
--

iOS Apps

Most of the apps I tried did not "find" the Homekit accessory when scanning.
Once initial pairing is complete, all the HomeKit apps I've tried can enumerate and interact with bridged devices.

Hesperus will link your bridge.

Explore

OG (Original Gist)

Homebridge
Wink plugin for Homebridge

npm plugin search
HomeKit over BLE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment