89e26098db24120dff468f9ca2c0216c89ff854a
[vaillant-thermostat] / temp3.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 if (strlen(interval) > 2) {
12         set xtics format "%H"
13 } else {
14         set xtics format "%H:%M"
15 }
16
17 set pointsize 0.2
18
19 set output '/dev/shm/temp3.png'
20
21 unset border
22
23 set multiplot
24
25
26 if ( gray == 1 ) {
27         set size 1, 0.5
28         set origin 0.0, 0.5
29 } else {
30         set size 1.0, 0.5
31         set origin 0.0, 0.5
32 }
33
34 #if ( ! exists("t_mean")) {
35 if (1) {
36
37 t_mean=25
38 t_spread=30
39
40 h_mean = 50
41 h_spread = 50
42
43 print "using default mean and spread"
44 }
45
46 min_t = t_mean - ( t_spread / 2 )
47 max_t = t_mean + ( t_spread / 2 )
48
49 if ( ! exists("tz_secs") ) {
50         tz_secs=7200
51 }
52
53 set ytics nomirror
54 unset y2tics
55 set y2range [0:50]
56
57 plot \
58  "/dev/shm/data.DHT22-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DHT22 unutra" lt rgb "#ff00ff" \
59 ,"/dev/shm/data.DS18B20-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with dots title "DS18B20 unutra" lt rgb "#880088" \
60 ,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($2) with dots title "ir unutra" lt rgb "#884400" \
61 ,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($2) with dots title "kuhinja" lt rgb "#ff8844" \
62 ,"/dev/shm/data.kupaona-t-h"  using ($1+tz_secs):($2) with dots title "kupaona" lt rgb "#00ff80" \
63 ,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($2) with dots title "soba" lt rgb "#ffcc00" \
64 ,"/dev/shm/data.vani-t-h" using ($1+tz_secs):($2) with dots title "vani" lt rgb "#00cc00" \
65 ,"/dev/shm/data.kutija-t-h" using ($1+tz_secs):($2) with dots title "kutija" lt rgb "#0088cc" \
66 ,"/dev/shm/data.boiler-d" using ($1+tz_secs):($2 > 0 ? 50 : 0) axes x1y2 with dots title "boiler on/off" lt rgb "#aaaaaa"
67
68
69 if ( exists("lines") && lines == 1 ) {
70 plot \
71  "/dev/shm/data.DHT22-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DHT22 unutra" lt rgb "#ff00ff" \
72 ,"/dev/shm/data.DS18B20-t" using ($1+tz_secs):($2 > min_t && $2 < max_t ? $2 : '') with lines title "DS18B20 unutra" lt rgb "#880088" \
73 ,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($2) with lines title "ir unutra" lt rgb "#884400" \
74 ,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($2) with lines title "kuhinja" lt rgb "#ff8844" \
75 ,"/dev/shm/data.kupaona-t-h"  using ($1+tz_secs):($2) with lines title "kupaona" lt rgb "#00ff80" \
76 ,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($2) with lines title "soba" lt rgb "#ffcc00" \
77 ,"/dev/shm/data.vani-t-h" using ($1+tz_secs):($2) with lines title "vani" lt rgb "#00cc00" \
78 ,"/dev/shm/data.kutija-t-h" using ($1+tz_secs):($2) with lines title "kutija" lt rgb "#0088cc"  \
79 ,"/dev/shm/data.boiler-d" using ($1+tz_secs):($2 > 0 ? 50 : 0) axes x1y2 with dots title "boiler on/off" lt rgb "#aaaaaa"
80 }
81
82 if ( gray == 1 ) {
83         set origin 0.0, 0.0
84 } else {
85         set origin 0.0, 0.0
86 }
87
88 min_h = h_mean - h_spread
89 max_h = h_mean + h_spread
90
91 plot \
92  "/dev/shm/data.DHT22-h" using ($1+tz_secs):($2 > min_h && $2 < max_h ? $2 : '') with dots title "DHT22 unutra" lt rgb "#ff00ff" \
93 ,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($3) with dots title "ir unutra" lt rgb "#884400" \
94 ,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($3) with dots title "kuhinja" lt rgb "#ff8844" \
95 ,"/dev/shm/data.kupaona-t-h"  using ($1+tz_secs):($3) with dots title "kupaona" lt rgb "#00ff80" \
96 ,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($3) with dots title "soba" lt rgb "#ffcc00" \
97 ,"/dev/shm/data.vani-t-h" using ($1+tz_secs):($3) with dots title "vani" lt rgb "#00cc00" \
98 ,"/dev/shm/data.kutija-t-h" using ($1+tz_secs):($3) with dots title "kutija" lt rgb "#0088cc" \
99 ,"/dev/shm/data.boiler-d" using ($1+tz_secs):($2 > 0 ? 50 : 0) axes x1y2 with dots title "boiler on/off" lt rgb "#aaaaaa"
100
101 if ( exists("lines") && lines == 1 ) {
102 plot \
103  "/dev/shm/data.DHT22-h" using ($1+tz_secs):($2 > min_h && $2 < max_h ? $2 : '') with lines title "DHT22 unutra" lt rgb "#ff00ff" \
104 ,"/dev/shm/data.ir-dht22-t-h" using ($1+tz_secs):($3) with lines title "ir unutra" lt rgb "#884400" \
105 ,"/dev/shm/data.kuhinja-t-h" using ($1+tz_secs):($3) with lines title "kuhinja" lt rgb "#ff8844" \
106 ,"/dev/shm/data.kupaona-t-h"  using ($1+tz_secs):($3) with lines title "kupaona" lt rgb "#00ff80" \
107 ,"/dev/shm/data.soba-t-h" using ($1+tz_secs):($3) with lines title "soba" lt rgb "#ffcc00" \
108 ,"/dev/shm/data.vani-t-h" using ($1+tz_secs):($3) with lines title "vani" lt rgb "#00cc00" \
109 ,"/dev/shm/data.kutija-t-h" using ($1+tz_secs):($3) with lines title "kutija" lt rgb "#0088cc" \
110 ,"/dev/shm/data.boiler-d" using ($1+tz_secs):($2 > 0 ? 50 : 0) axes x1y2 with dots title "boiler on/off" lt rgb "#aaaaaa"
111 }
112 unset multiplot