Changeset daaef3e
- Timestamp:
- 11/24/2014 09:30:20 PM (10 years ago)
- Branches:
- master
- Children:
- 5ce93a3
- Parents:
- af9afaf
- Location:
- de.wigbels.ruby
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
de.wigbels.ruby/hotcoldrain/draw_graphs.sh
raf9afaf rdaaef3e 3 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" 4 4 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:temp s9=weather.rrd:temps9:AVERAGELINE2:temps9#4e9a06:"Temperatur aussen"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" 6 6 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:temp s9=weather.rrd:temps9:AVERAGELINE2:temps9#4e9a06:"Temperatur aussen"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" 8 8 9 9 … … 15 15 16 16 17 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 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 18 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 20 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 22 23 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" 25 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" 27 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" -
de.wigbels.ruby/hotcoldrain/hotcoldrain.rb
raf9afaf rdaaef3e 21 21 #------------------------------------------ 22 22 class HotColdRain < Logger::Application 23 attr_accessor :temp1, :humidity1, :serialport 23 attr_accessor :temp1, :humidity1, :serialport, :mypath 24 24 25 25 def initialize(application_name) 26 26 super(application_name) 27 27 @serialport = SerialPort.new("/dev/ttyUSB0", 9600, 8, 1, SerialPort::NONE) 28 @mypath = File.expand_path(File.dirname(__FILE__)) 28 29 end 29 30 … … 62 63 rrddata = 'N:'+datagrams.join(':') 63 64 64 system("rrdtool update weather.rrd #{rrddata}")65 system("rrdtool update #{mypath}/weather.rrd #{rrddata}") 65 66 66 67 MQTT::Client.connect('mqtt://notwist:pixies@wigbels.net') do |c| -
de.wigbels.ruby/hothotread/hothotpiper.rb
raf9afaf rdaaef3e 18 18 $SAFE=0 19 19 20 21 20 #------------------------------------------ 22 21 require 'net/http' … … 25 24 include PiPiper 26 25 26 @mypath = File.expand_path(File.dirname(__FILE__)) 27 27 28 28 29 watch :pin => 4, :trigger => :falling do 29 30 puts('added 10 liter of gas to sensor-database') 30 31 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") 31 33 end 32 34
Note:
See TracChangeset
for help on using the changeset viewer.