7 function parse_value(str)
10 if string.find(str,"temp0: Temp C:") then
11 last_temp = tonumber(string.sub(str,15))
12 os.execute(string.format("rrdtool update /home/sensortemp.rrd -t temp N:%f", last_temp))
13 --print(string.format("t: %f Grad Celsius",last_temp))
15 if string.find(str,"photo0: Photo:") then
16 last_light = tonumber(string.sub(str,15))
17 os.execute(string.format("rrdtool update /home/sensorlight.rrd -t light N:%d", last_light))
18 --print(string.format("p: %d",last_light))
20 if string.find(str,"movement") then
22 os.execute(string.format("rrdtool update /home/sensormovement.rrd -t movement N:%d", 1))
29 local line = io.read("*line")