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.
The first step is to create a SmartThings API key which has access to device statuses and devise lists
- Create/Log in to your Samsung Developer's Account
- Create a new token at Samsung Personal Access Tokens
- Create a token with permissions to (devices) list all devices, see all devices, (profiles) see all device profiles, and see locations
- Create/Log in to OpenWeather
- Create an API key for your account API keys
- Find your city ID in OpenWeather by searching for your weather (note: for USA cities it is
City, US, notCity, State). The city ID should be in the URL
A docker-compose.yml file is provided to set up all the required containers.
- Install Docker on your system
- Create a
.envfile with an environment variableSMARTTHINGS_API_KEYset to your API key - Add environment variables for
INFLUX_VOLUMEandGRAFANA_VOLUMEpaths to local directories - 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
- Create a virtual environment:
python -m venv /path/to/env - Activate the virtual environment
source /path/to/env/bin/activate - Install all dependencies
pip install -r requirements.txt
