I had been using SmartThings for many years and out-grown what I could automate with SmartThings Routines and Rules, so started looking at how to implement more advanced automations.
After reviewing the SmartThings Apps feature, I concluded that it was not for me. The process seems convoluted and the requirement for me to provide a web endpoint, open to the internet was a shop stopper.
So I investigated alternatives and discovered a great way to build advanced automations which, run locally, are simple to build and importantly does not require me to open up my home network to the internet.
I thought others SmartThings users would be interested in the approach.
I now build all my advanced automations using this method and tools as they are: quick to build and maintain, run on my home network and enable me to develop any automation idea, however complex.
2. Here’s how I build my Advanced Automation.
An Advanced Automation consists of two parts.
The first part of the advanced automation defines WHEN the Automation will be initiated. E.g. when a switch is turned on, or a button is pressed, or when it is manually initiated from the SmartThings App.
A set of one or more Triggers are built by creating a SmartThings Routine using the SmartThings App. Assuming you are using local edge drivers, the SmartThings Routine runs locally on your SmartThings Hub.
When the trigger conditions are met, the SmartThings routine sends a HTTP
requests, using Todd Austin’s Web Requester edge driver, to initiate
an Automation running locally on a separate, always-on, dedicated Automation Box.
The second part of the advanced automation defines the sequence of actions that are executed when the trigger event is raised.
The Automation is built with the Node-RED tool and the SmartThings Node-RED library, published by Samsung, for interacting with SmartThings devices.
3.1 Motion Sensor Controlled Lighting
This is a very simple example which turns the kitchen lights on when motion is detected and turns them off when motion is no motion is detected. This automation is simple enough to be implemented with just a couple of SmartThings Routines. It is included here to demonstrate the architecture of Advanced Automations.
3.2 Smart Lounge Lighting
This is a slightly more advanced automation example that controls the lounge lighting using a simple button.
Clicking the button incrementally raises the light levels from 0% to 3%, then to 25%, then to 50%, then to 100%.
Double Clicking on the button turns the lights off.
Holding the button turns the lights to 100%
5. Why Node-RED?
I have found Node-RED to be an excellent tool for developing and running Advanced Automation. The key benefits are:
- Simple to build using graphical editor
- Open platform
- Powerful library of standard node functionality
- Easy to use external Internet APIs
- The ability to develop IOT dashboards
- Node-RED is a mature tool.
- The project was initiated in 2013 and is now on release 3.1
- Node-RED is actively being enhanced
- Large active community
- Google yields answers to common questions
- It is used extensively for industrial IOT
6. Automation Box
The key pre-requisite to harnessing the potential of Advanced Automations is to get yourself an Automation Box.
This article describes how to install node-red on a Raspberry Pi.