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.
How SmartThings works
- 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.
- 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.
- 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.
- 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.
- 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.
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
Use the below style guides and resources to create a user experience for the plugins you develop in Developer Workspace.