value in diagram
authorBernhard Tittelbach <xro@realraum.at>
Sat, 24 Apr 2010 03:18:14 +0000 (03:18 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Sat, 24 Apr 2010 03:18:14 +0000 (03:18 +0000)
sensor_graph/sensor-light.cgi
sensor_graph/sensor-temp.cgi
sensor_graph/sensors.cgi
sensor_graph/switch.cgi [deleted file]

index bf3f019..7ea59ad 100755 (executable)
@@ -3,9 +3,15 @@
 <BODY>
 <RRD::GOODFOR 30>
 <RRD::GRAPH ../light0.png
-   --lazy --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
-   --title="Room Illumination"
-   DEF:cel=/home/sensorlight.rrd:light:LAST
-   LINE2:cel#00a000:"0 dark to 1023 bright">
+   --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+   --color="BACK#d0d0af" --color="CANVAS#ffffff" 
+   --color="SHADEA#dfdfdf" --color="SHADEB#525252" 
+   --color="AXIS#761407" --color="FONT#272727" --color="MGRID#b65447"
+   --color="ARROW#761407" --color="GRID#d0d0af"
+   --title="Room Illumination" --lazy
+   --start=now-36h --end=now --width=490
+   --slope-mode
+   DEF:cel=/home/sensorlight.rrd:light:LAST VDEF:lv=cel,LAST
+   LINE2:cel#04d532:"0 dark to 1023 bright," GPRINT:lv:"Current Value\: %1.0lf">
 </BODY>
 </HTML>
index ee2bf34..3f2a7fd 100755 (executable)
@@ -3,9 +3,15 @@
 <BODY>
 <RRD::GOODFOR 30>
 <RRD::GRAPH ../temp0.png
-   --lazy --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
-   --title="Temperatures"
-   DEF:cel=/home/sensortemp.rrd:temp:LAST
-   LINE2:cel#00a000:"D. Celsius">
+   --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+   --color="BACK#d0d0af" --color="CANVAS#ffffff" 
+   --color="SHADEA#dfdfdf" --color="SHADEB#525252" 
+   --color="AXIS#761407" --color="FONT#272727" --color="MGRID#b65447"
+   --color="ARROW#761407" --color="GRID#d0d0af"
+   --title="Room Temperature" --lazy
+   --start=now-36h --end=now --width=490
+   --slope-mode
+   DEF:cel=/home/sensortemp.rrd:temp:LAST VDEF:lv=cel,LAST
+   LINE2:cel#e21407:"°C (±0.5)," GPRINT:lv:"Current Temperature\: %1.2lf °C">
 </BODY>
 </HTML>
index 5b52164..9c85c93 100755 (executable)
@@ -6,23 +6,44 @@
 <RRD::GOODFOR 30>
 <P>
 <RRD::GRAPH ../light0.png
-   --lazy --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+   --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+   --color="BACK#d0d0af" --color="CANVAS#ffffff" 
+   --color="SHADEA#dfdfdf" --color="SHADEB#525252" 
+   --color="AXIS#761407" --color="FONT#272727" --color="MGRID#b65447"
+   --color="ARROW#761407" --color="GRID#d0d0af"
    --title="Room Illumination"
-   DEF:cel=/home/sensorlight.rrd:light:LAST
-   LINE2:cel#00a000:"0 dark to 1023 bright">
+   --start=now-36h --end=now --width=490
+   --slope-mode
+   DEF:cel=/home/sensorlight.rrd:light:LAST VDEF:lv=cel,LAST
+   LINE2:cel#04d532:"0 dark to 1023 bright," GPRINT:lv:"Current Value\: %1.0lf">
 </P>
+Current Light Value: <RRD::INCLUDE /home/sensorlight.txt>
 <P>
 <RRD::GRAPH ../temp0.png
-   --lazy --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
-   --title="Temperatures"
-   DEF:cel=/home/sensortemp.rrd:temp:LAST
-   LINE2:cel#00a000:"D. Celsius">
+   --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+   --color="BACK#d0d0af" --color="CANVAS#ffffff" 
+   --color="SHADEA#dfdfdf" --color="SHADEB#525252" 
+   --color="AXIS#761407" --color="FONT#272727" --color="MGRID#b65447"
+   --color="ARROW#761407" --color="GRID#d0d0af"
+   --title="Room Temperature"
+   --start=now-36h --end=now --width=490
+   --slope-mode
+   DEF:cel=/home/sensortemp.rrd:temp:LAST VDEF:lv=cel,LAST
+   LINE2:cel#e21407:"°C (±0.5)," GPRINT:lv:"Current Temperature\: %1.2lf °C">
 </P>
+Current Temperature: <RRD::INCLUDE /home/sensortemp.txt> °C
+<P>
 <RRD::GRAPH ../movement.png
-  --lazy --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
-  --title="Graph of Movement Sensor"
+  --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+  --color="BACK#d0d0af" --color="CANVAS#ffffff" 
+  --color="SHADEA#dfdfdf" --color="SHADEB#525252" 
+  --color="AXIS#761407" --color="FONT#272727" --color="MGRID#b65447"
+  --color="ARROW#761407" --color="GRID#d0d0af"
+  --title="Movement Sensor"
+  --start=now-36h --end=now --width=490
   DEF:cel=/home/sensormovement.rrd:movement:LAST
-  LINE2:cel#00a000:"1 Movement, 0 No Movement">
-</P>                                 
+  LINE2:cel#1407e2:"Movements / Minute">
+</P>
+Page generated: <RRD::TIME::NOW "%Y-%m-%d %H:%M">
 </BODY>
 </HTML>
diff --git a/sensor_graph/switch.cgi b/sensor_graph/switch.cgi
deleted file mode 100755 (executable)
index 765778c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-for QUERY in `echo $QUERY_STRING | tr '&' ' '`; do
-  for VALUE in `echo $QUERY | tr '=' ' '`; do
-    if [ "$VALUE" == "id" ]; then
-      ID='?'
-    elif [ "$ID" == "?" ]; then
-      ID=$VALUE
-    elif [ "$VALUE" == "power" ]; then
-      POWER='?'
-    elif [ "$POWER" == "?" ]; then
-      POWER=$VALUE
-    fi
-    i=$i+1
-  done
-done
-
-UNIXSOCK=/var/run/powersensordaemon/cmd.sock
-VALIDIDS="werkzeug stereo labor schreibtisch logo idee deckehinten deckevorne"
-
-if [ "$POWER" == "on" -o "$POWER" == "off" ]; then
-  for CHECKID in $VALIDIDS; do
-    if [ "$CHECKID" == "$ID" ]; then
-      echo "power $POWER $ID" | usocket $UNIXSOCK
-    fi
-   done
-fi
-
-DESC_werkzeug="Werkzeug LEDs"
-DESC_stereo="Stereo Anlage"
-DESC_labor="Labor Licht"
-DESC_schreibtisch="Schreibtisch Licht"
-DESC_logo="Logo"
-DESC_idee="Idee"
-DESC_deckehinten="Decke Hinten"
-DESC_deckevorne="Decke Vorne"
-
-echo "Content-type: text/html"
-echo ""
-echo "<html>"
-echo "<head>"
-echo "<title>Realraum rf433ctl</title>"
-echo "</head>"
-echo "<body>"
-echo "<h1>Realraum rf433ctl</h1>"
-echo "<table cellspacing='0'>"
-for DISPID in $VALIDIDS; do
-  NAME="$(eval echo \$DESC_$DISPID)"
-  [ -z "$NAME" ] && NAME=$DISPID
-  echo "<form action=\"/cgi-bin/switch.cgi\">"
-  echo "<input type=\"hidden\" name=\"id\" value=\"$DISPID\" />"
-#  echo " <tr><td>$NAME</td><td><a href=\"switch.cgi?id=$DISPID&power=on\"><button value=\"ON\" /></a></td><td><a href=\"switch.cgi?id=$DISPID&power=off\"><button value=\"OFF\" /></a></td></tr>"
-  echo "<tr><td style=\"font-size:11pt; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black;\">$NAME</td></tr><tr><td align='right' style=\"border-bottom:1px solid black; border-right:1px solid black; border-left:1px solid black;\">"
-  echo " <input type='submit' name='power' value='on' />"
-  echo " <input type='submit' name='power' value='off' />"
-  echo "</td></tr><tr><td style=\"height:1ex;\"></td></tr>"
-  echo "</form>"
-done
-echo "</table>"
-echo "</body>"
-echo "</html>"