Changeset 53aed1c


Ignore:
Timestamp:
11/30/2014 09:21:35 PM (10 years ago)
Author:
Norbert Wigbels <njw@…>
Branches:
master
Children:
cf9f2dc
Parents:
5ce93a3
Message:

Gaszaehler mit RRDTool-Auswertung

Location:
de.wigbels.ruby
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • de.wigbels.ruby/hotcoldrain/draw_graphs.sh

    r5ce93a3 r53aed1c  
    11#!/bin/bash
    22
    3 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"
     3rrdtool graph web/temperatur_1tag.png --title "Temperaturen im Tagesverlauf" --font TITLE:12 --vertical-label="° Celsius" -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\n" GPRINT:temps1:LAST:"Letzte Messung unten\: %2.2lf" GPRINT:temps2:LAST:"oben\: %2.2lf" GPRINT:temps9:LAST:"aussen\: %2.2lf"
    44
    5 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:tempmins9=weather.rrd:temps9:MIN DEF:tempmaxs9=weather.rrd:temps9:MAX DEF:temps9=weather.rrd:temps9:AVERAGE CDEF:tempranges9=tempmaxs9,tempmins9,- LINE1:tempmins9#4e9a06 AREA:tempranges9#8ae234::STACK LINE1:tempmaxs9#4e9a06 LINE2:temps9#4e9a06:"Temperatur aussen"
     5rrdtool graph web/temperatur_1woche.png --title "Temperaturen im Wochenverlauf" --font TITLE:12 --vertical-label="° Celsius" -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:tempmins9=weather.rrd:temps9:MIN DEF:tempmaxs9=weather.rrd:temps9:MAX DEF:temps9=weather.rrd:temps9:AVERAGE CDEF:tempranges9=tempmaxs9,tempmins9,- LINE1:tempmins9#4e9a06 AREA:tempranges9#8ae234::STACK LINE1:tempmaxs9#4e9a06 LINE2:temps9#4e9a06:"Temperatur aussen\n"
    66
    7 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:tempmins9=weather.rrd:temps9:MIN DEF:tempmaxs9=weather.rrd:temps9:MAX DEF:temps9=weather.rrd:temps9:AVERAGE CDEF:tempranges9=tempmaxs9,tempmins9,- LINE1:tempmins9#4e9a06 AREA:tempranges9#8ae234::STACK LINE1:tempmaxs9#4e9a06 LINE2:temps9#4e9a06:"Temperatur aussen"
     7rrdtool graph web/temperatur_1monat.png --title "Temperaturen im Monatsverlauf" --font TITLE:12 --vertical-label="° Celsius" -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:tempmins9=weather.rrd:temps9:MIN DEF:tempmaxs9=weather.rrd:temps9:MAX DEF:temps9=weather.rrd:temps9:AVERAGE CDEF:tempranges9=tempmaxs9,tempmins9,- LINE1:tempmins9#4e9a06 AREA:tempranges9#8ae234::STACK LINE1:tempmaxs9#4e9a06 LINE2:temps9#4e9a06:"Temperatur aussen\n"
    88
    99
    10 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"
     10rrdtool graph web/luftfeuchtigkeit_1tag.png --title "Luftfeuchtigkeit im Tagesverlauf" --font TITLE:12 --vertical-label="%" -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\n" GPRINT:hums1:LAST:"Letzte Messung unten\: %3.2lf" GPRINT:hums2:LAST:"oben\: %3.2lf" GPRINT:hums9:LAST:"aussen\: %3.2lf"
    1111
    12 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"
     12rrdtool graph web/luftfeuchtigkeit_1woche.png --title "Luftfeuchtigkeit im Wochenverlauf" --font TITLE:12 --vertical-label="%" -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\n"
    1313
    14 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"
     14rrdtool graph web/luftfeuchtigkeit_1monat.png --title "Luftfeuchtigkeit im Monatsverlauf" --font TITLE:12 --vertical-label="%" -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\n"
    1515
    1616
    17 rrdtool graph web/regen_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' -v mm/Stunde DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainph=rains9,3600,*,1,*,0.295,* CDEF:rainpd=rainph,24,* VDEF:totalrain=rainpd,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Tag" LINE2:rainph#729fcf
     17rrdtool graph web/regen_1tag.png \
     18--title "Regen im Tagesverlauf" \
     19--font TITLE:12 -w 800 -h 500 \
     20-s 'now - 1 day' -e 'now' \
     21-v mm/Stunde \
     22DEF:rains9=weather.rrd:rains9:AVERAGE \
     23CDEF:rainph=rains9,3600,*,1,*,0.295,* \
     24CDEF:rainpd=rainph,24,* \
     25VDEF:totalrain=rainpd,AVERAGE \
     26GPRINT:totalrain:"Total %6.0lf mm/Tag" \
     27LINE2:rainph#729fcf
    1828
    19 rrdtool graph web/regen_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' -v mm/Stunde DEF:rains9=weather.rrd:rains9:AVERAGE CDEF:rainph=rains9,3600,*,1,*,0.295,* CDEF:rainpw=rainph,168,* VDEF:totalrain=rainpw,AVERAGE GPRINT:totalrain:"Total %6.0lf mm/Woche" LINE2:rainph#729fcf
     29rrdtool graph web/regen_1woche.png \
     30--title "Regen im Wochenverlauf" \
     31--font TITLE:12 -w 800 -h 500 \
     32-s 'now - 1 week' -e 'now' \
     33-v mm/Stunde \
     34DEF:rains9=weather.rrd:rains9:AVERAGE \
     35CDEF:rainph=rains9,3600,*,1,*,0.295,* \
     36CDEF:rainpw=rainph,168,* \
     37VDEF:totalrain=rainpw,AVERAGE \
     38GPRINT:totalrain:"Total %6.0lf mm/Woche" \
     39LINE2:rainph#729fcf
    2040
    21 rrdtool graph web/regen_1monat.png -w 800 -h 500 -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#729fcf
     41rrdtool graph web/regen_1monat.png \
     42--title "Regen im Monatsverlauf" \
     43--font TITLE:12 -w 800 -h 500 \
     44-s 'now - 1 month' -e 'now' \
     45-v mm/Tag \
     46DEF:rains9=weather.rrd:rains9:AVERAGE \
     47CDEF:rainpd=rains9,3600,*,24,*,0.295,* \
     48CDEF:rainpm=rainpd,30,* \
     49VDEF:totalrain=rainpm,AVERAGE \
     50GPRINT:totalrain:"Total %6.0lf mm/Monat" \
     51LINE2:rainpd#729fcf
    2252
    2353
    24 rrdtool graph web/wind_1tag.png -w 800 -h 500 -s 'now - 1 day' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
     54rrdtool graph web/wind_1tag.png --title "Wind im Tagesverlauf" --font TITLE:12 -w 800 -h 500 -s 'now - 1 day' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
    2555
    26 rrdtool graph web/wind_1woche.png -w 800 -h 500 -s 'now - 1 week' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
     56rrdtool graph web/wind_1woche.png --title "Wind im Wochenverlauf" --font TITLE:12 -w 800 -h 500 -s 'now - 1 week' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
    2757
    28 rrdtool graph web/wind_1monat.png -w 800 -h 500 -s 'now - 1 month' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
     58rrdtool graph web/wind_1monat.png --title "Wind im Monatsverlauf" --font TITLE:12 -w 800 -h 500 -s 'now - 1 month' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
  • de.wigbels.ruby/hothotread/draw_graphs.sh

    r5ce93a3 r53aed1c  
    1 #!/bin/bash
     1#!/bin/bash
     2#DEF:temps9=../hotcoldrain/weather.rrd:temps9:AVERAGE \
     3#LINE1:temps9#4e9a06:"Temperatur aussen\n" \
    24
    3 rrdtool graph gastest.png -w 800 -h 500 -s 'now - 1 day' -e 'now' DEF:gas=energy.rrd:gas:AVERAGE LINE2:gas#204a87:"Gas Liter"
     5rrdtool graph web/gas_1tag.png \
     6-w 800 -h 500 \
     7-s 'now - 1 day' -e 'now' \
     8--title "Gasverbrauch im Tagesverlauf" \
     9--font TITLE:12 --vertical-label="Liter/Stunde" \
     10DEF:gas=gas.rrd:gas:AVERAGE \
     11CDEF:gash=gas,120,* \
     12VDEF:gastotal=gas,TOTAL \
     13GPRINT:gastotal:"Total %6.0lf m3 Gas" \
     14LINE2:gash#c17d11:"Gasverbrauch"
     15
     16rrdtool graph web/gas_1woche.png \
     17-w 800 -h 500 \
     18-s 'now - 1 week' -e 'now' \
     19--title "Gasverbrauch im Wochenverlauf" \
     20--font TITLE:12 --vertical-label="Liter/Tag" \
     21DEF:gas=gas.rrd:gas:AVERAGE \
     22CDEF:gasd=gas,2880,* \
     23VDEF:gastotal=gas,TOTAL \
     24GPRINT:gastotal:"Total %6.0lf m3 Gas" \
     25LINE2:gasd#c17d11:"Gasverbrauch/Tag"
     26
     27rrdtool graph web/gas_1monat.png \
     28-w 800 -h 500 \
     29-s 'now - 1 month' -e 'now' \
     30--title "Gasverbrauch im Monatsverlauf" \
     31--font TITLE:12 --vertical-label="Liter/Tag" \
     32DEF:gas=gas.rrd:gas:AVERAGE \
     33CDEF:gasd=gas,2880,* \
     34VDEF:gastotal=gas,TOTAL \
     35GPRINT:gastotal:"Total %6.0lf m3 Gas" \
     36LINE2:gasd#c17d11:"Gasverbrauch/Tag"
     37
  • de.wigbels.ruby/hothotread/hothotpiper.rb

    r5ce93a3 r53aed1c  
    2424include PiPiper
    2525
    26 @mypath = File.expand_path(File.dirname(__FILE__))
     26$mypath = File.expand_path(File.dirname(__FILE__))
    2727
    2828
     
    3030  puts('added 10 liter of gas to sensor-database')
    3131  Net::HTTP.get(URI.parse('http://www.wigbels.net/cgi-bin/hhw.rb?sensorid=1&data=10'))
    32   system("rrdtool update #{@mypath}/energy.rrd N:10:U:U")
     32  system("rrdtool update #{$mypath}/gas.rrd N:10")
    3333end
    3434
Note: See TracChangeset for help on using the changeset viewer.