61e64a0bb673143999b2c8fd1cd888ea687c878f
[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/rtl_433-temperature" using ($1+7200):($2) with dots title "vani" \
43 ,"/dev/shm/DHT22-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 unutra" \
44 ,"/dev/shm/rtl_433-9-temperature" using ($1+7200):($3 == 1 ? $2 : '') with dots title "vani" \
45 ,"/dev/shm/rtl_433-9-temperature" using ($1+7200):($3 == 2 ? $2 : '') with dots title "kupaona" \
46 ,"/dev/shm/rtl_433-9-temperature" using ($1+7200):($3 == 3 ? $2 : '') with dots title "kuhinja" \
47 ,"/dev/shm/DS18B20-temperature" using ($1+7200):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 unutra"
48
49 set origin 0.0, 0.0
50
51
52 min_h = h_mean - h_spread
53 max_h = h_mean + h_spread
54
55 plot \
56  "/dev/shm/rtl_433-humidity" using ($1+7200):($2 > 10 ? $2 : '') with lines title "vani" \
57 ,"/dev/shm/DHT22-humidity" using ($1+7200):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" \
58 ,"/dev/shm/rtl_433-9-172-humidity" using ($1+7200):($2) with lines title "vani" \
59 ,"/dev/shm/rtl_433-9-75-humidity" using ($1+7200):($2) with lines title "kupaona" \
60 ,"/dev/shm/rtl_433-9-141-humidity" using ($1+7200):($2) with lines title "kuhunja"
61
62 unset multiplot