SmartThingsCommunity / slack-nodejs-workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slack SmartThings Integration

Local Setup

  • Git
    • Install git
    • Clone this repo or a fork locally
      • git clone git@github.com:SmartThingsCommunity/slack-nodejs-workshop.git
    • Checkout the start branch
      • git checkout start
  • Node

AWS Setup

  • Create AWS Account
  • Install and configure aws-cli
    • Credit card is required, but we will be using services offered in the free tier
      • S3 isn't free, but is optional and rather cheap

SmartThings Setup in Browser

  • Create a Simulated RGB Bulb
    • Navigate to the legacy developer portal
    • Enter Simulated RGB Bulb for Name
    • Enter Simulated RGB Bulb for Device Network Id
    • Select Simulated RGB Bulb for Type
    • Select one of your locations to install the device on
      • If no locations navigate to location list, this will redirect you to the correct shard
    • Click Create

You should be able to modify the state (on/off, color) of this simulated device through the UI in the mobile application. This will be useful for testing your integration

SmartThings Setup in App

  • Download and open the iOS/Android SmartThings Mobile App

Slack Setup

  • Navigate to your Slack Apps
    • If you don't have a Slack workspace yet, click sign in to your Slack account and then Create a new workspace (here)
    • Input an email for your workspace, then input the 6 digit code that Slack will email to you
    • Give your workspace a name, like SmartThings IoT Fuse
    • For a project name, go with something like SmartThings-Slack
    • Skip adding teammates
    • Your workspace is created! You can log into it in the Slack app for desktop or just keep it open in a browser tab
  • Click sign into your Slack account
  • Click Create New App
    • Name the app ThingsBot
    • For Development Slack Workspace, select the workspace you just logged into from the drop down
    • Create the app
  • Scroll to the bottom of the Basic Information section for your app
    • Under Display Information, click Add app icon
      • Upload this bot icon image from this repo to give your ThingsBot some identity (feel free to find your own bot face image if you'd prefer)
  • Navigate to Install App in the Slack API website sidebar
    • Click Install App to Workspace
    • Authorize the app
  • Navigate to OAuth & Permissions in the Slack API website sidebar
    • Click "Add New Redirect URL"
    • Add your API Gateway URL as a redirect URL
    • Click Save URLs
  • Navigate to Interactive Components in the Slack API website sidebar
    • Flip the Interactivity switch to On
    • For the Request URL, input <YOUR_API_GATEWAY_URL>/slack/receive
    • Click Save Changes

cd lambda

About


Languages

Language:JavaScript 100.0%