Integrating SmartThing's automation requires an understanding of the SmartApp lifecycle and implementing its protocol. The SmartThings nodes provided in the Automation Studio allows you to wire installed devices to implement autorun rules without any code. Or simply deploying an Automation node that implements the SmartApp lifecycle without coding. Event nodes for device subscriptions, Status nodes for device status checks, and Command nodes for device commands are provided.
In general, the SmartThings Automation is designed in the following order.
- Place the Device Profile node and determine the required capability.
- Enter the web-hook URL through the Automation node.
- After that, implement the logic that corresponds to the autorun rule.
- You can read the state of the device through the Status node.
- You can command the Device by placing an Command node.
- You can extend the experience using external APIs.
It's a SmartThings Automation using ContactSensor and LIFX Bulb
- Add a device profile node for the ContactSensor with contactSensor capability.
- Add a device profile node for the Bulb with a switch capability.
- Add a node for the SmartThings Automation (webhook).
- Add an event node to subscribe to the ContactSensor change.
- Add status nodes to check the Switch is "Off".
- Add command nodes to change the Bulb to "On".
- Add command nodes to change the Bulb "Off".
- Save and Deploy
In order for SmartThings Automation to work, you must register WebHook through SmartThings Workspace.
- Visit the SmartThings Developer Workspace.
- Create a new automation project.
- Register the Automation SmartApp (WebHook Endpoint).
- Copy the WebHook Endpoint on the automation node.
- Complete the registration process.
- Next is to "Deploy to Test".