write readme
[usb-wde1-tools.git] / munin / usb-wde1_
index bbfc5ee710a9e418033ed7069d209a08dd1851ac..a6f37419909ce5f3757f5fb6664debeece6c66c7 100755 (executable)
@@ -14,18 +14,24 @@ usb-wde1 -  Munin plugin to report usb-wde1 temperature and humidity data
 
 =head2 EXAMPLE CONFIGURATION
 
- [usb-wde1_temperature]
-  env.logfile /var/log/usb-wde1.log
+ [usb-wde1_*]
+  env.logfile /tmp/usb-wde1-last
   env.host_name House
-  env.sensors 0 1 2 3 4 7
+  env.sensors 0 1 7
   env.sensor0 Living room
   env.sensor1 Kitchen
+  env.sensor7 Outside
 
 =head1 MAGIC MARKERS
 
  #%# family=manual
  #%# capabilities=autoconf suggest
 
+=head1 AUTHOR and LICENSE
+
+License: http://www.gnu.org/licenses/agpl.html AGPL
+Author: Christian Weiske <cweiske@cweiske.de>
+
 =cut
 
 TYPE=`basename $0 | sed 's/^.*_//g'`
@@ -68,12 +74,14 @@ if [ "$1" = "config" ]; then
     fi
     if [ "$TYPE" = "temperature" ]; then
         echo 'graph_title Temperature'
-        echo 'graph_args --base 1000 --lower-limit -30 --upper-limit 60'
+        #echo 'graph_args --base 1000 --lower-limit -30 --upper-limit 60'
+        echo 'graph_args --base 1000'
         echo 'graph_vlabel Temperature'
         echo 'graph_info Shows the temperature of different thermometers'
     else
         echo 'graph_title Humidity'
-        echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
+        #echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
+        echo 'graph_args --base 1000'
         echo 'graph_vlabel Humidity'
         echo 'graph_info Shows the air humidity of different thermometers (in %)'
     fi
@@ -89,6 +97,13 @@ if [ "$1" = "config" ]; then
     exit 0
 fi
 
+#Beispielausgabe USB-WDE1:
+# $1;1;;13,8;22,7;22,6;17,8;22,2;21,2;22,9;;59;35;38;49;38;40;35;;;;;;;0
+# Doku des Formats in 92030_USB_WDE1_V1.0_UM.pdf bei elv.de verfügbar
+# Format ist "Logview openformat"
+# http://www.logview.info/cms/d_formatbeschreibung.phtml
+
+
 #split by semicolons
 OLDIFS="$IFS"
 IFS=";"
@@ -99,6 +114,7 @@ read -r startzeichen zustand zeitstempel\
     < "$logfile"
 IFS=$OLDIFS
 
+#FIXME: check startzeichen
 #FIXME: check timestamp
 
 if [ "$TYPE" = "temperature" ]; then
@@ -110,5 +126,6 @@ fi
 
 for i in $sensors; do
     eval "value=\$$varprefix$i"
+    value=`echo $value|sed s/,/./`
     echo "sensor$i.value $value"
 done