Changes in / [e397ced:7e221fe]


Ignore:
Location:
de.wigbels.ruby
Files:
1 added
6 edited

Legend:

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

    re397ced r7e221fe  
    99rrdtool graph web/temperatur_1jahr.png --title "Temperaturen im Jahresverlauf" --font TITLE:12 --vertical-label="° Celsius" -s 'now - 1 year' -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"
    1010
    11 rrdtool graph web/temperatur_5jahr.png --title "Temperaturen im Jahresverlauf" --font TITLE:12 --vertical-label="° Celsius" -s 'now - 5 year' -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"
    12 
    1311
    1412rrdtool graph web/luftfeuchtigkeit_1tag.png --title "Luftfeuchtigkeit im Tagesverlauf" --font TITLE:12 --vertical-label="%" -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"
     
    1917
    2018rrdtool graph web/luftfeuchtigkeit_1jahr.png --title "Luftfeuchtigkeit im Jahresverlauf" --font TITLE:12 --vertical-label="%" -s 'now - 1 year' -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"
    21 
    22 rrdtool graph web/luftfeuchtigkeit_5jahr.png --title "Luftfeuchtigkeit im Jahresverlauf" --font TITLE:12 --vertical-label="%" -s 'now - 5 year' -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"
    2319
    2420
     
    7167LINE2:rainpd#729fcf
    7268
    73 rrdtool graph web/regen_5jahr.png \
    74 --title "Regen im Jahresverlauf" \
    75 --font TITLE:12 \
    76 -s 'now - 5 year' -e 'now' \
    77 -v mm/Tag \
    78 DEF:rains9=weather.rrd:rains9:AVERAGE \
    79 CDEF:rainpd=rains9,3600,*,24,*,0.295,* \
    80 CDEF:rainpm=rainpd,30,* \
    81 VDEF:totalrain=rainpm,AVERAGE \
    82 GPRINT:totalrain:"Total %6.0lf mm/Jahr" \
    83 LINE2:rainpd#729fcf
    84 
    85 
    8669rrdtool graph web/wind_1tag.png --title "Wind im Tagesverlauf" --font TITLE:12 -s 'now - 1 day' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
    8770
     
    9174
    9275rrdtool graph web/wind_1jahr.png --title "Wind im Jahresverlauf" --font TITLE:12 -s 'now - 1 year' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
    93 
    94 rrdtool graph web/wind_5jahr.png --title "Wind im Jahresverlauf" --font TITLE:12 -s 'now - 5 year' -e 'now' -v km/h DEF:winds9=weather.rrd:winds9:AVERAGE LINE2:winds9#2e3436:"Wind km/h"
  • de.wigbels.ruby/hotcoldrain/web/index.html

    re397ced r7e221fe  
    88<img src="temperatur_1monat.png"> <img src="luftfeuchtigkeit_1monat.png"> <br />
    99<img src="temperatur_1jahr.png"> <img src="luftfeuchtigkeit_1jahr.png"> <br />
    10 <img src="temperatur_5jahr.png"> <img src="luftfeuchtigkeit_5jahr.png"> <br />
    1110
    1211<h2>Regen / Wind</h2>
     
    1514<img src="regen_1monat.png"> <img src="wind_1monat.png"> <br />
    1615<img src="regen_1jahr.png"> <img src="wind_1jahr.png"> <br />
    17 <img src="regen_5jahr.png"> <img src="wind_5jahr.png"> <br />
    1816
    1917<p>Stationskoordinaten: 53&deg;34'17.1"N 9&deg;29'21.8"E, Stade-Ottenbeck</p>
  • de.wigbels.ruby/hothotread/draw_graphs.sh

    re397ced r7e221fe  
    11#!/bin/bash
    22
    3 rrdtool graph web/gas_3hour.png -s 'now - 3 hour' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h
    4 rrdtool graph web/gas_6hour.png -s 'now - 6 hour' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h
    5 rrdtool graph web/gas_12hour.png -s 'now - 12 hour' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h
    63rrdtool graph web/gas_1tag.png -s 'now - 1 day' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h
    74rrdtool graph web/gas_1week.png -s 'now - 1 week' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conpd=consum,3600,*,24,* LINE2:conpd#c17d11:m³/h
     
    1310
    1411
    15 rrdtool graph web/consum_10minutes.png   -s 'now -10 minutes' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
    16 rrdtool graph web/consum_30minutes.png   -s 'now -30 minutes' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
    17 rrdtool graph web/consum_1hour.png   -s 'now -1 hour' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch[W]"
    18 rrdtool graph web/consum_3hour.png   -s 'now -3 hour' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
    19 rrdtool graph web/consum_6hour.png   -s 'now -6 hour' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
    20 rrdtool graph web/consum_12hour.png   -s 'now -12 hour' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
    2112rrdtool graph web/consum_1day.png   -s 'now -1 day' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
    2213rrdtool graph web/consum_1week.png   -s 'now -1 week' -e 'now'   -Y -A   DEF:consum=power.rrd:consum:AVERAGE   LINE2:consum#00FF00:"Verbrauch [W]"
  • de.wigbels.ruby/hothotread/hothotpiper_gas.rb

    re397ced r7e221fe  
    11#!/usr/bin/env ruby
     2
    23require 'pi_piper'
    3 require 'eventmachine'
    4 
    54include PiPiper
    6 
    75
    86mypath = File.expand_path(File.dirname(__FILE__))
     
    119counter = 0.0
    1210timestamp =  Time.now.to_i
    13 
    1411
    1512def last_rrd_count(concretepath)
     
    3128end
    3229
    33 
    3430rrdpath = mypath + "/gasneu.rrd"
    3531counter = last_rrd_count(rrdpath)
    36 puts('Counter restored to: ' + counter.to_s)
     32puts('Counter restored to: '+counter.to_s)
    3733
    38 
    39 EventMachine.run do
    40   EM.add_periodic_timer(1) do
    41     if trigger_watch == 1 then
    42       counter = counter + trigger_step
    43       system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}")
    44       puts('Counter updated to: ' + counter.to_s)
    45       timestamp =  Time.now.to_i
    46       trigger_watch = 0
    47     elsif Time.now.to_i - timestamp > 3600
    48       system("rrdtool update #{rrdpath} N:#{counter}:0")
    49       timestamp = Time.now.to_i
    50     end
     34loop do
     35  if trigger_watch == 1 then
     36    counter = counter + trigger_step
     37    system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}")
     38    puts('Counter updated to: '+counter.to_s)
     39    timestamp =  Time.now.to_i
     40    trigger_watch = 0
     41  elsif Time.now.to_i - timestamp > 3600
     42    system("rrdtool update #{rrdpath} N:#{counter}:0")
     43    timestamp = Time.now.to_i
    5144  end
     45  sleep(1)
    5246end
    5347
  • de.wigbels.ruby/hothotread/hothotpiper_power.rb

    re397ced r7e221fe  
    11require 'pi_piper'
    2 require 'eventmachine'
    3 
    42include PiPiper
    5 
    63
    74mypath = File.expand_path(File.dirname(__FILE__))
    85trigger_step = 1.0 / 96
    9 trigger_watch = 0
    106counter = 0
    11 
    127
    138def last_rrd_count(concretepath)
     
    2419end
    2520
     21
    2622watch :pin => 11, :trigger => :falling  do
    2723  puts('updated power consumption')
    28   trigger_watch = 1
     24  counter = counter + trigger_step
     25  trigger_update = trigger_step * 3600000.0
     26  system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_update}")
    2927end
    30 
    3128
    3229rrdpath = mypath + "/power.rrd"
    3330counter = last_rrd_count(rrdpath)
    34 puts('Counter restored to: ' + counter.to_s)
    35 
    36 
    37 EventMachine.run do
    38   EM.add_periodic_timer(1) do
    39     if trigger_watch == 1 then
    40       counter = counter + trigger_step
    41       trigger_update = trigger_step * 3600000.0
    42       system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_update}")
    43       puts('Counter updated to: ' + counter.to_s)
    44       trigger_watch = 0
    45     end
    46   end
    47 end
     31PiPiper.wait
  • de.wigbels.ruby/hothotread/web/index.html

    re397ced r7e221fe  
    33<body>
    44
    5 <h2>Temperatur</h2>
    6 <img src="../temperatur_1tag.png">
    7 
    85<h2>Gas</h2>
    9 <img src="gas_3hour.png">
    10 <img src="gas_6hour.png">
    11 <img src="gas_12hour.png">
    126<img src="gas_1tag.png">
    137<img src="gas_1week.png">
     
    1812
    1913<h2>Strom</h2>
    20 <img src="consum_10minutes.png">
    21 <img src="consum_30minutes.png">
    22 <img src="consum_1hour.png">
    23 <img src="consum_3hour.png">
    24 <img src="consum_6hour.png">
    25 <img src="consum_12hour.png">
    2614<img src="consum_1day.png">
    2715<img src="consum_1week.png">
Note: See TracChangeset for help on using the changeset viewer.