Skip to content

smforsberg/smartthings_exporter

 
 

Repository files navigation

smarthings_exporter Build Status Coverage Status Go Report Card

Smartthings_exporter is a command line tool to export information about your SmartThings sensors in a format that can be scraped by Prometheus. The tool uses the GoSmart library to talk to SmartThings and collect sensor data and exposed the metrics over http.

Installation

The installation instructions assume a properly installed and configured Go development environment. The very first step is to download and build Smartthings_exporter (this step will also download and compile the GoSmart library):

$ go get -u github.com/kadaan/smartthings_exporter

Smartthings Setup

Before you can use Smartthings_exporter, you need to register it with Smartthings.

The first step is to setup the API that Smartthings_exporter uses to communicate with Smartthings. Follow the GoSmart Smartthings API setup steps.

Take note of the client_id and client_secret of your SmartThings app that you just created.

Smartthings_exporter configuration

We now need to register Smartthings_exporter to with your Smartthings app.

Run:

$ smartthings_exporter register --smartthings.oauth-client=[client_id] --smartthings.oauth-secret==[client_secret] > .st_token

Follow the prompts to authorize the app.

Running

Now we can start Smartthings_exporter by running:

$ smartthings_exporter --smartthings.oauth-client=<client_id> --smartthings.oauth-token.file=.sttoken

About

SmartThings sensor data collector for prometheus

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 69.3%
  • Shell 30.7%