Simon Hearne

Web Performance Architect

Email Twitter LinkedIn Github RSS

Collecting SmartThings data in InfluxDB on Raspberry Pi

Published

How to collect data from your Home Automation system into a local timeseries database.

❤️ 5 likes 🔁 1 repost 💬 1 comment as of 16:00, October 27


Now that you’ve got your Pi set up with Influx & Grafana, you’re collecting some system stats, and measuring network performance, it’s time to collect data from SmartThings!

Samsung SmartThings is a multi-protocol smart home hub produced by Samsung, it supports Z-Wave, Zigbee and Bluetooth and is surprisingly configurable. One of my main frustrations with the service is the lack of visibility into the huge amounts of data that it collects, so I decided to store that data myself! This way I can query it and visualise it in Grafana, set alerts and get insight into how my home is performing.

Step 0: Set up InfluxDB and Grafana

This post assumes that you have an InfluxDB and Grafana server running already, take a look at my post on getting a Raspberry Pi configured if you need to get set up first.

Step 1: Adding the SmartApp

We need to install a SmartApp to SmartThings to collect the sensor data. This is a relatively straighforward process but is daunting the first time you do it.

  1. Log in to the IDE
  2. Navigate to the My SmartApps section
  3. Click the blue + New SmartApp button in the top right of the screen
  4. Select the From Code tab
  5. Copy and Paste the groovy code from influxdb-logger
  6. Hit Create - you should see a green “Created SmartApp” banner
  7. Click the Publish -> For Me button to make the app available

Step 2: Configure the Logger

Now the SmartApp is enabled, you should see it in your SmartThings mobile application under SmartApps:

New InfluxDB Logger SmartApp.

Click on the app to open the settings:

Configuring InfluxDB Settings.

Select all devices which you would like to log:

Selecting Devices to Log.

Save the settings and make sure that the app is enabled, you’ll see data in your InfluxDB immediately if everything is working correctly. You can debug by viewing the live logs of your SmartThings location - click on Live Logging in the menu of the SmartThings IDE:

Viewing Live Logs in SmartThings.

With any luck you’ll have an InfluxDB filling up with device data!


Join the conversation

The comments on this page are fed by tweets, using brid.gy, webmention.io and a modified version of jekyll-webmention_io. To comment, just send a webmention or use a link below to interact via twitter (comments are fetched if the full URL is referenced in the tweet). Webmentions are pulled once per day.



Recent reposts


Recent comments

  1. diekus

    Damnit now I wanna play with data coming out of smartthings!

    reply