diff --git a/fhem/webfrontend/pgm3/config.php b/fhem/webfrontend/pgm3/config.php index 3b6253c0b..babb0f983 100644 --- a/fhem/webfrontend/pgm3/config.php +++ b/fhem/webfrontend/pgm3/config.php @@ -5,11 +5,12 @@ ###### required settings - $fhz1000="localhost"; # on which machine is fhz1000 runnning?? - # if it is not localhost then the fhz1000.cfg must - # run global: "port global" - $fhz1000port="7072"; # port of fhz1000.pl - $logpath="/var/tmp"; # where are your logs? + $fhz1000="localhost"; #only php5 ! On which machine is fhz1000 runnning?? + # if it is not localhost then the fhz1000.cfg must + # run global: "port global" + $fhz1000port="7072"; # port of fhz1000.pl + $logpath="/var/tmp"; # where are your logs? + $fhz1000_pl="/home/FHZ/fhz1000/fhz1000.pl"; #only required if you are using PHP4 ################################################################################## ###### nice to have @@ -34,27 +35,17 @@ -## HMS-Devices - $imgmaxxhms=620; #Size of the pictures. Default: 620 for faster systems else 380 - $imgmaxyhms=52; - $logrotateHMSlines=1200; # automatic Logrotate; $logrotate must be 'yes'. - # Default:1200 - # read docs/logrotate if you want adjust it manually! - # otherwise the system will slow down - # pgm3 (user www-data) needs the rights to write the logs - # from fhz1000.pl (user = ???) -## FHT-Devices - $imgmaxxfht=450; #Size of the pictures Default: 450 for faster systems else 380 - $imgmaxyfht=52; - $logrotateFHTlines=4300; # automatic Logrotate; $logrotate must be 'yes'. - # Default:4300 - # read docs/logrotate if you want adjust it manually! - # otherwise the system will slow down - # pgm3 (user www-data) needs the rights to write the logs - # from fhz1000.pl (user = ???) +############################################################################################## +## FHZ-DEVICES + $show_general=1; #field to type FHZ1000-orders 0/1 Default:1 + $show_fs20pulldown=1; #Pull-Down for the FS20 Devices 0/1 Default:1 + $show_fhtpulldown=1; #Pull-Down for the FHT-Devices 0/1 Default:1 + + +############################################################################################## ## FS20-Device, adjust it if you have e.g. long titles $imgmaxxfs20=85; #Size of the pictures, default=85 $imgmaxyfs20=85; # default=85 @@ -66,7 +57,7 @@ $txtroom=""; # default=""; example: $txtroom="room: "; # room hidden will not be shown - +############################################################################################## ## ROOMS adjust it if you have e.g. long titles $showroombuttons=1; #default 1 Values 0/1 $imgmaxxroom=$imgmaxxfs20; #Size of the pictures, default=$imgmaxxfs20 @@ -74,9 +65,32 @@ $roomfontsizetitel=10; # default=9 $roommaxiconperline=$fs20maxiconperline; # default=$fs20maxiconperline +############################################################################################## +## FHT-Devices + $imgmaxxfht=450; #Size of the pictures Default: 450 for faster systems else 380 + $imgmaxyfht=52; + $show_desiredtemp=1; # show the desired_temp as a graphic (0/1) + $logrotateFHTlines=4300; # automatic Logrotate; $logrotate must be 'yes'. + # Default:4300 + # read docs/logrotate if you want adjust it manually! + # otherwise the system will slow down + # pgm3 (user www-data) needs the rights to write the logs + # from fhz1000.pl (user = ???) +############################################################################################## +## HMS-Devices + $imgmaxxhms=620; #Size of the pictures. Default: 620 for faster systems else 380 + $imgmaxyhms=52; + $logrotateHMSlines=1200; # automatic Logrotate; $logrotate must be 'yes'. + # Default:1200 + # read docs/logrotate if you want adjust it manually! + # otherwise the system will slow down + # pgm3 (user www-data) needs the rights to write the logs + # from fhz1000.pl (user = ???) + +############################################################################################## ## KS300-Device $imgmaxxks=620; #Size of the pictures Default: 620 for faster systems else 380 @@ -91,21 +105,17 @@ # from fhz1000.pl (user = ???) -## FHZ-DEVICES - $show_general=1; #field to type FHZ1000-orders 0/1 Default:1 - $show_fs20pulldown=1; #Pull-Down for the FS20 Devices 0/1 Default:1 - $show_fhtpulldown=1; #Pull-Down for the FHT-Devices 0/1 Default:1 - +############################################################################################## ## misc $taillog=1; #make shure to have the correct rights. Values: 0/1 $taillogorder="/usr/bin/tail -20 $logpath/fhz1000.log"; -## show Information at startup. Activate it by deleting the '#' +## show Information at startup. $showLOGS='no'; #show the LOGS at startup. Default: no Values: yes/no $showAT='yes'; #show the AT_JOBS at startup. Default: yes Values: yes/no $showNOTI='no'; #show the NOTIFICATIONS at startup. Default: no Values: yes/no @@ -113,8 +123,8 @@ - $urlreload=60; # Automatic reloading page [sec]. Default fast: 60 slow:90 - $titel="PHP-Webmachine for fhz1000.pl :-)"; #feel free to create an own title + $urlreload=90; # Automatic reloading page [sec]. Default fast: 60 slow:90 + $titel="PHP-Webmachine for fhem :-)"; #feel free to create an own title $timeformat="Y-m-d H:i:s"; $bodybg="bgcolor='#F5F5F5'"; $bg1="bgcolor='#6E94B7'"; diff --git a/fhem/webfrontend/pgm3/include/fht.php b/fhem/webfrontend/pgm3/include/fht.php index 06f10a987..b085cef4d 100755 --- a/fhem/webfrontend/pgm3/include/fht.php +++ b/fhem/webfrontend/pgm3/include/fht.php @@ -29,9 +29,11 @@ setlocale (LC_ALL, 'de_DE.utf8'); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); + #$lightgray= ImageColorAllocate($im, 200, 198, 222); $red = ImageColorAllocate($im, 255, 0, 0); $green = ImageColorAllocate($im, 0, 255, 0); $yellow= ImageColorAllocate($im, 255, 255, 0); + $lightyellow= ImageColorAllocate($im, 255, 247,222 ); $orange= ImageColorAllocate($im, 255, 230, 25); @@ -44,6 +46,7 @@ setlocale (LC_ALL, 'de_DE.utf8'); $actuator=0; $actuator_date="unknown"; $counter=count($array); + $arraydesired=array(); #echo $counter; exit; @@ -65,10 +68,13 @@ setlocale (LC_ALL, 'de_DE.utf8'); $oldmin=$array[$x][14]; $oldhour=$array[$x][12]; array_push( $_SESSION["arraydata"],array($date,$type,$temp)); + array_push( $arraydesired,$desired_temp); + } } $resultreverse = array_reverse($_SESSION["arraydata"]); + $reversedesired = array_reverse($arraydesired); $xold=$imgmaxxfht; if ( $imgmaxxfht > count ($resultreverse) ) @@ -101,15 +107,21 @@ setlocale (LC_ALL, 'de_DE.utf8'); if ( ($parts[0] != $olddate) ) { $olddate=$parts[0]; + #ImageLine($im, $imgmaxxfht-$x, 0,$imgmaxxfht-$x , $imgmaxyfht, $bg1p); ImageLine($im, $imgmaxxfht-$x, 0,$imgmaxxfht-$x , $imgmaxyfht, $bg1p); }; $y = round($imgmaxyfht-(($resultreverse[$x][2]-$mintemp)*$fac)); + $y2 = round($imgmaxyfht-(($reversedesired[$x]-$mintemp)*$fac)); + #ImageLine($im, $imgmaxxfht-$x, $y2, $xold, $yold2, $bg1p); + if ($show_desiredtemp == 1) ImageLine($im, $imgmaxxfht-$x+1, $y2, $xold, $yold2, $lightyellow); ImageLine($im, $imgmaxxfht-$x, $y, $xold, $yold, $red); $xold=$imgmaxxfht-$x; $yold=$y; + $yold2=$y2; }; #print_r($resultreverse); + #print_r($reversedesired); #exit; ImageLine($im, $imgmaxxfht-$x, 0,$imgmaxxfht-$x , $imgmaxyfht, $yellow); ###ttf @@ -117,8 +129,8 @@ setlocale (LC_ALL, 'de_DE.utf8'); $fontsize=7; $txtcolor=$bg3p; ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); - #setlocale (LC_ALL, 'de_DE.UTF-8'); $text=$resultreverse[0][2]." °C"; + ImageTTFText ($im, 9, 0, 90, 35, $txtcolor, $fontttfb, $text); $text= $drawfht; diff --git a/fhem/webfrontend/pgm3/include/fhtpulldown.php b/fhem/webfrontend/pgm3/include/fhtpulldown.php index 65baa2e14..90ef0805c 100644 --- a/fhem/webfrontend/pgm3/include/fhtpulldown.php +++ b/fhem/webfrontend/pgm3/include/fhtpulldown.php @@ -7,7 +7,7 @@ "thu-to1","fri-from1","fri-to1","sat-from1","sat-to1","sun-from1","sun-to1", "mon-from2","mon-to2","tue-from2","tue-to2","wed-from2","wed-to2","thu-from2", "thu-to2","fri-from2","fri-to2","sat-from2","sat-to2","sun-from2","sun-to2", - "day-temp","night-temp","desired-temp","refeshvalues","windowopen-temp" + "day-temp","night-temp","desired-temp","refreshvalues","windowopen-temp" ); echo " diff --git a/fhem/webfrontend/pgm3/include/gnuplot.php b/fhem/webfrontend/pgm3/include/gnuplot.php index ade8d23a8..82095f482 100644 --- a/fhem/webfrontend/pgm3/include/gnuplot.php +++ b/fhem/webfrontend/pgm3/include/gnuplot.php @@ -55,7 +55,7 @@ EOD; Case FHT: ############################################ $gplotmain=" set ylabel 'Temperature (Celsius)' - set yrange [16:31] + set yrange [15:31] set grid ytics set y2label 'Actuator (%)' set y2range [0:70] diff --git a/fhem/webfrontend/pgm3/index.php b/fhem/webfrontend/pgm3/index.php index 8721f43f9..17849008c 100644 --- a/fhem/webfrontend/pgm3/index.php +++ b/fhem/webfrontend/pgm3/index.php @@ -39,7 +39,7 @@ include "config.php"; include "include/gnuplot.php"; -$pgm3version='0.7.0'; +$pgm3version='0.7.0b'; $Action = $_POST['Action']; @@ -156,7 +156,9 @@ switch ($Action): Case exec: if ($kioskmode=='off') { - $order=str_replace("FFF","+",$order); + $order=str_replace("\\","",$order); + $order=str_replace("@","+",$order); + # echo $order; exit; execFHZ($order,$fhz1000,$fhz1000port); } header("Location: $forwardurl&errormessage=$errormessage"); @@ -189,6 +191,17 @@ if ($taillog==1) exec($taillogorder,$tailoutput); function execFHZ($order,$machine,$port) { global $errormessage; + +$version = explode('.', phpversion()); + +if ( $version[0] == 4 ) +{ + include "config.php"; + $order="$fhz1000_pl $port '$order'"; #PHP4, only localhost + exec($order,$errormessage); +} +else +{ $fp = stream_socket_client("tcp://$machine:$port", $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)
\n"; @@ -197,14 +210,26 @@ $fp = stream_socket_client("tcp://$machine:$port", $errno, $errstr, 30); $errormessage= fgets($fp, 1024); fclose($fp); } +} return $errormessage; } ###### make an array from the xmllist - unset($output); - $stack = array(); - $output=array(); +unset($output); +$stack = array(); +$output=array(); + + +$version = explode('.', phpversion()); + +if ( $version[0] == 4 ) +{ + $xmllist="$fhz1000_pl $fhz1000port xmllist"; + exec($xmllist,$output); +} +else +{ $fp = stream_socket_client("tcp://$fhz1000:$fhz1000port", $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)
\n"; @@ -216,6 +241,7 @@ return $errormessage; } fclose($fp); } +} @@ -738,14 +764,8 @@ xml_parser_free($xml_parser); $command=$stack[0][children][$i][children][$j][attrs][command]; $next=$stack[0][children][$i][children][$j][attrs][next]; $order=$command; - $order=str_replace("+","\FFF",$order); #workaround - $order=str_replace("*","\*",$order); - $order=str_replace("$","\\$",$order); - $order=str_replace("(","\(",$order); - $order=str_replace(")","\)",$order); - $order=str_replace("{","\{",$order); - $order=str_replace("}","\}",$order); - $order='del at ^'.$order.'$'; + $order=str_replace("+","@",$order); + $order='del at '.$order; if ($next != '') {$nexttxt='('.$next .')';} else {$nexttxt='';}; echo " AT-Job: del$command $nexttxt"; }