Get historical sensor data


(Phillip Menkel) #1

Hi all,

I am new with SmartThings so if I am asking a basic question my apologies.

I would like to store historical sensor data into anouther system for use with graphing, trending and such. I would like to have data on minute increments if possible.

Below are some options I thought might be possible.

  • Polling the the smartthings web services every minute.
  • Have SmartApps upload to external every minute.
  • Have SmartApps upload when data changes.

I know how to get the data to the destination. I just don’t know if the above is possible in SmartThings or if there are better options in SmartThings.

Also, does SmartThings have minute level data on sensor devices?

Thanks,
Phil


Get Sensor Data
Collect logs to external database?
(Patrick Stuart [@pstuart]) #2

Lots of options. But 1 minute sensor data isn’t available, you have two options:

-Get latest value from subscribed devices in a SmartApp
-Subscribe to value changes of a device in a SmartApp

Then you can upload this data to any external source if you want or store it in a state log and access it in other ways…

There are already a few logging apps already written… I have one that can be used in a similar manner:

https://github.com/pstuart/smartthings/blob/master/logger.groovy

Lots of variations on this concept, but my code should hopefully get you started…


(fxstein) #3

Thanks for sharing. Will be taking a look at that some time. I am currently (pre SmartThings) logging my device and sensor data into an InfluxDB instance and using Graphana to do realtime dash boarding. Currently doing that through a simple python driver for the various devices.

Allows me to capture things like the power consumption of the house in ~5 sec intervals and plot/relate the power consumption of the entire home do various devices and appliances.


#4

@pstuart your app looks like just the thing for logging, but xively is no longer accepting new developer accounts. I’ve signed up on their wait list a while back but have seen no response.


(Jody) #5

Check out thingspeak or grovestreams

There devs from grovestreams have even been working with the community on integration


#6

First-party support for a SmartApp? That’ll do nicely, thanks for the suggestion!