Changeset aa10f5c
- Timestamp:
- 03/12/2019 02:56:41 PM (6 years ago)
- Branches:
- master
- Children:
- 7c920d4
- Parents:
- b86cdd7
- Location:
- de.wigbels.ruby/hothotread
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
de.wigbels.ruby/hothotread/draw_graphs.sh
rb86cdd7 raa10f5c 28 28 rrdtool graph web/counter_1week.png -s 'now -1 week' -e 'now' -X 0 -Y -A DEF:counter=power.rrd:counter:LAST LINE2:counter#000000:"ZÀhlerstand [kWh]" 29 29 rrdtool graph web/counter_1month.png -s 'now -1 month' -e 'now' -X 0 -Y -A DEF:counter=power.rrd:counter:LAST LINE2:counter#000000:"ZÀhlerstand [kWh]" 30 31 32 rrdtool graph web/wconsum_10minutes.png -s 'now -10 minutes' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 33 rrdtool graph web/wconsum_30minutes.png -s 'now -30 minutes' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 34 rrdtool graph web/wconsum_1hour.png -s 'now -1 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch[L]" 35 rrdtool graph web/wconsum_3hour.png -s 'now -3 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 36 rrdtool graph web/wconsum_6hour.png -s 'now -6 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 37 rrdtool graph web/wconsum_12hour.png -s 'now -12 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 38 rrdtool graph web/wconsum_1day.png -s 'now -1 day' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 39 rrdtool graph web/wconsum_1week.png -s 'now -1 week' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 40 rrdtool graph web/wconsum_1month.png -s 'now -1 month' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 41 rrdtool graph web/wconsum_1year.png -s 'now -1 year' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 42 rrdtool graph web/wconsum_2year.png -s 'now -2 year' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" 43 44 rrdtool graph web/wcounter_1week.png -s 'now -1 week' -e 'now' -X 0 -Y -A DEF:counter=water.rrd:counter:LAST CDEF:wcounter=counter,3,/ LINE2:wcounter#000000:"ZÀhlerstand [qm2]" 45 rrdtool graph web/wcounter_1month.png -s 'now -1 month' -e 'now' -X 0 -Y -A DEF:counter=water.rrd:counter:LAST CDEF:wcounter=counter,3,/ LINE2:wcounter#000000:"ZÀhlerstand [qm2]" -
de.wigbels.ruby/hothotread/hothotpiper_water.rb
rb86cdd7 raa10f5c 7 7 8 8 mypath = File.expand_path(File.dirname(__FILE__)) 9 trigger_step = 0.0019 trigger_step = 1 10 10 trigger_watch = 0 11 11 counter = 0.0 … … 26 26 end 27 27 28 watch :pin => 9, :trigger => :rising do28 watch :pin => 18, :trigger => :falling do 29 29 puts('triggered watch to 1') 30 30 trigger_watch = 1 … … 40 40 if trigger_watch == 1 then 41 41 counter = counter + trigger_step 42 #system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}")42 system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}") 43 43 puts('Counter updated to: ' + counter.to_s) 44 44 timestamp = Time.now.to_i 45 45 trigger_watch = 0 46 46 elsif Time.now.to_i - timestamp > 3600 47 #system("rrdtool update #{rrdpath} N:#{counter}:0")47 system("rrdtool update #{rrdpath} N:#{counter}:0") 48 48 timestamp = Time.now.to_i 49 49 end -
de.wigbels.ruby/hothotread/web/index.html
rb86cdd7 raa10f5c 33 33 <img src="counter_1week.png"> 34 34 35 <h2>Wasser</h2> 36 <img src="wconsum_10minutes.png"> 37 <img src="wconsum_30minutes.png"> 38 <img src="wconsum_1hour.png"> 39 <img src="wconsum_3hour.png"> 40 <img src="wconsum_6hour.png"> 41 <img src="wconsum_12hour.png"> 42 <img src="wconsum_1day.png"> 43 <img src="wconsum_1week.png"> 44 <img src="wconsum_1month.png"> 45 <img src="wconsum_1year.png"> 46 <img src="wconsum_2year.png"> 47 <img src="wcounter_1month.png"> 48 <img src="wcounter_1week.png"> 49 35 50 </body> 36 51 </html>
Note:
See TracChangeset
for help on using the changeset viewer.