Git Product home page Git Product logo

smartthings_influx's Introduction

SmartThings InfluxDB Grafana Application

This application uses Docker-Compose to create an application which logs all of your Samsung Smart Things sensors into an Influx database and plots it on Grafana.

Temperatureplot

SmartThings API Key

The first step is to create a SmartThings API key which has access to device statuses and devise lists

  1. Create/Log in to your Samsung Developer's Account
  2. Create a new token at Samsung Personal Access Tokens
  3. Create a token with permissions to (devices) list all devices, see all devices, (profiles) see all device profiles, and see locations

OpenWeather API Key and City ID

  1. Create/Log in to OpenWeather
  2. Create an API key for your account API keys
  3. Find your city ID in OpenWeather by searching for your weather (note: for USA cities it is City, US, not City, State). The city ID should be in the URL

Docker Deployment

A docker-compose.yml file is provided to set up all the required containers.

  1. Install Docker on your system
  2. Create a .env file with an environment variable SMARTTHINGS_API_KEY set to your API key
  3. Add environment variables for INFLUX_VOLUME and GRAFANA_VOLUME paths to local directories
  4. Run docker-compose up -d

Sample .env file:

SMARTTHINGS_API_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
INFLUX_VOLUME="/home/me/smarthings_volume/influxdb"
GRAFANA_VOLUME="/home/me/smarthings_volume/grafana"
OPENWEATHER_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENWEATHER_CITY_ID=1234567

Local Python Development setup

  1. Create a virtual environment: python -m venv /path/to/env
  2. Activate the virtual environment source /path/to/env/bin/activate
  3. Install all dependencies pip install -r requirements.txt

smartthings_influx's People

Contributors

akobyl avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

badnetmask

smartthings_influx's Issues

Feature request: MQTT broker instead of InfluxDB?

Hi there,

Great work! Instead of using InfluxDB could you query the API and push the latest sensor values into mqtt? This would solve a problem I have currently since Samsung discontinued Groovy where I was running an MQTT Bridge.

Thanks a lot!
Ian

Not working. Missing instructions?

Thank you for sharing this. I've been looking for a new solution since Samsung deprecated the old Groovy API.
I was able to make it run (with some mods to make it build, which I will upload later), but it seems like it's missing some things, so I would like to check if by any chance it's a "me" problem, or just missing some documentation.
a) The script runs every 5 minutes, but doesn't do anything. It says Completed run with 0/33 sensors uploaded successfully.
b) There are zero dashboards in Grafana. Were they supposed to be installed automatically, or are the instructions missing from the install process?
I'm fine if this is just missing some docs. If you provide me with directions, I can update anything on my side, and even contribute to some code if needed. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.