X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=temp2.gnuplot;h=e785eb82488a9287c78c567a8a023294c0ebe714;hb=2db91eb214086fced01cfcf40c1563ac89101242;hp=304d54e5395a0002f47691dd9833581cde672fea;hpb=afd64ee58cc919b11aaaa1d58ef054178eac0535;p=vaillant-thermostat diff --git a/temp2.gnuplot b/temp2.gnuplot index 304d54e..e785eb8 100644 --- a/temp2.gnuplot +++ b/temp2.gnuplot @@ -1,43 +1,86 @@ -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 -if ( ! exists("t_mean")) { +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=26 -t_spread=5 +t_mean=25 +t_spread=25 h_mean = 50 -h_spread = 30 +h_spread = 50 print "using default mean and spread" } -min_t = t_mean - t_spread -max_t = t_mean + t_spread - -plot "/dev/shm/DS18B20-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 deg. C" \ -,"/dev/shm/DHT22-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 deg. C" \ -,"/dev/shm/rtl_433-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "RTL 433 deg. C" - -set origin 0.0, 0.0 +min_t = t_mean - ( t_spread / 2 ) +max_t = t_mean + ( t_spread / 2 ) + +set ytics nomirror +set y2tics + +plot \ + "/dev/shm/DHT22-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 unutra" \ +,"/dev/shm/rtl_433-9-172-temperature" using ($1+7200):($2) with dots title "vani" \ +,"/dev/shm/rtl_433-9-75-temperature" using ($1+7200):($2) with dots title "kupaona" \ +,"/dev/shm/rtl_433-9-141-temperature" using ($1+7200):($2) with dots title "kuhinja" \ +,"/dev/shm/DS18B20-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 unutra" \ +,"/dev/shm/rtl_433-183-temperature" using ($1+7200):($2) with dots title "soba" lt rgb "#808000" + + +if ( exists("lines") && lines == 1 ) { +plot \ + "/dev/shm/DHT22-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DHT22 unutra" \ +,"/dev/shm/rtl_433-9-172-temperature" using ($1+7200):($2) with lines title "vani" \ +,"/dev/shm/rtl_433-9-75-temperature" using ($1+7200):($2) with lines title "kupaona" \ +,"/dev/shm/rtl_433-9-141-temperature" using ($1+7200):($2) with lines title "kuhinja" \ +,"/dev/shm/DS18B20-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DS18B20 unutra" \ +,"/dev/shm/rtl_433-183-temperature" using ($1+7200):($2) with lines title "soba" lt rgb "#808000" +} +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 -plot "/dev/shm/DHT22-humidity" using ($1+7200):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 % hum" +plot \ + "/dev/shm/DHT22-humidity" using ($1+7200):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" \ +,"/dev/shm/rtl_433-9-172-humidity" using ($1+7200):($2) with lines title "vani" \ +,"/dev/shm/rtl_433-9-75-humidity" using ($1+7200):($2) with lines title "kupaona" \ +,"/dev/shm/rtl_433-9-141-humidity" using ($1+7200):($2) with lines title "kuhunja" unset multiplot