2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00
fhem-mirror/fhem/webfrontend/pgm2/ks300_1.gplot
rudolfkoenig 056fc174de Small fixes / avg_month gnuplot
git-svn-id: https://svn.fhem.de/fhem/trunk@220 2b470e98-0d58-463d-a4d8-8e2adae1ed80
2008-08-01 07:44:06 +00:00

46 lines
1.5 KiB
Plaintext

############################
# Display the temperature and the humidity values of a KS300.
# Corresponding FileLog definition:
# define ks300log FileLog /var/log/fhem/ks300-%Y-%U.log ks300:.*H:.*
# or (SVG/gnuplot-scroll)
# define ks300log FileLog /var/log/fhem/ks300-%Y.log ks300:.*H:.*
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set ytics nomirror
set y2tics
set title '<TL>'
set grid
set y2label "Temperature in C"
set format y "%0.1f"
set ylabel "Rain (l/m2)"
set yrange [0:]
# Computing Rain/h and Rain/d values by accumulating the changes.
#FileLog 4:IR:0:
#FileLog 10:IR:0:delta-h
#FileLog 10:IR:0:delta-d
plot "<IN>" using 1:4 axes x1y2 title 'Temperature' with lines lw 2,\
"<grep -v avg_ <IN> | perl -ane '\
@a = split(\"[_:]\", $F[0]);\
if(defined($lh) && $lh ne $a[1])\
{ printf(\"${ld}_$lh:30:00 %f\n\", $hv); $hv = 0; }\
if($lv) { $hv += ($F[9]-$lv); }\
$lh = $a[1]; $ld = $a[0]; $lv = $F[9];\
END { printf(\"${ld}_$lh:30:00 %f\n\", $hv) }'"\
using 1:2 axes x1y1 title 'Rain/h' with histeps,\
"<grep -v avg_ <IN> | perl -ane '\
@a = split(\"[_]\", $F[0]);\
if(defined($ld) && $ld ne $a[0]) {\
printf(\"${ld}_12:00:00 %f\n\", $dv); $dv = 0; }\
if($lv) { $dv += ($F[9]-$lv); }\
$ld = $a[0]; $lv = $F[9];\
END {printf(\"${ld}_12:00:00 %f\n\", $dv)}'"\
using 1:2 axes x1y1 title 'Rain/day' with histeps