Created
October 15, 2014 16:09
-
-
Save samdjohnson/b39e314e5861ce58b046 to your computer and use it in GitHub Desktop.
An example of TempoIQ's aggregate function with the python SDK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
session = get_session('tempo-iq-backend-url', key, secret) | |
start_time = datetime.datetime(2014,1,1,0,0,0,0) | |
end_time = datetime.datetime(2014,1,2,0,0,0,0) | |
results = session.query(Device) | |
.filter(Device[‘building’] == 1) | |
.filter(Sensor.key == “temp”) | |
.interpolate(“linear”, “PT15M”) | |
.aggregate(“avg”) | |
.read(start=start_time, end=end_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment