diff --git a/fhem/webfrontend/pgm3/CHANGED b/fhem/webfrontend/pgm3/CHANGED index b85390189..ece1be80d 100644 --- a/fhem/webfrontend/pgm3/CHANGED +++ b/fhem/webfrontend/pgm3/CHANGED @@ -105,7 +105,8 @@ Changelog -- Now you can use php4 OR php5 (php5 is recommended) -- Feature: php-Pictures of FHT now inclusive "desired-temp" -2007-03-19 (0.8.0) +==DATE== (0.8.0) -- Feature: Now you can adjust the range of the Gnuplot-pictures of FHT in the config.php -- Feature: WS300 is now supported --- Internal: Adjusted to the new internal structure of FHEM. YOU MUST HAVE FHEM >=3.4. +-- Internal: Adjusted to the new internal structure of FHEM. YOU MUST HAVE FHEM >=4.0 +-- Internal: random-device for one-time at-order (define at set ...) diff --git a/fhem/webfrontend/pgm3/include/functions.php b/fhem/webfrontend/pgm3/include/functions.php index 3dbb4290d..b6f1cd47c 100644 --- a/fhem/webfrontend/pgm3/include/functions.php +++ b/fhem/webfrontend/pgm3/include/functions.php @@ -38,4 +38,14 @@ function bft($windspeed) # wind speed in Beaufort } +function randdefine() +{ + $rand1 = rand(500,20000); + $rand2 = rand(500,20000); + $rq = md5($rand1.$rand2); + $randdefine=substr($rq,0,5); +return ($randdefine); +} + + ?> diff --git a/fhem/webfrontend/pgm3/include/gnuplot.php b/fhem/webfrontend/pgm3/include/gnuplot.php index 256e574a7..63b8fe72a 100644 --- a/fhem/webfrontend/pgm3/include/gnuplot.php +++ b/fhem/webfrontend/pgm3/include/gnuplot.php @@ -34,6 +34,24 @@ $xrange="set xrange ['$xrange2':'$xrange1'] switch ($gnutyp): + Case WS300_t1: ############################################ + $gplotmain=" + set ylabel 'Temperature (Celsius)' + set y2label 'Humidity (%)' + plot '$logfile' using 1:4 axes x1y1 title 'Temperature' with lines lw 3,\ + '$logfile' using 1:6 axes x1y2 title 'Rel. Humidity (%)' with lines + "; + break; + + Case WS300_t2: ############################################ +$gplotmain=<<\n"; } else { fwrite($fp, "xmllist\r\n;quit\r\n"); -# $fp=str_replace("DEVICES","LIST",$fp); while (!feof($fp)) { $outputvar = fgets($fp, 1024); array_push($output,$outputvar); @@ -640,34 +643,25 @@ xml_parser_free($xml_parser); ############################ elseif (substr($stack[0][children][$i][name],0,6)=='KS300_' or substr($stack[0][children][$i][name],0,6)=='WS300_') { - if ($stack[0][children][$i][name]=='WS300_LIST') $willi=1; $type=$stack[0][children][$i][name]; - echo ""; - echo "$type"; - for($j=0; $j < count($stack[0][children][$i][children]); $j++) - { - $KSdev=$stack[0][children][$i][children][$j][attrs][name]; - $room=''; - for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++) - { - $check=$stack[0][children][$i][children][$j][children][$k][attrs][name]; - if ($check='STATE') - { - $name=$stack[0][children][$i][children][$j][children][$k][attrs][name]; - $value=$stack[0][children][$i][children][$j][children][$k][attrs][value]; - $measured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; - if ($name=='temperature') {$KSmeasured=$measured;} - elseif ($name=='avg_month') {$KSavgmonth=$value;} - elseif ($name=='avg_day') {$KSavgday=$value;}; - } - if ($check='ATTR') - { - if (($stack[0][children][$i][children][$j][children][$k][attrs][key])=='room') - { - $room=$stack[0][children][$i][children][$j][children][$k][attrs][value]; - } - } - } + echo ""; + echo "$type"; + for($j=0; $j < count($stack[0][children][$i][children]); $j++) + { + $KSdev=$stack[0][children][$i][children][$j][attrs][name]; + $room=''; + for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++) + { + $check=$stack[0][children][$i][children][$j][children][$k][attrs][key]; + $check2=$stack[0][children][$i][children][$j][children][$k][attrs][name]; + if ($check=='room') $room=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + + if ($check2=='avg_month') $KSavgmonth=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + elseif ($check2=='avg_day') $KSavgday=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + elseif ($check2=='temperature') $KSmeasured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; + elseif ($check2=='willi') $willi=1; + } + if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room)) { $Xks=$imgmaxxks; @@ -681,37 +675,43 @@ xml_parser_free($xml_parser); ";} else - {echo " + {echo "
"; - if (! isset ($willi)) - { echo "
Temp./Hum.
-

Wind/Rain
-

"; - } - else echo ""; +

"; + if (! isset ($willi)) echo "Wind/Rain
"; else echo "Air Pressure/ Willi
"; + echo "

"; echo "
"; }; - echo " $KSdev "; - echo ""; - echo ""; - if (($showks == $KSdev) and $showgnuplot=='1') - { - if ($kstyp=="1")drawgnuplot($KSdev,"KS300_t1",$gnuplot,$pictype,$logpath,0,0); - else drawgnuplot($KSdev,"KS300_t2",$gnuplot,$pictype,$logpath,0,0); - $KSdev1=$KSdev.'1'; - echo "
- - "; - } - } - } - } + echo " $KSdev "; + echo ""; + echo ""; + if (! isset ($willi)) $drawtype="KS300"; else $drawtype="WS300"; + if (($showks == $KSdev) and $showgnuplot=='1') + { + if ($kstyp=="1") + { + drawgnuplot($KSdev,$drawtype."_t1",$gnuplot,$pictype,$logpath,0,0); + } + else + { + drawgnuplot($KSdev,$drawtype."_t2",$gnuplot,$pictype,$logpath,0,0); + } + $KSdev1=$KSdev.'1'; + echo "
+ + "; + } + + } + } + } + ############################ elseif ($stack[0][children][$i][name]=='LOGS'or $stack[0][children][$i][name]=='FileLog_LIST') { @@ -737,8 +737,6 @@ xml_parser_free($xml_parser); } } $name=$stack[0][children][$i][children][$j][attrs][name]; - #$definition=$stack[0][children][$i][children][$j][attrs][definition]; - #if ($definition != "") echo "Log: $value / $name "; @@ -787,9 +785,7 @@ xml_parser_free($xml_parser); if (isset ($showat)) for($j=0; $j < count($stack[0][children][$i][children]); $j++) { - #$command=$stack[0][children][$i][children][$j][attrs][command]; $command=$stack[0][children][$i][children][$j][attrs][name]; - #$next=$stack[0][children][$i][children][$j][attrs][next]; $next=$stack[0][children][$i][children][$j][attrs][state]; $order=$command; for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++) @@ -801,9 +797,7 @@ xml_parser_free($xml_parser); } } - #$order=str_replace("+","@",$order); $order='delete '.$order; - #if ($next != '') {$nexttxt='('.$next .')';} else {$nexttxt='';}; echo " AT-Job: del$value / $next / $command"; } }