8 usb-wde1 - Munin plugin to report usb-wde1 temperature and humidity data
11 The plugin offers two modes: temperature and humidity graphing.
13 Symlink usb-wde1_ as "usb-wde1_temperature" and/or "usb-wde1_humidity".
15 =head2 EXAMPLE CONFIGURATION
18 env.logfile /tmp/usb-wde1-last
21 env.sensor0 Living room
28 #%# capabilities=autoconf suggest
30 =head1 AUTHOR and LICENSE
32 License: http://www.gnu.org/licenses/agpl.html AGPL
33 Author: Christian Weiske <cweiske@cweiske.de>
37 TYPE=`basename $0 | sed 's/^.*_//g'`
39 if [ "$1" = "autoconf" ]; then
40 if [ ! -r "$logfile" ]; then
41 echo "no (Logfile \"$logfile\" does not exist)"
42 elif [ "$TYPE" != "temperature" -a "$TYPE" != "humidity" ]; then
43 echo "no (Type \"$TYPE\" not supported, try \"./usb-wde1_ suggest\")"
49 elif [ "$1" = "suggest" ]; then
60 if [ "$sensors" = "" ]; then
61 sensors="0 1 2 3 4 5 6 7"
65 code="sensor$i=\${sensor$i:=Sensor $i}"
68 # FIXME: Warning/critical values
71 if [ "$1" = "config" ]; then
72 if [ "$host_name" != "" ]; then
73 echo "host_name $host_name"
75 if [ "$TYPE" = "temperature" ]; then
76 echo 'graph_title Temperature'
77 #echo 'graph_args --base 1000 --lower-limit -30 --upper-limit 60'
78 echo 'graph_args --base 1000'
79 echo 'graph_vlabel Temperature'
80 echo 'graph_info Shows the temperature of different thermometers'
82 echo 'graph_title Humidity'
83 #echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
84 echo 'graph_args --base 1000'
85 echo 'graph_vlabel Humidity'
86 echo 'graph_info Shows the air humidity of different thermometers (in %)'
89 echo 'graph_category sensors'
91 #FIXME: warning/critical values
93 eval "name=\$sensor$i"
94 echo "sensor$i.label $name"
100 #Beispielausgabe USB-WDE1:
101 # $1;1;;13,8;22,7;22,6;17,8;22,2;21,2;22,9;;59;35;38;49;38;40;35;;;;;;;0
102 # Doku des Formats in 92030_USB_WDE1_V1.0_UM.pdf bei elv.de verfügbar
103 # Format ist "Logview openformat"
104 # http://www.logview.info/cms/d_formatbeschreibung.phtml
110 read -r startzeichen zustand zeitstempel\
111 t0 t1 t2 t3 t4 t5 t6 t7\
112 h0 h1 h2 h3 h4 h5 h6 h7\
113 tc hc ws ns rain checksum\
117 #FIXME: check startzeichen
118 #FIXME: check timestamp
120 if [ "$TYPE" = "temperature" ]; then
127 for i in $sensors; do
128 eval "value=\$$varprefix$i"
129 value=`echo $value|sed s/,/./`
130 echo "sensor$i.value $value"