This example SmartApp demonstrates the use of SmartThings APIs via the SmartApp NodeJS SDK to achieve an Automation.
It showcases:
- App installation and configuration flow.
- Creating schedules and handling scheduled executions.
- You can test the operation of the sensors in the SmartThings Start Kit.
- If you have any camera devices, you can configure the Camera Image by Frontent Project Repository
- A Samsung account and the SmartThings mobile application.
- A Developer Workspace account.
- SmartThings Startter kit devices
- Node.js and npm installed (verified with npm version 6.14.8 and Node 12.19.0).
- ngrok installed to create a secure tunnel and create a globally available URL for fast testing.
This smartapp is a simple web server that can be used to run and test locally.
Clone or download this repository and follow the desired option.
-
Install the dependencies for this app:
npm install
. -
Start the server:
npm start
. -
Start ngrok (in another terminal window/tab):
ngrok http 3005
. Copy thehttps:
URL to your clipboard.
Follow the instructions for registering a SmartApp with the SmartThings platform.
- The following OAuth2 scopes are required.
r:devices:*
x:devices:*
After you finished registering the SmartApp, You can see that an event occurs every time the device operates.
If you have a camera, you can check the picture in the project if you register the device and follow the Frontend Project Repository to run an additional project.
- Documentation for developing SmartApps can be found on the SmartThings developer portal.
- SmartThings API reference documentation