I also have a working script in Python, how to add it to HomeGenie?
#!/usr/bin/env python
import Adafruit_DHT as dht
import datetime
import time
import lcddriver
#Variables
sleepsecs = 30 #how many seconds to wait between each sensor query
lcd = lcddriver.lcd()
#Print welcome text on display
lcd.lcd_clear()
lcd.lcd_display_string(" Loading", 1)
lcd.lcd_display_string(" temperature and", 2)
lcd.lcd_display_string(" humidity log", 3)
#Write csv header
print "Datetime;Temp;Humidity"
#Function to "draw" a temperature or humidity bar on display
def draw_bar(value, line, low_limit, high_limit, bar_max_value):
char_width = 20 #display width in chars
bar_max_value = bar_max_value * 1.0
#Get character position for values
value_on_char = round(value / bar_max_value * char_width)
low_limit_on_char = round(low_limit / bar_max_value * char_width)
high_limit_on_char = round(high_limit / bar_max_value * char_width)
#Build string that comprises the bar
streng = ""
for i in range(0, char_width):
if i == value_on_char and (i > high_limit_on_char or i < low_limit_on_char):
streng = streng + "!"
elif i == value_on_char:
streng = streng + "*"
elif i > high_limit_on_char or i < low_limit_on_char:
streng = streng + "="
else:
streng = streng + "-"
#Write the bar to display on given line
lcd.lcd_display_string(streng, line)
#Main program loop
while True:
#Get current date and time
now = datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S')
#Read values from sensor
h,t = dht.read_retry(dht.DHT22, 4)
#Print date/time, temperature and humidity separated by semicolon
print now + ';{0:0.1f};{1:0.1f}'.format(t, h)
#Write temp, humidity to display
lcd.lcd_clear()
lcd.lcd_display_string("{0:0.1f} *C - {1:0.1f}%".format(t, h), 1)
#Draw temp, humidity bars to display
draw_bar(t, 2, 5, 21, 40) #temperature: value line low high bar_max
draw_bar(h, 3, 30, 50, 100) #humidity: value line low high bar_max
#Write date/time to display
lcd.lcd_display_string(now, 4)
#Wait sleepsecs seconds before repeating loop
time.sleep(sleepsecs)