-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgentempgraph.sh
More file actions
executable file
·59 lines (49 loc) · 2.8 KB
/
gentempgraph.sh
File metadata and controls
executable file
·59 lines (49 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
DATA_Dir=/home/pi/Data
TODAY=`date "+%m/%d/%y %H:%M:%S"`
YESTERDAY=`date "+%m/%d/%y %H:%M:%S" --date="-1 day"`
DAILY=`date "+%m/%d/%y %H:%M:%S" --date="-12 hour"`
WEEK=`date "+%m/%d/%y" --date="-7 day"`
MONTH=`date "+%m/%d/%y" --date="-1 month"`
gnuplot <<-EOF
set term png size 1024, 2048
set output '$DATA_Dir/Temp.png'
#unset key
set key left top
set ylabel 'Temperature (Celsius)'
set border 3
set xtics nomirror
set xtics rotate
set ytics nomirror
unset xlabel
set multiplot layout 4, 1 title "Temperatures"
set title 'By Hour'
set xdata time
set timefmt "%m/%d/%y %H:%M:%S"
set format x "%m/%d/%y %H:%M:%S"
set xtics autofreq
set xrange ["$DAILY":"$TODAY"]
plot '$DATA_Dir/Int_temp.dat' u 3:2 t 'Interior Temp Profile' lc 2 smooth sbezier, '$DATA_Dir/Int_temp.dat' every 300 u 3:2 t 'Interior Temp Points' w points lc 2 pt 1 ps 1, '$DATA_Dir/Ext_temp.dat' u 3:2 t 'Exterior Temp Profile' lc 1 smooth sbezier, '$DATA_Dir/Ext_temp.dat' every 300 u 3:2 t 'Exterior Temp Points' w points lc 1 pt 1 ps 1
set title 'By Day'
set xdata time
set timefmt "%m/%d/%y"
set format x "%m/%d/%y"
set xtics autofreq
set xrange ["$YESTERDAY":"$TODAY"]
plot '$DATA_Dir/Int_temp.dat' u 3:2 t 'Interior Temp Profile' lc 2 smooth sbezier, '$DATA_Dir/Int_temp.dat' every 300 u 3:2 t 'Interior Temp Points' w points lc 2 pt 1 ps 1, '$DATA_Dir/Ext_temp.dat' u 3:2 t 'Exterior Temp Profile' lc 1 smooth sbezier, '$DATA_Dir/Ext_temp.dat' every 300 u 3:2 t 'Exterior Temp Points' w points lc 1 pt 1 ps 1
set title 'By Week'
set xdata time
set timefmt "%m/%d/%y"
set format x "%m/%d/%y"
set xtics autofreq
set xrange ["$WEEK":"$TODAY"]
plot '$DATA_Dir/Int_temp.dat' u 3:2 t 'Interior Temp Profile' lc 2 smooth sbezier, '$DATA_Dir/Int_temp.dat' every 300 u 3:2 t 'Interior Temp Points' w points lc 2 pt 1 ps 1, '$DATA_Dir/Ext_temp.dat' u 3:2 t 'Exterior Temp Profile' lc 1 smooth sbezier, '$DATA_Dir/Ext_temp.dat' every 300 u 3:2 t 'Exterior Temp Points' w points lc 1 pt 1 ps 1
set timefmt "%m/%d/%y %H:%M:%S"
set xdata time
set title 'Monthly'
set format x "%m/%d/%y"
set xrange ["$MONTH":"$TODAY"]
set xtics autofreq
plot '$DATA_Dir/Int_temp.dat' u 3:2 t 'Interior Temp Profile' lc 2 smooth sbezier, '$DATA_Dir/Int_temp.dat' every 300 u 3:2 t 'Interior Temp Points' w points lc 2 pt 1 ps 1, '$DATA_Dir/Ext_temp.dat' u 3:2 t 'Exterior Temp Profile' lc 1 smooth sbezier, '$DATA_Dir/Ext_temp.dat' every 300 u 3:2 t 'Exterior Temp Points' w points lc 1 pt 1 ps 1
EOF
cp $DATA_Dir/Temp.png /var/www/html