homebridge-smartthings-tonesto7

This is based off of @pdlove homebridge-smartthings

npm version

Current SmartApp version: 1.1.6


Change Log:

SmartThing App:

v1.0.0 - Overhauled JSON API app from Paul's SmartThings version.

v1.0.1 - SmartHomeMonitor Support is set to Off by Default.

v1.1.3 - App Cleanups. Added lot's of features.

v1.1.4 - Removed Hampton Fan input (No longer Necessary with My modified Device Handler).

v1.1.5 - Disabled Irrigation for now until i can make it work more consistent.

v1.1.6 - Command Tweaks to prevent errors.

Homebridge Plugin:

v1.1.5 - Lot's of new capabilities supported in HomeKit

v1.1.7 - Updated the README

v1.1.8 - Cleanup of the Irrigation code

v1.1.9 - Forgot to remove some logging

v1.2.0 - Added in capability exclusion feature to match @pdlove plugin


This version is not compatible with prior versions of homebridge-smartthings Smartapp.

Direct Updates from SmartThings

  • This method is nearly instant.
  • This option allows the hub to send updates directly to your homebridge-smartthings installation.
  • The hub must be able to send an http packet to your device so make sure to allow incoming traffic on the applicable port.
  • The port used for this can be configured by the "direct_port" setting and defaults to 8000.
  • The program will attempt to determine your IP address automatically, but that can be overridden by "direct_ip" which is useful if you have multiple addresses.
  • As a note, the hub isn't actual doing any of the processing so if you lose Internet, updates will stop. I'm told it "doesn't currently" support it, so there is hope.

When properly setup, you should see something like this in your Homebridge startup immediately after the PIN:

[1/29/2017, 8:28:45 AM] Homebridge is running on port 51826.
[1/29/2017, 8:28:45 AM] [SmartThings] Direct Connect Is Listening On 10.0.0.70:8000
[1/29/2017, 8:28:45 AM] [SmartThings] SmartThings Hub Communication Established

Installation

Installation comes in two parts:

1. SmartApp Installation

  • Log into your SmartThings account at SmartThings IDE

  • Click on My SmartApps

  • Click on Settings and Add the New repository:

    • Owner: tonesto7
    • Name: homebridge-smartthings-tonesto7
    • Branch: master
    • Click Save.
  • Click Update From Repo

    • Select homebridge-smartthings-tonesto7
  • You should have homebridge-smartthings.groovy in the New section.

    • Check the Box next to homebridge-smartthings.groovy
    • Check Publish at the bottom
    • Click Execute Update.
  • Click on the Homebridge-SmartThings app in the list:

    • Click App Settings
    • Scroll down to the OAuth section and click Enable OAuth in Smartapp
    • Click Update at the bottom.

2. SmartApp Configuration

  • In the SmartThings Mobile App, goto Marketplace and select SmartApps.

  • At the bottom of the list, select My Apps

  • Select Homebridge (SmartThings) from the choices on thelist.

  • Configuring the App:

    There are 4 inputs at the top that can be used to force a device to be discovered as a specific type in HomeKit

    Any other devices being added just Tap on the input next to an appropriate device group and then select each device you would like to use (The same devices can be in any of the Sensor, Switch, Other inputs)

    • There are several categories because of the way SmartThings assigns capabilities. So you might not see your device in one, but might in another.
    • Almost all devices contain the Refresh capability and are under the "Other Devices" group
    • Some sensors don't have a refresh and are under the "Sensor Devices" group.
    • Some devices, mainly Virtual Switches, only have the Switch Capability and are in the "Switch Devices".

    Selecting the same device in multiple categories it will only be shown once in HomeKit, so you can safely check them all in all groups

  • Tap Done

  • Tap Done You are finished with the App configuration!


3. Homebridge Plugin Installation:

  1. Install homebridge using: npm i -g homebridge (For Homebridge Install: Homebridge Instructions)
  2. Install SmartThings plugin using: npm i -g homebridge-smartthings-tonesto7
  3. Update your configuration file. See sample config.json snippet below.

Config.json Settings Example

Example of all settings. Not all settings are required. Read the breakdown below

{
   "platform": "SmartThings", 
   "name": "SmartThings",
   "app_url": "https://graph.api.smartthings.com:443/api/smartapps/installations/",
   "app_id": "YOUR_APPS_ID",
   "access_token": "THIS-SHOULD-BE-YOUR-TOKEN",
   "polling_seconds": "3600",
   "update_method": "direct",
   "direct_ip": "10.0.0.70",
   "direct_port": 8000,
   "excluded_capabilities": {
       "SMARTTHINGS-DEVICE-ID-1": [
          "Switch",
          "Temperature Measurement"
       ]
   }
}
  • platform & name Required
    This information is used by homebridge to identify the plugin and should be the settings above.

  • app_url & access_token Required
    To get this information, open Homebridge (SmartThings) SmartApp in your SmartThings Classic Mobile App, and tap on "View Configuration Data for Homebridge"
    Notice: The app_url in the example above may be different for you.

  • direct_ip Optional
    Defaults to first available IP on your computer
    Most installations won't need this, but if for any reason it can't identify your ip address correctly, use this setting to force the IP presented to SmartThings for the hub to send to.

  • direct_port Optional
    Defaults to 8000
    This is the port that homebridge-smartthings plugin will listen on for traffic from your hub. Make sure your firewall allows incoming traffic on this port from your hub's IP address.

  • excluded_capabilities Optional
    Defaults to None
    Specify the SmartThings device by ID and the associated capabilities you want homebridge-smartthings to ignore
    This prevents a SmartThings device creating unwanted or redundant HomeKit accessories