X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=temp2.gnuplot;h=cb8108174d02e68fc7e62149ec23c462a89cd2ac;hb=f49df6f1f19ebc3ac79451b12610c0bc0b3d78e2;hp=0d4bf08a734f1ef08053c04944d2accd5dffd93a;hpb=645d67adb708bcf0e12d6a7becdee910258d30fc;p=vaillant-thermostat diff --git a/temp2.gnuplot b/temp2.gnuplot index 0d4bf08..cb81081 100644 --- a/temp2.gnuplot +++ b/temp2.gnuplot @@ -1,23 +1,96 @@ -set terminal pngcairo mono size 600,800 +if ( gray == 1 ) { +# set terminal pngcairo mono size 600,800 + set terminal pngcairo color size 600,800 +} else { + set terminal pngcairo color size 1200,600 +} set xdata time set timefmt "%s" -set xtics format "%H" +if (strlen(interval) > 2) { + set xtics format "%H" +} else { + set xtics format "%H:%M" +} set pointsize 0.2 set output '/dev/shm/temp2.png' +unset border + set multiplot -set size 1, 0.5 -set origin 0.0, 0.5 -plot "/dev/shm/DS18B20-temperature" using ($1+7200):($2 > 3 ? $2 : '') with dots title "DS18B20 deg. C","/dev/shm/DHT22-temperature" using ($1+7200):($2 > 3 && $2 < 45 ? $2 : '') with dots title "DHT22 deg. C" +if ( gray == 1 ) { + set size 1, 0.5 + set origin 0.0, 0.5 +} else { + set size 1.0, 0.5 + set origin 0.0, 0.5 +} + +#if ( ! exists("t_mean")) { +if (1) { + +t_mean=25 +t_spread=30 + +h_mean = 50 +h_spread = 50 + +print "using default mean and spread" +} + +min_t = t_mean - ( t_spread / 2 ) +max_t = t_mean + ( t_spread / 2 ) + +if ( ! exists("tz_secs") ) { + tz_secs=7200 +} + +set ytics nomirror +unset y2tics +set y2range [0:50] + +plot \ + "/dev/shm/DHT22-temperature" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 unutra" lt rgb "#ff00ff" \ +,"/dev/shm/DS18B20-temperature" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 unutra" lt rgb "#880088" \ +,"/dev/shm/rtl_433-kuhinja-temperature" using ($1+tz_secs):($2) with dots title "kuhinja" lt rgb "#ff4444" \ +,"/dev/shm/rtl_433-kupaona-temperature" using ($1+tz_secs):($2) with dots title "kupaona" lt rgb "#8888ff" \ +,"/dev/shm/rtl_433-soba-temperature" using ($1+tz_secs):($2) with dots title "soba" lt rgb "#ffcc00" \ +,"/dev/shm/rtl_433-vani-temperature" using ($1+tz_secs):($2) with dots title "vani" lt rgb "#00ff00" \ +,"/dev/shm/boiler.d" using ($1+tz_secs):($2 > 0 ? 48 : 2) axes x1y2 with dots title "boiler on/off" lt rgb "#000000" + + +if ( exists("lines") && lines == 1 ) { +plot \ + "/dev/shm/DHT22-temperature" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DHT22 unutra" lt rgb "#ff00ff" \ +,"/dev/shm/DS18B20-temperature" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DS18B20 unutra" lt rgb "#880088" \ +,"/dev/shm/rtl_433-kuhinja-temperature" using ($1+tz_secs):($2) with lines title "kuhinja" lt rgb "#ff4444" \ +,"/dev/shm/rtl_433-kupaona-temperature" using ($1+tz_secs):($2) with lines title "kupaona" lt rgb "#8888ff" \ +,"/dev/shm/rtl_433-soba-temperature" using ($1+tz_secs):($2) with lines title "soba" lt rgb "#ffcc00" \ +,"/dev/shm/rtl_433-vani-temperature" using ($1+tz_secs):($2) with lines title "vani" lt rgb "#00ff00" +} + +if ( gray == 1 ) { + set origin 0.0, 0.0 +} else { + set origin 0.0, 0.0 +} + +min_h = h_mean - h_spread +max_h = h_mean + h_spread -set origin 0.0, 0.0 +plot \ + "/dev/shm/DHT22-humidity" using ($1+tz_secs):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" lt rgb "#ff00ff" \ +,"/dev/shm/rtl_433-kuhinja-humidity" using ($1+tz_secs):($2) with lines title "kuhunja" lt rgb "#ff4444" \ +,"/dev/shm/rtl_433-kupaona-humidity" using ($1+tz_secs):($2) with lines title "kupaona" lt rgb "#8888ff" \ +,"/dev/shm/rtl_433-vani-humidity" using ($1+tz_secs):($2) with lines title "vani" lt rgb "#00ff00 " \ +,"/dev/shm/boiler.d" using ($1+tz_secs):($2 > 0 ? 48 : 2) axes x1y2 with dots title "boiler on/off" lt rgb "#000000" -plot "/dev/shm/DHT22-humidity" using ($1+7200):($2 > 3 ? $2 : '') with dots title "DHT22 % hum" +if ( exists("lines") && lines == 1 ) { +} unset multiplot