📢 This is the version 3
of this application. If you are looking for older versions see the links below. No support for older versions. In case of issues, I recommend to update to the latest versions.
Note: This approach is tested using SmartThings Classic App. If you are on in new SmartThings app, let me know if this approach requires any changes. PRs are welcome!
SmartThings - Ring Alarm v2
- 🕐 This setup is going to take 30 minutes to an hour depending on your exposure on the SmartThings app, AWS Lambda, and Go.
- 💵 Deploying the Bridge Application in AWS as a Lambda is free but you will be charged for the use of API Gateway and Data Transfer.
This page explains, how to set up Ring Alarm as a virtual device on your SmartThings. Ring Alarm uses WebSockets to communicate to ring server for checking Alarm Status and Status changes. Unfortunately, SmartThings app does not support WebSockets, and we have to create a bridge application which accepts HTTP calls from SmartThings and communicate to Ring Alarm via WebSockets. Below diagram explains the flow.
If you are still reading this, that means you are ready to invest at least an hour!!!
This setup requires the deployment of two different components.
As I mentioned before, the bridge application is a proxy between the SmartThings custom app and Ring Alarm. Bridge application will be deployed as an AWS Lambda function using Go. The AWS Lambda function
will be exposed to the SmartThings App via a Amazon API Gateway. To secure the api endpoint, this setup uses an api-key. This setup uses AWS CloudFormation template to automatically create the required AWS resources and deploy the lambda build
from Amazon S3 Bucket
Below diagram shows details of the AWS services you will be creating for this.
You need to have an active AWS account and the latest Lambda build from here before proceeding to the next step.
If you don't have an account, start here
Follow steps below to setup the SmartThings Ring Alarm Lambda.
You can download the latest deployment.zip
from Github Release page
If you want to build the Lambda from the source code, you can do that by cloning this repo and then executing below steps.
You have to install golang version 1.13 or higher for this.
> GOOS=linux go build -o main
> zip deployment.zip main
You need to store the deployment.zip
file in an amazon s3 bucket
so that the cloud formation template
can use that for deployment.
Follow below steps to create a bucket and upload the deployment.zip
file to that bucket.
- Login to AWS Account and the navigate to https://s3.console.aws.amazon.com/s3/home?region=us-east-1 (You may be different region based on your account setup)
- Click on Create Bucket
- On Name and region page page enter name for your bucket as st-ring-alarm (You can change the name if you want, you will have an option to provide your bucket name during the stack setup later.)
- Leave everything else as default values on Name and region page and click next button
- Leave everything as default values on Configure options page and click next button
- Leave everything as default values on Set permissions page and click next button
- On Review page click on Create Bucket
- Select the newly created bucket on https://s3.console.aws.amazon.com/s3/home?region=us-east-1 and click on Upload button
- Upload the
deployment.zip
file either via Drag and Drop or by clicking on Add Files button. Leave all options as default on the upload page.
You will be using AWS CloudFormation template to create the stack.
You need to have either this repository cloned or save a copy of ringalarm-gateway.yaml file on your local before proceeding.
You can watch the instruction in the GIF or read the step-by-step instructions.
- Login to AWS Account and the navigate to https://console.aws.amazon.com/cloudformation/home?region=us-east-1 (You may be different region based on your account setup)
- Click on Create Stack and choose With new resources(standard)
- On the Specify template page choose Upload a template file
- Click on Choose file and select the
ringalarm-gateway.yaml
from cloned repository or from download. - Click Next
- On the Specify stack details page enter values
- Enter stack name as
st-ring-alarm
- You can use custom names if you want. apiStageName
- Leave as defaultlambdaFunctionName
- Leave as defaults3BucketName
- If you have selected any names other thanst-ring-alarm
for youramazon s3 bucket
you need to update that here otherwise leave as default.
- Enter stack name as
- On Specify stack details page click Next
- Leave everything as default on Configure stack options page and click Next
- On Review page, scroll down to bottom and select I acknowledge that AWS CloudFormation might create IAM resources. and click on Create Stack
- Wait for 2-5 minutes for the creation of the stack. You will see a status CREATE_COMPLETE once your stack is successfully created.
In this step, you will get your API Invoke URL and API Key for SmartThings Application configuration.
- Login to AWS Account and the navigate to https://console.aws.amazon.com/apigateway/main/apis?region=us-east-1 (You may be different region based on your account setup) Under the API, select your API
- Click on st-ring-alarm-api (If you have entered a custom stack name the name of the api will be
<your stack name>-api
) - Click on Dashboard under API:st-ring-alarm-api (If you have entered a custom stack name the name of the api will be
API:<your stack name>-api
) - You can see Invoke URL on top of the page, save it for SmartThings Application configuration
- From the API main page, select API Keys
- Select the key st-ring-alarm-apikey (If you have entered a custom stack name the name of the key will be
<your stack name>-apikey
) - Click on Show link on the API key
- Save API Key for SmartThings Application configuration.
Follow the steps here
You can add Ring Alarm to the Which alarms and sirens in the webCoRE and use like below in the pistons.
execute
if
Ring Alarm's status is 'home'
then
with
Your Device
do
Turn Off;
end with;
end if;
end execute;
SmartThings - Ring Alarmv2 is released under the MIT License.