My first post here, I recently discovered that my energy provider have partnered with Samsung to allow me to pair my gas and electricity smart meters with the SmartThings app. I have this working but now want to write some code which obtains this data from the SmartThings API (where I’m assuming it is stored?) so I can push it to my metrics tools (Grafana, InfluxDB etc).
I have been reading some of the SmartThings docs, but they all seem to be geared towards implementing functionality which will integrate with the SmartThings app, whereas I just want to pull data from the API from some code that runs locally.
So I guess my questions are:
Will my energy data be available in the SmartThings API?
Is it possible to read data from the SmartThings API in the way I have described above?
As i I understanding it you will need something to recieve the event data you want and send it to your influx DB database. To interact with the new API’ as i believe you either need a AWS App, a web app that uses web hooks, or something like the Smartthings CLI tool.
There are some good examples out there, but you will need a server or something to run the tool/webapp on to retrieve the data and then put it into your database.
The new API is all based on you running your own infrastructure for the apps you want to develop.
You may be able to put something together with the Smartthings CLI that isnt a app, and just pools the smartthings api so often, but that could provide very incomplete data.
If you have a influxdb already i would suggest creating it as a web app, and then posting the details here. I dabbled with something a while ago that would been about 80% of the way there. It wasn’t hard to get something fairly viable. The biggest problem was going to be putting it on a platform always there to serve it.
To that point there is also already a smartapp written for the Smartthings IDE that will load data to a InfluxDB. A quick google search should point you to it. I run it myseld as i have graphana and influx running on a pi for this purpose.