Index: de.wigbels.ruby/hotcoldrain/draw_graphs.sh
===================================================================
--- de.wigbels.ruby/hotcoldrain/draw_graphs.sh	(revision af9afafdeeab6cf9a9b61816608b39c17f535bd2)
+++ de.wigbels.ruby/hotcoldrain/draw_graphs.sh	(revision af9afafdeeab6cf9a9b61816608b39c17f535bd2)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+rrdtool graph web/temperatur_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:temps9=weather.rrd:temps9:AVERAGE LINE2:temps9#4e9a06:"Temperatur aussen"
+
+rrdtool graph web/temperatur_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:temps9=weather.rrd:temps9:AVERAGE LINE2:temps9#4e9a06:"Temperatur aussen"
+
+rrdtool graph web/temperatur_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' DEF:temps1=weather.rrd:temps1:AVERAGE LINE2:temps1#204a87:"Temperatur unten" DEF:temps2=weather.rrd:temps2:AVERAGE LINE2:temps2#f57900:"Temperatur oben" DEF:temps9=weather.rrd:temps9:AVERAGE LINE2:temps9#4e9a06:"Temperatur aussen"
+
+
+rrdtool graph web/luftfeuchtigkeit_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' DEF:hums1=weather.rrd:hums1:AVERAGE LINE2:hums1#204a87:"Luftfeuchtigkeit unten"  DEF:hums2=weather.rrd:hums2:AVERAGE LINE2:hums2#f57900:"Luftfeuchtigkeit oben" DEF:hums9=weather.rrd:hums9:AVERAGE LINE2:hums9#4e9a06:"Luftfeuchtigkeit aussen"
+
+rrdtool graph web/luftfeuchtigkeit_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' DEF:hums1=weather.rrd:hums1:AVERAGE LINE2:hums1#204a87:"Luftfeuchtigkeit unten"  DEF:hums2=weather.rrd:hums2:AVERAGE LINE2:hums2#f57900:"Luftfeuchtigkeit oben" DEF:hums9=weather.rrd:hums9:AVERAGE LINE2:hums9#4e9a06:"Luftfeuchtigkeit aussen"
+
+rrdtool graph web/luftfeuchtigkeit_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' DEF:hums1=weather.rrd:hums1:AVERAGE LINE2:hums1#204a87:"Luftfeuchtigkeit unten"  DEF:hums2=weather.rrd:hums2:AVERAGE LINE2:hums2#f57900:"Luftfeuchtigkeit oben" DEF:hums9=weather.rrd:hums9:AVERAGE LINE2:hums9#4e9a06:"Luftfeuchtigkeit aussen"
+
+
+rrdtool graph web/regen_1monat.png -s 'now - 1 month' -e 'now' -v mm/Tag DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainpd=rains9,3600,*,24,*,0.295,* CDEF:rainpm=rainpd,30,* VDEF:totalrain=rainpm,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Monat" LINE2:rainpd#0000FF
Index: de.wigbels.ruby/hotcoldrain/hotcoldrain.rb
===================================================================
--- de.wigbels.ruby/hotcoldrain/hotcoldrain.rb	(revision 516b934e9de4ba1412bdf727ddd31ea6adcb6fac)
+++ de.wigbels.ruby/hotcoldrain/hotcoldrain.rb	(revision af9afafdeeab6cf9a9b61816608b39c17f535bd2)
@@ -28,24 +28,42 @@
   end
 
+  def logOutReadableData(datagrams)
+    puts "TemperaturUnten: " + datagrams[3]
+    puts "LuftfeuchtigkeitUnten: " + datagrams[11]
+    puts
+    puts "TemperaturOben: " + datagrams[4]
+    puts "LuftfeuchtigkeitOben: " + datagrams[12]
+    puts        
+    puts "TemperaturAussen: " + datagrams[19]
+    puts "LuftfeuchtigkeitAussen: " + datagrams[20]
+    puts "Windgeschwindigkeit km/h: " + datagrams[21]
+    puts "Niederschlag: " + datagrams[22]
+    puts "Regen ja/nein: " + datagrams[23]        
+    puts "---------------------"
+  end
+
   def run
     begin
       while true do
         openformat = @serialport.readline
+        #openformat = "$1;1;;21,3;20,0;;;;;;;50;55;;;;;;;4,9;74;3,0;6;0;0"
         datagrams = openformat.split(';')
-#        puts openformat
-        puts "TemperaturUnten: " + datagrams[3]
-        puts "LuftfeuchtigkeitUnten: " + datagrams[11]
-        puts
-        puts "TemperaturOben: " + datagrams[4]
-        puts "LuftfeuchtigkeitOben: " + datagrams[12]
-        puts        
-        puts "TemperaturAussen: " + datagrams[19]
-        puts "LuftfeuchtigkeitAussen: " + datagrams[20]
-        puts "Windgeschwindigkeit km/h: " + datagrams[21]
-        puts "Niederschlag: " + datagrams[22]
-        puts "Regen ja/nein: " + datagrams[23]        
-        puts "---------------------"
+
+        logOutReadableData(datagrams)
+
+        # $1;1;;21,3;20,0;;;;;;;50;55;;;;;;;4,9;74;3,0;6;0;0
+        # extract only data
+        # then replace empty data with U
+        # then localize float value
+        # finally prepare updatestring for rrdtool
+        datagrams = datagrams.values_at(3..23)
+        datagrams.collect! { |element| (element.empty?) ? "U" : element }
+        datagrams.collect! { |element| (element.include? ',') ? element.sub!(',','.') : element }
+        rrddata = 'N:'+datagrams.join(':')
+
+        system("rrdtool update weather.rrd #{rrddata}")
+
         MQTT::Client.connect('mqtt://notwist:pixies@wigbels.net') do |c|
-          c.publish('oben/temperatur', datagrams[3])
+          c.publish('oben/temperatur', datagrams[0])
         end
         #log(INFO, 'added 100 liter of gas to sensor-database')
@@ -58,8 +76,4 @@
       @serialport.close
     end
-#    puts "Filename: "+__FILE__.to_s
-#    puts "Linenumber: "+__LINE__.to_s
-#    log(WARN, 'warning',  'mymethod' )
-#    @log.error('my_method2') { 'Error!' }
   end
 end
@@ -69,11 +83,6 @@
 status = HotColdRain.new("HotColdRain").start
 
-#if status != 0
-#  puts "Some error occured."
-#endd
 
 
 
 
-
-
