Created
June 17, 2015 21:10
-
-
Save banasrini/4b065c5c2f7b34621c27 to your computer and use it in GitHub Desktop.
This file contains 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
eon.chart({ | |
channel: 'humeon', | |
generate: { | |
bindto: '#chart', | |
data: { | |
type: 'gauge', | |
}, | |
gauge: { | |
min: 0, | |
max: 100 | |
}, | |
color: { | |
pattern: ['#FF0000', '#F6C600', '#60B044'], | |
threshold: { | |
values: [30, 60, 90] | |
} | |
} | |
} | |
}); |
This file contains 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 os | |
import time | |
import sys | |
from Pubnub import Pubnub | |
import Adafruit_DHT as dht | |
pubnub = Pubnub(publish_key='demo', subscribe_key='demo') |
This file contains 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
def callback(message): | |
print(message) | |
while True: | |
h,t = dht.read_retry(dht.DHT22, 4) | |
pubnub.publish('tempeon', { | |
'columns': [ | |
['x', time.time()], | |
['temperature_celcius', t] | |
] | |
}) | |
pubnub.publish('humeon', { | |
'columns': [ | |
['humidity', h] | |
] | |
}) |
This file contains 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
eon.chart({ | |
history: true, | |
channel: 'tempeon', | |
flow: true, | |
generate: { | |
bindto: '#chart', | |
data: { | |
x: 'x', | |
labels: false | |
}, | |
axis : { | |
x : { | |
type : 'timeseries', | |
tick: { | |
format: '%H:%M:%S' | |
} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment