formats

How to install Homebridge on a Raspberry Pi and integrate with Smartthings

How to install Homebridge on a Raspberry Pi and integrate with Smartthings:

1- You need to install your Raspberry Pi

  • Install your Pi by following these instructions: https://www.raspberrypi.org/help/noobs-setup/

2- Install Node.js on the Raspberry Pi

  • wget https://nodejs.org/dist/v5.2.0/node-v5.2.0-linux-armv7l.tar.gz
  • tar -xvf node-v5.2.0-linux-armv7l.tar.gz
  • cd node-v5.2.0-linux-armv7l
  • sudo cp -R * /usr/local/
  • To check Node.js is properly install and you have the right version, run the command:
  • node –v

3- Install the latest version of NPM

  • sudo npm install npm -g

4- Install Homebridge on the Pi

  • https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi
  • sudo npm install -g homebridge
  • sudo npm install -g homebridge-legacy-plugins

5- Login to the SmartThings IDE (https://graph.api.smartthings.com) and create a JSON API SmartApp

Login using your SmartThings account that you created as part of the SmartThings kit/hub install.

Goto the ‘My SmartApps’ tab

Click ‘+ New SmartApp’ button top right

Click ‘From Code’

In another browser window, go here:

https://github.com/jnewland/SmartThings/blob/master/JSON.groovy

click the ‘Raw’ button

Select all the code (Ctrl-A) and copy it (Ctrl-C)

Go back to the SmartThings IDE window and paste the code you just copied into the code window.

  • Click ‘Create’
  • Click ‘App Settings’
  • Click ‘OAuth’
  • Click ‘Enable OAuth in Smart App’ leave all settings as defaults
  • Click ‘Update’
  • Click ‘Publish’ and ‘For Me’

6- Install the new JSON API SmartApp in SmartThings

Load the SmartThings app on your iPhone.

Go to the ‘Marketplace’ by tapping the icon in the bottom right (blue, green and yellow icon that looks a bit like a star).

Tap ‘My Apps’

Tap ‘JSON API’

You can now select any of devices that you may want to control with HomeKit.

Tap ‘Config’

The next screen should then display the configuration that we need to use in the Homebridge server. It should look something like this (I’ve replaced the actual keys with xxx):

{
"description": "JSON API",
"platforms": [
{
"platform": "SmartThings",
"name": "SmartThings",
"app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"access_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
]
}

Tap ‘Done’

7- Setup a config.json file for Homebridge

  • Connect to your Raspberry Pi:
  • cd /home/pi/.homebridge
  • sudo vi config.json

Sample File:

{
"bridge": {
"name": "Homebridge",
"username": "XX:XX:XX:XX:XX:XX",
"port": 51826,
"pin": "XXX-XX-XXX"
},
"description": "JSON API",
"platforms": [
{
"platform": "SmartThings",
"name": "SmartThings",
"app_url": "https://graph.api.smartthings.com:443/api/smartapps/installations/",
"app_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxx"
}]
}

  • Now we can start the Homebridge server by running: Homebridge

8- Install plugins (https://www.npmjs.com/search?q=homebridge-plugin)

These are the ones that I tried and it's respective npm commands:

  • npm i homebridge-lifx
  • npm i homebridge-wakeonlan
  • npm i homebridge-platform-wemo
  • npm i homebridge-lifx-lan
  • npm i homebridge-thermostat
  • npm i homebridge-samsungtv
  • npm i homebridge-people

9- Add HomeKit to iOS

HomeKit is actually not an app; it's a "database" similar to HealthKit and PassKit. You can try iDevice, Eve or Devices to be able to discover "homebridge" on your network.

When you attempt to add Homebridge, it will ask for a "PIN code". The default code is 031-45-154

10- Remote Access (outside the home network):

If you own a third-generation Apple TV or newer, HomeKit accessories can be controlled with an iOS device away from home, even when Wi-Fi or Bluetooth are not available and you're using a phone's cellular connection.

Instructions:

  • Disable 2-factor authentication
  • On Apple TV, sign out of iCloud and iTunes Store
  • Sign back on on both iCloud and iTunes Store
  • Verify that you can access Homekit from outside the home network (turn off wifi on your iphone)
  • Re-enable 2-factor authentication
     
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
Comments Off on How to install Homebridge on a Raspberry Pi and integrate with Smartthings  comments 
formats

Tip: have iPhone’s LED flash light up when pinging it from your Apple Watch

Owners of the Apple Watch can easily find their misplaced iPhone by tapping a dedicated icon on the Settings glance, which will cause the connected iPhone to emit a high pitched sound. I’ve been using this trick since the Apple Watch came out to locate my iPhone, which shows an unnerving tendency to disappear under a pile […]

from iDownloadBlog.com http://ift.tt/20yn72B
via IFTTT
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
Comments Off on Tip: have iPhone’s LED flash light up when pinging it from your Apple Watch  comments