SmartThings is owned by Samsung and their primary products include a free SmartThings app, a SmartThings hub, as well as various sensors and smart devices. SmartThings has an open development platform for smart homes and the consumer Internet of Things to connect with SmartThings.
SmartThings Platform connects a hub to communicate with all of your different sensors and devices that make your environment smart. You can easily monitor, control, and automate your lights, locks, temperature, and more from anywhere.
In this recipe we explore the the first part of connecting and flowing device data into the Watson IOT platform
Preparing your SmartThings platform
- Please follow steps in Setting up an account, the Hub, and Things to setup and connect your devices to SmartThings Platform
- Identify the device (ie. switch & sensors) that are connected to the Hub.
- Edit the Label of device and provide a specific label (ie. Main Bulb) for easier reference. This allows command send to control specific device by name
- Go to specific device from My Devices page
- Look for the field Label to find the display name of the device
- Click on Edit button on the bottom of the My Devices page
- Edit the Label for the required name (ie. Main Bulb) and click on Update to save changes
Create IBM Watson IoT Platform Organization
Create IBM Watson IoT Platform Organization by following Step 2 (Create IBM Watson IoT Platform Organization) in the recipe.
Generate the Organization ID, Authentication Token and API Key from IBM Watson IoT Platform
Obtain the Organization ID, Authentication Token and API Key from IBM Watson IoT Platform. An API Key can be generated using the Step 3 (Register your Device) in the recipe.
At this step, we have successfully generated the Organization ID, Authentication Token and API Key from IBM Watson IoT Platform.
Connect SmartThings platform with IBM Watson IoT Platform
This key step is accomplished by an IBM Watson IOT bridge SmartApp available in the GitHub. Follow the instructions there to create and publish the IOT bridge SmartApp. You will need to login to your SmartThings platform with your id and password for those steps. Once the IOT bridge SmartApp is available there you can do the following steps from your mobile device.
Add the SmartApp (IBM Watson IoT Bridge) into SmartThings Mobile App to connect to IBM Watson IoT Platform. Once configuration is done, device(s) will be automatically added into IBM Watson IoT Platform through the SmartApp.
- Create IBM Watson IoT Bridge into SmartThings Platform via a web browser in desktop
- Follow steps in Configure to add Organization ID, API Key, Authentication Token via SmartThings Mobile App in your smartphone
- IBM Watson IoT Bridge is created in Marketplace > SmartApps > My Apps
- Follow steps in configure-device-access to add more devices when more switch, bulb or sensor are added or removed in future
- By now, you should able to see the IBM Watson IoT Bridge application listed when you navigate to My Home > SmartApps
At this step, device type is created and devices are automatically registered in IBM Watson IoT Platform
In this recipe we demonstrated how to connect smart devices from SmartThings Platform to the Watson IoT Platform in Bluemix. Events from device are streamed in real time when state changes are detected. This is achieved through a customizable SmartApp with the Watson IoT Platfom ReST API.
As a next step, there are several possible extensions to this recipe to try out, for example:
- Passing the change of events to Node-RED to be stored in database
- Sending command to devices with a switch capability to turn on/off based on a rule or a condition
We acknowledge the help of Jordan Moore (from IBM) and David Ramirez (from Jefferson.edu) for making this scenario possible.