- if string.find(str,"Temp C:") then
- last_temp = tonumber(string.sub(str,8))
- --print(string.format("t: %f Grad Celsius",last_temp))
+ last_temp = 0.0
+ last_light = 0
+ if string.find(str,"Sensor T: Temp C:") then
+ last_temp = tonumber(string.sub(str,18))
+ os.execute(string.format("rrdtool update /home/sensordata.rrd -t temp N:%f", last_temp))
+ print(string.format("t: %f Grad Celsius",last_temp))