4b3fd0dc98dea763083a9fd3e8d23c80670de904
[vaillant-thermostat] / temp2.gnuplot
1 if ( gray == 1 ) {
2 #       set terminal pngcairo mono size 600,800
3         set terminal pngcairo color size 600,800
4 } else {
5         set terminal pngcairo color size 1200,600
6 }
7
8 set xdata time
9 set timefmt "%s"
10
11 set xtics format "%H"
12
13 set pointsize 0.2
14
15 set output '/dev/shm/temp2.png'
16
17 unset border
18
19 set multiplot
20
21
22 if ( gray == 1 ) {
23         set size 1, 0.5
24         set origin 0.0, 0.5
25 } else {
26         set size 1.0, 0.5
27         set origin 0.0, 0.5
28 }
29
30 #if ( ! exists("t_mean")) {
31 if (1) {
32
33 t_mean=25
34 t_spread=25
35
36 h_mean = 50
37 h_spread = 30
38
39 print "using default mean and spread"
40 }
41
42 min_t = t_mean - ( t_spread / 2 )
43 max_t = t_mean + ( t_spread / 2 )
44
45 set ytics nomirror
46 set y2tics
47
48 plot \
49  "/dev/shm/DHT22-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 unutra" \
50 ,"/dev/shm/rtl_433-9-172-temperature" using ($1+7200):($2) with dots title "vani" \
51 ,"/dev/shm/rtl_433-9-75-temperature"  using ($1+7200):($2) with dots title "kupaona" \
52 ,"/dev/shm/rtl_433-9-141-temperature" using ($1+7200):($2) with dots title "kuhinja" \
53 ,"/dev/shm/DS18B20-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 unutra"
54
55
56 if ( exists("lines") && lines == 1 ) {
57 plot \
58  "/dev/shm/DHT22-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DHT22 unutra" \
59 ,"/dev/shm/rtl_433-9-172-temperature" using ($1+7200):($2) with lines title "vani" \
60 ,"/dev/shm/rtl_433-9-75-temperature"  using ($1+7200):($2) with lines title "kupaona" \
61 ,"/dev/shm/rtl_433-9-141-temperature" using ($1+7200):($2) with lines title "kuhinja" \
62 ,"/dev/shm/DS18B20-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DS18B20 unutra"
63 }
64
65 if ( gray == 1 ) {
66         set origin 0.0, 0.0
67 } else {
68         set origin 0.0, 0.0
69 }
70
71 min_h = h_mean - h_spread
72 max_h = h_mean + h_spread
73
74 plot \
75  "/dev/shm/DHT22-humidity" using ($1+7200):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" \
76 ,"/dev/shm/rtl_433-9-172-humidity" using ($1+7200):($2) with lines title "vani" \
77 ,"/dev/shm/rtl_433-9-75-humidity"  using ($1+7200):($2) with lines title "kupaona" \
78 ,"/dev/shm/rtl_433-9-141-humidity" using ($1+7200):($2) with lines title "kuhunja"
79
80 unset multiplot