Commit 80d30e50 authored by julric's avatar julric

changed scripts to English language, added draw_rrd.sh for generating graphs by using parameter

parent 8827f2b8
#! /bin/bash
echo -e ""
#
#
# This script generates a graphs from a rrd with 9 datasources (tempbmp,tempdht,press,humi,light,no2,co,vol,smoke)
#
#
RRDTOOL="/usr/bin/rrdtool" # absolute path to rrdtools
RRD_OPTIONS="--width=800 --height=300 --pango-markup" # set your rrd-options for generating graphs
RRDTOOL="/usr/bin/rrdtool"
RRD_DB="../data_airpi.rrd"
if [ $# -lt 3 ]
then
echo -e "This script generates a graphs from a rrd with 9 datasources (tempbmp,tempdht,press,humi,light,no2,co,vol,smoke).\nFor more information please open this script in Your favorite editor.\n\nUsage:\t ./draw_rrd.sh rrd_file.rrd output_path period\n\ne.g.:\t ./draw_rrd.sh /srv/airpi/data_airpi.rrd ../graph day\n\nValid periods are hour, day, week, month, year"
elif [ ! -f $1 ]
then
echo -e "RRD '$1' not found."
else
GRAPH_PATH="../graph"
RRD_DB=$1
GRAPH_PATH=$2
PERIOD=$3
# hour
$RRDTOOL graph $GRAPH_PATH/airpi-temp-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Temperatur (°C)' \
case $PERIOD in
hour)
RRD_PERIOD="1h"
;;
day)
RRD_PERIOD="1d"
;;
week)
RRD_PERIOD="1w"
;;
month)
RRD_PERIOD="1m"
;;
year)
RRD_PERIOD="1y"
;;
*)
echo -e "Unknown period '"$PERIOD"' - please use hour, day, week, month or year"
exit 0
;;
esac
$RRDTOOL graph $GRAPH_PATH/airpi-tempbmp-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'temperature (°C)' --lower-limit 0 \
DEF:temp=$RRD_DB:tempbmp:AVERAGE \
DEF:tempmin=$RRD_DB:tempbmp:MIN \
DEF:tempmax=$RRD_DB:tempbmp:MAX \
AREA:temp#FF4141 \
LINE1:temp#bf3434:"<big>Temperatur (BMP085)</big> " \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>temperature (BMP085)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-tempbmp-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-tempbmp-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-tempbmp-$PERIOD.png'"
fi
# hour
$RRDTOOL graph $GRAPH_PATH/airpi-press-hour.png -a PNG --width=800 --height=300 --lower-limit 0 \
--start -1h --pango-markup --vertical-label 'Druck (hPa)' --units-exponent 0 --slope-mode \
$RRDTOOL graph $GRAPH_PATH/airpi-tempdht-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'temperature (°C)' --lower-limit 0 \
DEF:temp=$RRD_DB:tempdht:AVERAGE \
DEF:tempmin=$RRD_DB:tempdht:MIN \
DEF:tempmax=$RRD_DB:tempdht:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>temperature (DHT22)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-tempdht-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-tempdht-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-tempdht-$PERIOD.png'"
fi
$RRDTOOL graph $GRAPH_PATH/airpi-press-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'pressure (hPa)' --lower-limit 940 --upper-limit 1060 --rigid --units-exponent 0 \
DEF:press=$RRD_DB:press:AVERAGE \
DEF:pressmin=$RRD_DB:press:MIN \
DEF:pressmax=$RRD_DB:press:MAX \
AREA:press#FF4141 \
LINE1:press#bf3434:"<big>Druck</big> " \
AREA:press#acc6fb \
LINE1:press#4f5a72:"<big>pressure (BMP085)</big> " \
VDEF:press_min=press,MINIMUM \
'GPRINT:press_min:<b>Minimum</b>\: %5.0lf hPa ' \
'GPRINT:press_min:<b>minimum</b>\: %5.0lf hPa ' \
VDEF:press_average=press,AVERAGE \
'GPRINT:press_average:<b>Durchschnitt</b>\: %5.0lf hPa ' \
'GPRINT:press_average:<b>average</b>\: %5.0lf hPa ' \
VDEF:press_max=press,MAXIMUM \
'GPRINT:press_max:<b>Maximum</b>\: %5.0lf hPa ' \
'GPRINT:press_max:<b>maximum</b>\: %5.0lf hPa ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-press-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-press-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-press-$PERIOD.png'"
fi
$RRDTOOL graph $GRAPH_PATH/airpi-humi-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'humidity (%)' --lower-limit 0 --upper-limit 100 \
DEF:humi=$RRD_DB:humi:AVERAGE \
DEF:humimin=$RRD_DB:humi:MIN \
DEF:humimax=$RRD_DB:humi:MAX \
AREA:humi#acc6fb \
LINE1:humi#4f5a72:"<big>humidity (DHT22)</big> " \
VDEF:humi_min=humi,MINIMUM \
'GPRINT:humi_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:humi_average=humi,AVERAGE \
'GPRINT:humi_average:<b>average</b>\: %5.0lf %% ' \
VDEF:humi_max=humi,MAXIMUM \
'GPRINT:humi_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-humi-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-humi-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-humi-$PERIOD.png'"
fi
# day
#$RRDTOOL graph $GRAPH_PATH/flukso-day.png -a PNG --width=800 --height=300 --lower-limit 0 \
#--start -1d --end -5min --pango-markup --x-grid HOUR:1:HOUR:6:HOUR:2:0:%H:%M --grid-dash 1:0 \
#--vertical-label 'Stromverbrauch (Watt)' --units-exponent 0 --slope-mode \
$RRDTOOL graph $GRAPH_PATH/airpi-light-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'light level (%)' --lower-limit 0 --upper-limit 110 \
DEF:light=$RRD_DB:light:AVERAGE \
DEF:lightmax=$RRD_DB:light:MAX \
CDEF:scaled_light=light,10250000,/ \
CDEF:light_inverse=1,scaled_light,- \
CDEF:light_percent=light_inverse,100,* \
AREA:light_percent#acc6fb \
LINE1:light_percent#4f5a72:"<big>light level (LDR)</big> " \
VDEF:light_min=light_percent,MINIMUM \
'GPRINT:light_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:light_average=light_percent,AVERAGE \
'GPRINT:light_average:<b>average</b>\: %5.0lf %% ' \
VDEF:light_max=light_percent,MAXIMUM \
'GPRINT:light_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-light-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-light-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-light-$PERIOD.png'"
fi
$RRDTOOL graph $GRAPH_PATH/airpi-no2-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'nitrogen dioxide' \
DEF:no2=$RRD_DB:no2:AVERAGE \
DEF:no2min=$RRD_DB:no2:MIN \
DEF:no2max=$RRD_DB:no2:MAX \
AREA:no2#acc6fb \
LINE1:no2#4f5a72:"<big>nitrogen dioxide (MiCS-2710)</big> " \
VDEF:no2_min=no2,MINIMUM \
'GPRINT:no2_min:<b>minimum</b>\: %5.0lf ' \
VDEF:no2_average=no2,AVERAGE \
'GPRINT:no2_average:<b>average</b>\: %5.0lf ' \
VDEF:no2_max=no2,MAXIMUM \
'GPRINT:no2_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-no2-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-no2-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-no2-$PERIOD.png'"
fi
# week
#$RRDTOOL graph $GRAPH_PATH/flukso-week.png -a PNG --width=800 --height=300 --lower-limit 0 \
#--start -1w --end -5min --pango-markup --x-grid DAY:1:WEEK:1:DAY:1:86400:%d.%b --grid-dash 1:0 \
#--vertical-label 'Stromverbrauch (Watt)' --units-exponent 0 --slope-mode \
$RRDTOOL graph $GRAPH_PATH/airpi-co-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'carbon monoxide' \
DEF:co=$RRD_DB:co:AVERAGE \
DEF:comin=$RRD_DB:co:MIN \
DEF:comax=$RRD_DB:co:MAX \
AREA:co#acc6fb \
LINE1:co#4f5a72:"<big>carbon monoxide (MiCS-5525)</big> " \
VDEF:co_min=co,MINIMUM \
'GPRINT:co_min:<b>minimum</b>\: %5.0lf ' \
VDEF:co_average=co,AVERAGE \
'GPRINT:co_average:<b>average</b>\: %5.0lf ' \
VDEF:co_max=co,MAXIMUM \
'GPRINT:co_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-co-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-co-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-co-$PERIOD.png'"
fi
# month
#$RRDTOOL graph $GRAPH_PATH/flukso-month.png -a PNG --width=800 --height=300 --lower-limit 0 \
#--start -1m --end -5min --pango-markup --vertical-label 'Stromverbrauch (Watt)' --units-exponent 0 --slope-mode \
$RRDTOOL graph $GRAPH_PATH/airpi-vol-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'volume' \
DEF:vol=$RRD_DB:vol:AVERAGE \
DEF:volmin=$RRD_DB:vol:MIN \
DEF:volmax=$RRD_DB:vol:MAX \
AREA:vol#acc6fb \
LINE1:vol#4f5a72:"<big>volume (ABM_713_RC)</big> " \
VDEF:vol_min=vol,MINIMUM \
'GPRINT:vol_min:<b>minimum</b>\: %5.0lf ' \
VDEF:vol_average=vol,AVERAGE \
'GPRINT:vol_average:<b>average</b>\: %5.0lf ' \
VDEF:vol_max=vol,MAXIMUM \
'GPRINT:vol_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-vol-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-vol-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-vol-$PERIOD.png'"
fi
# year
#$RRDTOOL graph $GRAPH_PATH/flukso-year.png -a PNG --width=800 --height=300 --lower-limit 0 --upper-limit 1000 \
#--start -1y --end -5min --pango-markup --vertical-label 'Stromverbrauch (Watt)' --units-exponent 0 --slope-mode \
$RRDTOOL graph $GRAPH_PATH/airpi-smoke-$PERIOD.png -a PNG --start -$RRD_PERIOD $RRD_OPTIONS --vertical-label 'smoke' \
DEF:smoke=$RRD_DB:smoke:AVERAGE \
AREA:smoke#acc6fb \
LINE1:smoke#4f5a72:"<big>smoke (TGS2600)</big> " \
VDEF:smoke_min=smoke,MINIMUM \
'GPRINT:smoke_min:<b>minimum</b>\: %5.0lf ' \
VDEF:smoke_average=smoke,AVERAGE \
'GPRINT:smoke_average:<b>average</b>\: %5.0lf ' \
VDEF:smoke_max=smoke,MAXIMUM \
'GPRINT:smoke_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
if [ -f $GRAPH_PATH/airpi-smoke-$PERIOD.png ]
then
echo -e "'$GRAPH_PATH/airpi-smoke-$PERIOD.png' successfully generated."
else
echo -e "Something went wrong while generating '$GRAPH_PATH/airpi-smoke-$PERIOD.png'"
fi
fi
......@@ -7,136 +7,136 @@ GRAPH_PATH="../graph"
$RRDTOOL graph $GRAPH_PATH/airpi-tempbmp-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Temperatur (°C)' --lower-limit 0 \
--start -1d --pango-markup --vertical-label 'temperature (°C)' --lower-limit 0 \
DEF:temp=$RRD_DB:tempbmp:AVERAGE \
DEF:tempmin=$RRD_DB:tempbmp:MIN \
DEF:tempmax=$RRD_DB:tempbmp:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (BMP085)</big> " \
LINE1:temp#4f5a72:"<big>temperature (BMP085)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-tempdht-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Temperatur (°C)' --lower-limit 0 \
--start -1d --pango-markup --vertical-label 'temperature (°C)' --lower-limit 0 \
DEF:temp=$RRD_DB:tempdht:AVERAGE \
DEF:tempmin=$RRD_DB:tempdht:MIN \
DEF:tempmax=$RRD_DB:tempdht:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (DHT22)</big> " \
LINE1:temp#4f5a72:"<big>temperature (DHT22)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-press-day.png -a PNG --width=800 --height=300 --lower-limit 940 \
--start -1d --pango-markup --vertical-label 'Druck (hPa)' --upper-limit 1060 --rigid --units-exponent 0 \
--start -1d --pango-markup --vertical-label 'pressure (hPa)' --upper-limit 1060 --rigid --units-exponent 0 \
DEF:press=$RRD_DB:press:AVERAGE \
DEF:pressmin=$RRD_DB:press:MIN \
DEF:pressmax=$RRD_DB:press:MAX \
AREA:press#acc6fb \
LINE1:press#4f5a72:"<big>Druck (BMP085)</big> " \
LINE1:press#4f5a72:"<big>pressure (BMP085)</big> " \
VDEF:press_min=press,MINIMUM \
'GPRINT:press_min:<b>Minimum</b>\: %5.0lf hPa ' \
'GPRINT:press_min:<b>minimum</b>\: %5.0lf hPa ' \
VDEF:press_average=press,AVERAGE \
'GPRINT:press_average:<b>Durchschnitt</b>\: %5.0lf hPa ' \
'GPRINT:press_average:<b>average</b>\: %5.0lf hPa ' \
VDEF:press_max=press,MAXIMUM \
'GPRINT:press_max:<b>Maximum</b>\: %5.0lf hPa ' \
'GPRINT:press_max:<b>maximum</b>\: %5.0lf hPa ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-humi-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Luftfeuchtigkeit (%)' --lower-limit 0 --upper-limit 100 \
--start -1d --pango-markup --vertical-label 'humidity (%)' --lower-limit 0 --upper-limit 100 \
DEF:humi=$RRD_DB:humi:AVERAGE \
DEF:humimin=$RRD_DB:humi:MIN \
DEF:humimax=$RRD_DB:humi:MAX \
AREA:humi#acc6fb \
LINE1:humi#4f5a72:"<big>Luftfeuchtigkeit (DHT22)</big> " \
LINE1:humi#4f5a72:"<big>humidity (DHT22)</big> " \
VDEF:humi_min=humi,MINIMUM \
'GPRINT:humi_min:<b>Minimum</b>\: %5.0lf %% ' \
'GPRINT:humi_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:humi_average=humi,AVERAGE \
'GPRINT:humi_average:<b>Durchschnitt</b>\: %5.0lf %% ' \
'GPRINT:humi_average:<b>average</b>\: %5.0lf %% ' \
VDEF:humi_max=humi,MAXIMUM \
'GPRINT:humi_max:<b>Maximum</b>\: %5.0lf %% ' \
'GPRINT:humi_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-light-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Helligkeit (%)' --lower-limit 0 --upper-limit 110 \
--start -1d --pango-markup --vertical-label 'light level (%)' --lower-limit 0 --upper-limit 110 \
DEF:light=$RRD_DB:light:AVERAGE \
DEF:lightmax=$RRD_DB:light:MAX \
CDEF:scaled_light=light,10250000,/ \
CDEF:light_inverse=1,scaled_light,- \
CDEF:light_percent=light_inverse,100,* \
AREA:light_percent#acc6fb \
LINE1:light_percent#4f5a72:"<big>Helligkeit (LDR)</big> " \
LINE1:light_percent#4f5a72:"<big>light level (LDR)</big> " \
VDEF:light_min=light_percent,MINIMUM \
'GPRINT:light_min:<b>Minimum</b>\: %5.0lf %% ' \
'GPRINT:light_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:light_average=light_percent,AVERAGE \
'GPRINT:light_average:<b>Durchschnitt</b>\: %5.0lf %% ' \
'GPRINT:light_average:<b>average</b>\: %5.0lf %% ' \
VDEF:light_max=light_percent,MAXIMUM \
'GPRINT:light_max:<b>Maximum</b>\: %5.0lf %% ' \
'GPRINT:light_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-no2-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Stickstoffdioxid' \
--start -1d --pango-markup --vertical-label 'nitrogen dioxide' \
DEF:no2=$RRD_DB:no2:AVERAGE \
DEF:no2min=$RRD_DB:no2:MIN \
DEF:no2max=$RRD_DB:no2:MAX \
AREA:no2#acc6fb \
LINE1:no2#4f5a72:"<big>Stickstoffdioxid (MiCS-2710)</big> " \
LINE1:no2#4f5a72:"<big>nitrogen dioxide (MiCS-2710)</big> " \
VDEF:no2_min=no2,MINIMUM \
'GPRINT:no2_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:no2_min:<b>minimum</b>\: %5.0lf ' \
VDEF:no2_average=no2,AVERAGE \
'GPRINT:no2_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:no2_average:<b>average</b>\: %5.0lf ' \
VDEF:no2_max=no2,MAXIMUM \
'GPRINT:no2_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:no2_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-co-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Kohlenstoffmonoxid' \
--start -1d --pango-markup --vertical-label 'carbon monoxide' \
DEF:co=$RRD_DB:co:AVERAGE \
DEF:comin=$RRD_DB:co:MIN \
DEF:comax=$RRD_DB:co:MAX \
AREA:co#acc6fb \
LINE1:co#4f5a72:"<big>Kohlenstoffmonoxid (MiCS-5525)</big> " \
LINE1:co#4f5a72:"<big>carbon monoxide (MiCS-5525)</big> " \
VDEF:co_min=co,MINIMUM \
'GPRINT:co_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:co_min:<b>minimum</b>\: %5.0lf ' \
VDEF:co_average=co,AVERAGE \
'GPRINT:co_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:co_average:<b>average</b>\: %5.0lf ' \
VDEF:co_max=co,MAXIMUM \
'GPRINT:co_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:co_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-vol-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Lautstärke' \
--start -1d --pango-markup --vertical-label 'volume' \
DEF:vol=$RRD_DB:vol:AVERAGE \
DEF:volmin=$RRD_DB:vol:MIN \
DEF:volmax=$RRD_DB:vol:MAX \
AREA:vol#acc6fb \
LINE1:vol#4f5a72:"<big>Lautstärke (ABM_713_RC)</big> " \
LINE1:vol#4f5a72:"<big>volume (ABM_713_RC)</big> " \
VDEF:vol_min=vol,MINIMUM \
'GPRINT:vol_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:vol_min:<b>minimum</b>\: %5.0lf ' \
VDEF:vol_average=vol,AVERAGE \
'GPRINT:vol_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:vol_average:<b>average</b>\: %5.0lf ' \
VDEF:vol_max=vol,MAXIMUM \
'GPRINT:vol_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:vol_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-smoke-day.png -a PNG --width=800 --height=300 \
--start -1d --pango-markup --vertical-label 'Luftverschmutzung' \
--start -1d --pango-markup --vertical-label 'smoke' \
DEF:smoke=$RRD_DB:smoke:AVERAGE \
AREA:smoke#acc6fb \
LINE1:smoke#4f5a72:"<big>Luftverschmutzung (TGS2600)</big> " \
LINE1:smoke#4f5a72:"<big>smoke (TGS2600)</big> " \
VDEF:smoke_min=smoke,MINIMUM \
'GPRINT:smoke_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:smoke_min:<b>minimum</b>\: %5.0lf ' \
VDEF:smoke_average=smoke,AVERAGE \
'GPRINT:smoke_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:smoke_average:<b>average</b>\: %5.0lf ' \
VDEF:smoke_max=smoke,MAXIMUM \
'GPRINT:smoke_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:smoke_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
......@@ -7,134 +7,134 @@ GRAPH_PATH="../graph"
$RRDTOOL graph $GRAPH_PATH/airpi-tempbmp-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Temperatur (°C)' \
--start -1h --pango-markup --vertical-label 'temperature (°C)' \
DEF:temp=$RRD_DB:tempbmp:AVERAGE \
DEF:tempmin=$RRD_DB:tempbmp:MIN \
DEF:tempmax=$RRD_DB:tempbmp:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (BMP085)</big> " \
LINE1:temp#4f5a72:"<big>temperature (BMP085)</big> " \
VDEF:temp_min=tempmin,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=tempmax,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-tempdht-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Temperatur (°C)' \
--start -1h --pango-markup --vertical-label 'temperature (°C)' \
DEF:temp=$RRD_DB:tempdht:AVERAGE \
DEF:tempmin=$RRD_DB:tempdht:MIN \
DEF:tempmax=$RRD_DB:tempdht:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (DHT22)</big> " \
LINE1:temp#4f5a72:"<big>temperature (DHT22)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-press-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Druck (hPa)' \
--start -1h --pango-markup --vertical-label 'pressure (hPa)' \
DEF:press=$RRD_DB:press:AVERAGE \
DEF:pressmin=$RRD_DB:press:MIN \
DEF:pressmax=$RRD_DB:press:MAX \
AREA:press#acc6fb \
LINE1:press#4f5a72:"<big>Druck (BMP085)</big> " \
LINE1:press#4f5a72:"<big>pressure (BMP085)</big> " \
VDEF:press_min=press,MINIMUM \
'GPRINT:press_min:<b>Minimum</b>\: %5.0lf hPa ' \
'GPRINT:press_min:<b>minimum</b>\: %5.0lf hPa ' \
VDEF:press_average=press,AVERAGE \
'GPRINT:press_average:<b>Durchschnitt</b>\: %5.0lf hPa ' \
'GPRINT:press_average:<b>average</b>\: %5.0lf hPa ' \
VDEF:press_max=press,MAXIMUM \
'GPRINT:press_max:<b>Maximum</b>\: %5.0lf hPa ' \
'GPRINT:press_max:<b>maximum</b>\: %5.0lf hPa ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-humi-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Luftfeuchtigkeit (%)' \
--start -1h --pango-markup --vertical-label 'humidity (%)' \
DEF:humi=$RRD_DB:humi:AVERAGE \
DEF:humimin=$RRD_DB:humi:MIN \
DEF:humimax=$RRD_DB:humi:MAX \
AREA:humi#acc6fb \
LINE1:humi#4f5a72:"<big>Luftfeuchtigkeit (DHT22)</big> " \
LINE1:humi#4f5a72:"<big>humidity (DHT22)</big> " \
VDEF:humi_min=humi,MINIMUM \
'GPRINT:humi_min:<b>Minimum</b>\: %5.0lf %% ' \
'GPRINT:humi_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:humi_average=humi,AVERAGE \
'GPRINT:humi_average:<b>Durchschnitt</b>\: %5.0lf %% ' \
'GPRINT:humi_average:<b>average</b>\: %5.0lf %% ' \
VDEF:humi_max=humi,MAXIMUM \
'GPRINT:humi_max:<b>Maximum</b>\: %5.0lf %% ' \
'GPRINT:humi_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-light-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Helligkeit' \
--start -1h --pango-markup --vertical-label 'light level' \
DEF:light=$RRD_DB:light:AVERAGE \
DEF:lightmin=$RRD_DB:light:MIN \
DEF:lightmax=$RRD_DB:light:MAX \
AREA:light#acc6fb \
LINE1:light#4f5a72:"<big>Helligkeit (LDR)</big> " \
LINE1:light#4f5a72:"<big>light level (LDR)</big> " \
VDEF:light_min=light,MINIMUM \
'GPRINT:light_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:light_min:<b>minimum</b>\: %5.0lf ' \
VDEF:light_average=light,AVERAGE \
'GPRINT:light_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:light_average:<b>average</b>\: %5.0lf ' \
VDEF:light_max=light,MAXIMUM \
'GPRINT:light_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:light_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-no2-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Stickstoffdioxid' \
--start -1h --pango-markup --vertical-label 'nitrogen dioxide' \
DEF:no2=$RRD_DB:no2:AVERAGE \
DEF:no2min=$RRD_DB:no2:MIN \
DEF:no2max=$RRD_DB:no2:MAX \
AREA:no2#acc6fb \
LINE1:no2#4f5a72:"<big>Stickstoffdioxid (MiCS-2710)</big> " \
LINE1:no2#4f5a72:"<big>nitrogen dioxide (MiCS-2710)</big> " \
VDEF:no2_min=no2,MINIMUM \
'GPRINT:no2_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:no2_min:<b>minimum</b>\: %5.0lf ' \
VDEF:no2_average=no2,AVERAGE \
'GPRINT:no2_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:no2_average:<b>average</b>\: %5.0lf ' \
VDEF:no2_max=no2,MAXIMUM \
'GPRINT:no2_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:no2_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-co-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Kohlenstoffmonoxid' \
--start -1h --pango-markup --vertical-label 'carbon monoxide' \
DEF:co=$RRD_DB:co:AVERAGE \
DEF:comin=$RRD_DB:co:MIN \
DEF:comax=$RRD_DB:co:MAX \
AREA:co#acc6fb \
LINE1:co#4f5a72:"<big>Kohlenstoffmonoxid (MiCS-5525)</big> " \
LINE1:co#4f5a72:"<big>carbon monoxide (MiCS-5525)</big> " \
VDEF:co_min=co,MINIMUM \
'GPRINT:co_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:co_min:<b>minimum</b>\: %5.0lf ' \
VDEF:co_average=co,AVERAGE \
'GPRINT:co_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:co_average:<b>average</b>\: %5.0lf ' \
VDEF:co_max=co,MAXIMUM \
'GPRINT:co_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:co_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-vol-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Lautstärke' \
--start -1h --pango-markup --vertical-label 'volume' \
DEF:vol=$RRD_DB:vol:AVERAGE \
DEF:volmin=$RRD_DB:vol:MIN \
DEF:volmax=$RRD_DB:vol:MAX \
AREA:vol#acc6fb \
LINE1:vol#4f5a72:"<big>Lautstärke (ABM_713_RC)</big> " \
LINE1:vol#4f5a72:"<big>volume (ABM_713_RC)</big> " \
VDEF:vol_min=vol,MINIMUM \
'GPRINT:vol_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:vol_min:<b>minimum</b>\: %5.0lf ' \
VDEF:vol_average=vol,AVERAGE \
'GPRINT:vol_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:vol_average:<b>average</b>\: %5.0lf ' \
VDEF:vol_max=vol,MAXIMUM \
'GPRINT:vol_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:vol_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-smoke-hour.png -a PNG --width=800 --height=300 \
--start -1h --pango-markup --vertical-label 'Luftverschmutzung' \
--start -1h --pango-markup --vertical-label 'smoke' \
DEF:smoke=$RRD_DB:smoke:AVERAGE \
AREA:smoke#acc6fb \
LINE1:smoke#4f5a72:"<big>Luftverschmutzung (TGS2600)</big> " \
LINE1:smoke#4f5a72:"<big>smoke (TGS2600)</big> " \
VDEF:smoke_min=smoke,MINIMUM \
'GPRINT:smoke_min:<b>Minimum</b>\: %5.0lf ' \
'GPRINT:smoke_min:<b>minimum</b>\: %5.0lf ' \
VDEF:smoke_average=smoke,AVERAGE \
'GPRINT:smoke_average:<b>Durchschnitt</b>\: %5.0lf ' \
'GPRINT:smoke_average:<b>average</b>\: %5.0lf ' \
VDEF:smoke_max=smoke,MAXIMUM \
'GPRINT:smoke_max:<b>Maximum</b>\: %5.0lf ' \
'GPRINT:smoke_max:<b>maximum</b>\: %5.0lf ' \
> /dev/null
......@@ -7,136 +7,136 @@ GRAPH_PATH="../graph"
$RRDTOOL graph $GRAPH_PATH/airpi-tempbmp-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Temperatur (°C)' --upper-limit 40 --lower-limit 0 \
--start -1m --pango-markup --vertical-label 'temperature (°C)' --upper-limit 40 --lower-limit 0 \
DEF:temp=$RRD_DB:tempbmp:AVERAGE \
DEF:tempmin=$RRD_DB:tempbmp:MIN \
DEF:tempmax=$RRD_DB:tempbmp:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (BMP085)</big> " \
LINE1:temp#4f5a72:"<big>temperature (BMP085)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-tempdht-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Temperatur (°C)' --upper-limit 40 --lower-limit 0 \
--start -1m --pango-markup --vertical-label 'temperature (°C)' --upper-limit 40 --lower-limit 0 \
DEF:temp=$RRD_DB:tempdht:AVERAGE \
DEF:tempmin=$RRD_DB:tempdht:MIN \
DEF:tempmax=$RRD_DB:tempdht:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (DHT22)</big> " \
LINE1:temp#4f5a72:"<big>temperature (DHT22)</big> " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C ' \
'GPRINT:temp_min:<b>minimum</b>\: %5.0lf °C ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C ' \
'GPRINT:temp_average:<b>average</b>\: %5.0lf °C ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C ' \
'GPRINT:temp_max:<b>maximum</b>\: %5.0lf °C ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-press-month.png -a PNG --width=800 --height=300 --lower-limit 940 \
--start -1m --pango-markup --vertical-label 'Druck (hPa)' --upper-limit 1060 --rigid --units-exponent 0 \
--start -1m --pango-markup --vertical-label 'pressure (hPa)' --upper-limit 1060 --rigid --units-exponent 0 \
DEF:press=$RRD_DB:press:AVERAGE \
DEF:pressmin=$RRD_DB:press:MIN \
DEF:pressmax=$RRD_DB:press:MAX \
AREA:press#acc6fb \
LINE1:press#4f5a72:"<big>Druck (BMP085)</big> " \
LINE1:press#4f5a72:"<big>pressure (BMP085)</big> " \
VDEF:press_min=press,MINIMUM \
'GPRINT:press_min:<b>Minimum</b>\: %5.0lf hPa ' \
'GPRINT:press_min:<b>minimum</b>\: %5.0lf hPa ' \
VDEF:press_average=press,AVERAGE \
'GPRINT:press_average:<b>Durchschnitt</b>\: %5.0lf hPa ' \
'GPRINT:press_average:<b>average</b>\: %5.0lf hPa ' \
VDEF:press_max=press,MAXIMUM \
'GPRINT:press_max:<b>Maximum</b>\: %5.0lf hPa ' \
'GPRINT:press_max:<b>maximum</b>\: %5.0lf hPa ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-humi-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Luftfeuchtigkeit (%)' --lower-limit 0 --upper-limit 100 \
--start -1m --pango-markup --vertical-label 'humidity (%)' --lower-limit 0 --upper-limit 100 \
DEF:humi=$RRD_DB:humi:AVERAGE \
DEF:humimin=$RRD_DB:humi:MIN \
DEF:humimax=$RRD_DB:humi:MAX \
AREA:humi#acc6fb \
LINE1:humi#4f5a72:"<big>Luftfeuchtigkeit (DHT22)</big> " \
LINE1:humi#4f5a72:"<big>humidity (DHT22)</big> " \
VDEF:humi_min=humi,MINIMUM \
'GPRINT:humi_min:<b>Minimum</b>\: %5.0lf %% ' \
'GPRINT:humi_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:humi_average=humi,AVERAGE \
'GPRINT:humi_average:<b>Durchschnitt</b>\: %5.0lf %% ' \
'GPRINT:humi_average:<b>average</b>\: %5.0lf %% ' \
VDEF:humi_max=humi,MAXIMUM \
'GPRINT:humi_max:<b>Maximum</b>\: %5.0lf %% ' \
'GPRINT:humi_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-light-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Helligkeit (%)' --lower-limit 0 --upper-limit 110 \
--start -1m --pango-markup --vertical-label 'light level (%)' --lower-limit 0 --upper-limit 110 \
DEF:light=$RRD_DB:light:AVERAGE \
DEF:lightmax=$RRD_DB:light:MAX \
CDEF:scaled_light=light,10250000,/ \
CDEF:light_inverse=1,scaled_light,- \
CDEF:light_percent=light_inverse,100,* \
AREA:light_percent#acc6fb \
LINE1:light_percent#4f5a72:"<big>Helligkeit (LDR)</big> " \
LINE1:light_percent#4f5a72:"<big>light level (LDR)</big> " \
VDEF:light_min=light_percent,MINIMUM \
'GPRINT:light_min:<b>Minimum</b>\: %5.0lf %% ' \
'GPRINT:light_min:<b>minimum</b>\: %5.0lf %% ' \
VDEF:light_average=light_percent,AVERAGE \
'GPRINT:light_average:<b>Durchschnitt</b>\: %5.0lf %% ' \
'GPRINT:light_average:<b>average</b>\: %5.0lf %% ' \
VDEF:light_max=light_percent,MAXIMUM \
'GPRINT:light_max:<b>Maximum</b>\: %5.0lf %% ' \
'GPRINT:light_max:<b>maximum</b>\: %5.0lf %% ' \
> /dev/null
$RRDTOOL graph $GRAPH_PATH/airpi-no2-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Stickstoffdioxid' \
--start -1m --pango-markup --vertical-label 'nitrogen dioxide' \
DEF:no2=$RRD_DB:no2:AVERAGE \
DEF:no2min=$RRD_DB:no2:MIN \
DEF:no2max=$RRD_DB:no2:MAX \
AREA:no2#acc6fb \