fix data extraction from influx due to chaning tag names
[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 set origin 0.0, 0.0
49
50
51 min_h = h_mean - h_spread
52 max_h = h_mean + h_spread
53
54 plot \
55  "/dev/shm/DHT22-humidity" using ($1+7200):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" \
56 ,"/dev/shm/rtl_433-9-172-humidity" using ($1+7200):($2) with lines title "vani" \
57 ,"/dev/shm/rtl_433-9-75-humidity"  using ($1+7200):($2) with lines title "kupaona" \
58 ,"/dev/shm/rtl_433-9-141-humidity" using ($1+7200):($2) with lines title "kuhunja"
59
60 unset multiplot