Can Smartthings data be polled for ingestion into InfluxDB?

I hope this is the right forum. I’m looking at possibly buying into the Smartthings ecosystem, but wanted to know if there was a way to query data out of Smartthings, either the devices directly, the Hub, or from an API, and ingest it into InfluxDB? I already monitor home power consumption, as well as a number of other home-related metrics, I’d like to be able to get data from my integration platform as well, if possible. Does anyone know if this is possible?

Here are some examples of some related things that are possible with SmartThings. I’d guess you can accomplish your goal if you’re willing to put in some development effort.

1 Like
1 Like

Awesome! thanks!

Hi Evan, there’s two ways of doing it:

  1. You can push the data from SmartThings to InfluxDB, which is what my SmartApp does
    OR
  2. You can pull the data, which requires a SmartApp to expose a REST API (or similar) to be polled by your database (SmartThings doesn’t have a default API that can be used for this). Example app project here.

Personally, I think pushing the data from the source of the events is a better way of doing it as events are sent straight to InfluxDB as soon as they are generated, although your question implies you’d like to do the latter. Either way, both can be set up easily.

1 Like

Pulling the data is slightly discouraged, as it implies “polling” at some interval from the fetching website. I guess in the relatively scheme of things, “pushing” a lot of events puts nearly as much load on the system as polling; depending on number of events and frequency … might be less one way or the other.

I may be totally wrong - going on memory - doesn’t @michaelahess do alot of metric reporting? Seems I have seen some graphs posted by him.

I do, with Grafana pulling from InfluxDB. If anyone wants to see some examples, I can provide them. I love graphs!

3 Likes

I would love to see them Michael. As a previous data analyst, still near and dear to my heart, love visual data analytics. Thank you for sharing and glad I remembered it was You !

Batteries showing shaded levels:

Cumulative Energy:

My favorite, power levels:

Temperatures:

And some dual y axis and contact graphs:

I don’t do half of what I bet Grafana is capable of, but it’s enough for me. :slight_smile:

1 Like

Seems like you have been declared the resident Grafana Guru @michaelahess ! :wink: So here is a question for you…

I’ve got some pretty tasty Grafana dashboards running at the moment, but one thing I’ve never been able to do in Grafana is replicate the way Initial State shows text values over time in Waves view. e.g. how Bed Colour is displayed here:

I can get Grafana to show a point-in-time text value using a Single Stat panel, e.g.:

but this doesn’t help when I want to see text values over time. It would be really useful to be able to show thermostat modes over time for example.

Any ideas how this could be done in Grafana?

No idea, I think you are well ahead of me on what Grafana can do, but now that I know it can do that, I’m gonna be trying! :wink:

I’m doing some integrations sending SmartThings data to a Zato ESB on my local server and then pushing it into InfluxDB.

The Zato step is optional, I’m mainly using that for orchestrating my automations.

The blog post on Influx/Grafana is here and there’s a summary of the steps leading up to it here.