Automatic to Smartthings, supported by AWS API Gateway + Lambda

“Automatic To Smartthings” is a fully loaded package to have the Automatic OBD2 Adapter integrated with Smartthings.

  • Immediately push every Automatic event update to Smartthings
  • Provide a new device type on Smartthings as a Presence Sensor
  • Display distance, fuel level, battery voltage, MPG and last know parking location
  • Directly integrated, no other resources needed

What do you need?

  • A Smartthings Developer’s account
  • An AWS (Amazon Web Serivce) account
  • An Automatic Developer’s account



  • Create a new Device Handler in Smartthings Developer’s website, with the code from DeviceHandler.groovy
  • Create a new device from device list, select type Automatic.
  • Create a new Web Service Smart App at Here with code from SmartApp.groovy, and follow the Smartthings document to create an SmartApp API Endpoint and SmartApp API Token.

AWS Lambda

  • Create an AWS Lambda function, with the code from /AWS_Lambda/index.js, Also remember to setup environment variable ss_apiuri and ss_token in Lambda with the value from above step. Configure the function to be triggered by AWS API Gateway, and make a public access and copy the AWS API Endpoint.
  • Since AWS Lambda does not support npm install a proper node_module folder has to be generated from a local environment, and zip everything up to Lambda.


  • Create an App in Automatic developer’s website, setup webhook in Event Delivery part with AWS API Endpoint as Webhook URL. Use “Connect with Automatic Button” option on the same page to connect your Automatic Account with your Automatic App.

How everything works together

  • Automatic Dev App (POST) -> AWS API Gateway -> AWS Lambda (POST) -> Smartthings Smart App -> Smartthings Device Handler

What are…

  • Automatic: The OBD2 car trip, location and health monitor
  • Smartthings: The smart home hub
  • AWS API Gateway: AWS Restful API handler
  • AWS Lambda: The AWS serverless instance

Where to download?

Click-> GitHub_Logo to download

AWS IoT Button: Send POST request to Google Firebase

AWS IoT Button was introduced by Amazon as the developer version of it’s dash button.

The AWS IoT Button allows user to associate with an AWS Lambda instance to run some code snippet while press the button – either play with other AWS service such as Amazon SNS or integrate with your own service.

The button press has 3 types: single, double and long which can be found from the Lambda event.

Here is a simple code gist to demonstrate sending a POST request to Google Firebase client while the button is pressed:

(Keep in mind that AWS Lambda doesn’t have the npm install for your node.js code function – which means you have to upload a zipped file which contains the node.js node_modules folder as dependency)

“The following packages have been kept back” ?

We might see this during a “apt-get upgrade” command on Ubuntu:

Calculating upgrade... Done
The following packages have been kept back:
  linux-cloud-tools-virtual linux-generic linux-headers-generic 
  linux-image-generic linux-signed-generic linux-signed-image-generic
  mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

According to [this article]:

There we can see packages haven’t been upgraded, even though newer packages are available. This is because two new packages were introduced, and these upgrades depend upon it.

To upgrade it, and you’re ABSOLUTELY SURE that you want to install the new introduced packages:

apt-get dist-upgrade

The following message will appear and you’re good to go:

The following NEW packages will be installed:
  libevent-core-2.0-5 linux-cloud-tools-4.4.0-38 linux-cloud-tools-4.4.0-38-generic linux-headers-4.4.0-38 linux-headers-4.4.0-38-generic
  linux-image-4.4.0-38-generic linux-image-extra-4.4.0-38-generic linux-signed-image-4.4.0-38-generic
The following packages will be upgraded:
  linux-cloud-tools-virtual linux-generic linux-headers-generic linux-image-generic linux-signed-generic linux-signed-image-generic
  mysql-server-5.7 mysql-server-core-5.7
8 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.

Note that this command may also remove your existing packages while upgrading – which means there are possibilities your system could be messed up.

Autostart/Upstart Mongodb on Ubuntu 16.04 Xenial Xerus


Check for Mongodb systemctl status by:

sudo systemctl status mongod

Enable the Mongodb Autostart/upstart with system start up:

sudo systemctl enable mongod

Note: if both of the commands returning a service not found message, then check if the service entry exist in either




If not then refer to Mongodb Documentation to create the systemd service file for Ubuntu 16.04 at this path:


With this content:

Description=High-performance, schema-free document-oriented database
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

And go back to the start of this article.