Device plugin

The SmartThings app provides central control over an expanding line of IoT devices, from sensors to electrical outlets to TVs to appliances. To optimize global reach, the app runs on both Android and iOS platforms. To accommodate new IoT devices without having to update software, the app uses a plugin architecture and downloads device plugins on demand.

SmartThings app uses a default plugin for IoT devices that simply use predefined capabilities with built-in UI widgets. For these IoT devices, it is easier to use the Developer Workspace to integrate the device into SmartThings as no coding is needed. However if you need to customize the UI or behavior of your IoT device, you can use the JavaScript API for device plugins.

How SmartThings works

SmartThings Overview

  1. Developer creates a plugin for a device. The plugin is a web app, packaged as a PPK (Plugin Package) file. Plugins can be either uploaded to Samsung’s plugin store for external distribution, or self-published for internal testing.
  2. User activates a new device. To use SmartThings app, users must first log into Samsung Account to identify themselves. They can then pair the app with a nearby device.
  3. App downloads plugin. If the device’s plugin is not already preloaded or previously installed, the app downloads the plugin from the store. Developers can self-publish their plugins, and privately access them through a developer mode in SmartThings app.
  4. User controls device. When the plugin is launched, the user can monitor and control the device. Because the plugin is a web app, it can run on multiple platforms, like Android and iOS, without needing customization.
  5. Device handles commands. On the device, an app handles the user commands from the plugin, and sends status notifications back.

How plugins work

The plugin platform is a software framework that allows SmartThings app to extend and enhance even after it has been compiled and released. By dynamically downloading plugins only when necessary, the original app size of SmartThings can be kept small. This is an important feature that lets the app support a large number of possible devices while using only a few devices at a time.

SmartThings Plugin Platform

A plugin acts like an independent app within the SmartThings UI. It is separately packaged from SmartThings app as a PPK (Package Plugin) file, dynamically downloaded from the plugin store, and executed on demand. Because the plugin is a web app, it can be run on multiple OS platforms like Android and iOS.

About the developer tools

Through a device plugin API, a web app plugin can:

  • subscribe to events or status notifications from a device
  • set plugin data on the device
  • monitor the state of the connection with a device

Style guides

Use the below style guides and resources to create a user experience for the plugins you develop in Developer Workspace.

  • Visual design section provides recommendations of colors & icon usage, typography, and layout rules.
  • Design components section defines commonly used controls and images such as buttons, slider, picker, and error handling.