Last active
February 18, 2017 08:29
-
-
Save NSBum/be28d4812e0ba50e26dd5a67ccc1263b to your computer and use it in GitHub Desktop.
RRDTool + Indigo for graphing sensor data
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
import rrdtool | |
# "Original basement temperature sensor" | |
temp = indigo.devices[401767099].sensorValue | |
# "Original basement humidity" | |
hum = indigo.devices[1437240536].sensorValue | |
# update our round robin database | |
entry = 'N:{0}:{1}'.format(temp,hum) | |
rrdtool.update('/usr/local/share/obasement.rrd','N:{0}:{1}'.format(temp,hum)) | |
ret = rrdtool.graph("/Users/alan/Desktop/obasement.png", | |
"--start", "-2days", "-w 600", | |
'DEF:Humidity=/usr/local/share/obasement.rrd:humidity:AVERAGE', | |
'DEF:Temperature=/usr/local/share/obasement.rrd:temperature:AVERAGE', | |
'LINE1:Temperature#ff0000:Temperature (°F)', | |
'LINE1:Humidity#0000ff:Humidity (%)' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment