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