From 84cb3fb4d0668f169279aed6de2df4c496efd32e Mon Sep 17 00:00:00 2001 From: martinhaas <> Date: Fri, 8 Jan 2010 18:55:40 +0000 Subject: [PATCH] Skinable, rooms for webcam and weather. stream_socket_client git-svn-id: https://svn.fhem.de/fhem/trunk@540 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 + fhem/HISTORY | 6 + fhem/webfrontend/pgm3/CHANGED | 3 + fhem/webfrontend/pgm3/HISTORY | 9 + fhem/webfrontend/pgm3/config.php | 111 +++++++---- fhem/webfrontend/pgm3/docs/README | 7 +- fhem/webfrontend/pgm3/include/fht.php | 9 +- fhem/webfrontend/pgm3/include/fs20.php | 4 +- fhem/webfrontend/pgm3/include/hms100.php | 4 +- fhem/webfrontend/pgm3/include/ks300.php | 7 +- fhem/webfrontend/pgm3/include/room.php | 4 +- fhem/webfrontend/pgm3/include/userdefs.php | 4 +- fhem/webfrontend/pgm3/include/weather.php | 2 + fhem/webfrontend/pgm3/index.php | 204 +++++++++++---------- 14 files changed, 233 insertions(+), 144 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index e375f5cfa..f2da737f8 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -564,3 +564,6 @@ - bugfix: 21_OWTEMP.pm interval fixed (M.Fischer) - bugfix: 21_OWTEMP.pm rewrite with errorcontrol and demo mode (M.Fischer) - feature: ignore attribute + - bugfix: [pgm3] table-format on Android-Browser optimized + - feature: [pgm3] Skinable - change the colors. Rooms possible for Webcam and Google-Weather + diff --git a/fhem/HISTORY b/fhem/HISTORY index 0991bf8cd..7cfd03378 100644 --- a/fhem/HISTORY +++ b/fhem/HISTORY @@ -465,3 +465,9 @@ work. There is also a second parameter $modules{modname}{ldata} which will be saved over a Reload, used by the FS20 for the follow feature. - ignore attribute added to ignore devices of the neighbour + +- Fri Jan 8 2010 (MartinH) + Interface to fhem changes to stream_socket_client. Table-format on Android-Browser + optimized. Optimized for smartphones. Rooms possible for Webcam and Google-Weather. + Output of html better formated and skinable -- change the colors. + diff --git a/fhem/webfrontend/pgm3/CHANGED b/fhem/webfrontend/pgm3/CHANGED index 0273b707b..7c83be65c 100644 --- a/fhem/webfrontend/pgm3/CHANGED +++ b/fhem/webfrontend/pgm3/CHANGED @@ -195,3 +195,6 @@ It is not necessary to tell fhem that there are other logs. 2009-12-19 -- Feature: CUL_WS added. Automatic support for S300TH (eg. S555TH). Changed: index.php, hms100.php, gnuplot.php +2010-01-08 + -- Feature, Bugs look at HISTORY + Changed: every php-File! diff --git a/fhem/webfrontend/pgm3/HISTORY b/fhem/webfrontend/pgm3/HISTORY index 648f0d54f..ad892dbcf 100644 --- a/fhem/webfrontend/pgm3/HISTORY +++ b/fhem/webfrontend/pgm3/HISTORY @@ -96,3 +96,12 @@ - Martin 2009-12-19 -- Feature: CUL_WS added. Automatic support for S300TH (eg. S555TH) + +- Martin 2010-01-08 + -- Feature: Interface to fhem changes to stream_socket_client + -- Bugfix: table-format on Android-Browser + -- Feature: Optimized for smartphones + -- Feature: Rooms possible for Webcam and Google-Weather + -- Misc: Output of html better formated + -- Feature. Skinable -- change the colors + diff --git a/fhem/webfrontend/pgm3/config.php b/fhem/webfrontend/pgm3/config.php index 6f5267563..7b9baab9e 100644 --- a/fhem/webfrontend/pgm3/config.php +++ b/fhem/webfrontend/pgm3/config.php @@ -3,14 +3,17 @@ ################################################################################## #### pgm3 -- a PHP-webfrontend for fhem.pl +### Look at http://www.fhemwiki.de for more information + ###### required settings - $fhem="localhost"; #only php5 is supported! On which machine is fhem runnning?? - # it must not be the same machine as fhem + $fhem="fhem"; #only php5 is supported! On which machine is fhem runnning?? + #$fhem="localhost"; #only php5 is supported! On which machine is fhem runnning?? + # it needs not to be on the same machine as fhem # if it is not localhost then the fhem.cfg must - # run global: "port global" + # run global: "attr global port global" $fhemport="7072"; # port of fhem.pl - $logpath="/var/tmp/"; # where are your logs? Use a writabel nfs-share if pgm3 and fhem are not on the same machine + $logpath="/mnt/fhz/"; # where are your logs? Use a writabel nfs-share if pgm3 and fhem are not on the same machine $AbsolutPath="/srv/www/htdocs/"; # where ist your pgm3? @@ -18,21 +21,12 @@ ###### nice to have -##### use netcat if your have problems with the stream_socket-tcp-connection -## package netcat must be installed - $usenetcat=0; -###### showgnuplot - # Gnuplot will automatically show the pictures. - # There is no reason any more to deactivate Gnuplot. Values: 0/1 - $showgnuplot=1; - $gnuplot='/usr/bin/gnuplot'; # location of gnuplot - $pictype='png'; ##### logrotate of hms, ks300, fht # this is only possible, if the webserver (e.g.wwwrun) has the rights ro write the - # files from fh1000.pl. If you want that then run fhem.pl as wwwrun too. + # files from fhem.pl. If you want that then run fhem.pl as wwwrun too. # if 'yes' then only the needed lines are in the logfiles, the rest will be deleted. $logrotate='yes'; # yes/no default='yes' @@ -42,9 +36,11 @@ ## Webcams - $showwebcam=0; #shows webcam-Urls or other pictures (0/1) + $showwebcam=1; #shows webcam-Urls or other pictures (0/1) $webcamwidth='150'; # the width of the shown picture $wgetpath="/usr/bin/wget"; # you need the package wget for http, ftp... + $webcamroom='donthide'; # existing room. Otherwise it will either + # be in ALL or wiht 'donthide' not hided $webcam[0]='http://webcam/IMAGE.JPG'; $webcam[1]='http://webcam2/IMAGE.JPG'; #$webcam[1]='http://www.bostream.nu/hoganas/OutsideTempHistory.gif'; @@ -57,10 +53,12 @@ # Weather # Google-Api. It requires an Internet Connection $enableweather=1; # show the google-weather? - $weathercity='Giessen'; + $weathercity='Linden'; $weathercountry='Germany'; $weatherlang='de'; #$weatherlang='en'; + $weatherroom='donthide'; # existing room. Otherwise it will either + # be in ALL or with 'donthide' not hided ############################################################################################## @@ -71,7 +69,9 @@ $show_logpulldown=1; #Pull-Down for Log-files and FS20 (grep fhem.log) $logsort='| sort -r'; #sort the Log-Output how you want; - +############################################################################################## +# ATTENTION: the changes of sizes only affects after the next build of pictures! +# or delete the old pictures: rm /tmp/* ############################################################################################## ## FS20-Device, adjust it if you have e.g. long titles $imgmaxxfs20=85; #Size of the pictures, default=85 @@ -170,7 +170,7 @@ # Do you want user defined graphics? 1/0 Default: 0 -$UserDefs=0; +$UserDefs=1; ##################### ## Userdef: 0 @@ -316,14 +316,22 @@ $userdef[$sortnumber]['logrotatelines']=30; ######################## +###### showgnuplot + # Gnuplot will automatically show the pictures. + # There is no reason any more to deactivate Gnuplot. Values: 0/1 + $showgnuplot=1; + $gnuplot='/usr/bin/gnuplot'; # location of gnuplot + $pictype='png'; + + ############################################################################################## ## misc $taillog=1; #make shure to have the correct rights. Values: 0/1 $tailcount=30; #make shure to have the correct rights. Values: 0/1 $tailpath="/usr/bin/tail"; - $taillogorder=$tailpath." -$tailcount $logpath/fhem.log "; - #$taillogorder=$tailpath." -$tailcount $logpath/fhem-" . date("Y") . "-" . date("m") . ".log "; #if you have e.g. fhem-2009-02.log + #$taillogorder=$tailpath." -$tailcount $logpath/fhem.log "; + $taillogorder=$tailpath." -$tailcount $logpath/fhem-" . date("Y") . "-" . date("m") . ".log "; #if you have e.g. fhem-2009-02.log @@ -338,23 +346,57 @@ $userdef[$sortnumber]['logrotatelines']=30; $RSStitel='FHEM :-)'; - - $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"; $winsize=800; # width of the pgm3 - $bodybg="bgcolor='#F5F5F5'"; - $bg1="bgcolor='#6E94B7'"; - $bg2="bgcolor='#AFC6DB'"; - $bg3="bgcolor='#F8F8F8'"; - $bg4="bgcolor='#6394BD'"; - $fontcolor1="color='#FFFFFF'"; - - $fontcolor3="color='143554'"; - $fontcol_grap_R=20; - $fontcol_grap_G=53; - $fontcol_grap_B=84; + + +##### use netcat if your have problems with the stream_socket-tcp-connection +## package netcat must be installed + $usenetcat=0; + + +########################## +##### SKINS - change your colors +# Look at http://www.farb-tabelle.de/de/farbtabelle.htm for colors +## DEFAULT + # $bodybg="bgcolor='#F5F5F5'"; + # $bg1="bgcolor='#6E7B8B'"; # e.g. Header + # $bg2="bgcolor='#AFC6DB'"; # e.g. behind the buttons + # $bg4="bgcolor='#6394BD'"; # border around all + # $bg5="bgcolor='#FFFFFF'"; # between the tables + # #$fontcolor1="color='#FFFFFF'"; + # $fontcolor1="color='#FFFFFF'"; + # $fontcolor3="color='#143554'"; +# # The Button needs decimal Code Instead Hex. +# # Use the column left from the HEX. +# # You must delete the old graphics after the change. "rm /tmp/*" +# $buttonBg_R='175';$buttonBg_G='198';$buttonBg_B='219'; +########################## +##ORANGE + $bodybg="bgcolor='#FFDAB9'"; + $bg1="bgcolor='#FF8C00'"; + $bg2="bgcolor='#FFA500'"; + $bg4="bgcolor='#6394BD'"; + $bg5="bgcolor='#FFFFFF'"; + $fontcolor1="color='#000000'"; + $fontcolor3="color='#000000'"; + # The Button needs decimal Code Instead Hex. + # Use the column left from the HEX on + # http://www.pagentest.de/web_farben/web_farben.html. + # You must delete the old graphics after the change. "rm /tmp/*" + $buttonBg_R='255';$buttonBg_G='165';$buttonBg_B='0'; + #Dec-Code from $bg1: + $bg1_R='255';$bg1_G='140';$bg1_B='0'; + + + + +########################## + $fontcol_grap_R=20; + $fontcol_grap_G=53; + $fontcol_grap_B=84; $fontttf="Vera"; $fontttfb="VeraBd"; ##copyright of the fonts: docs/copyright_font ## if there is now graphic try the following: @@ -364,6 +406,9 @@ $userdef[$sortnumber]['logrotatelines']=30; # $fontttf="/srv/www/htdocs/fhz/include/Vera.ttf"; # $fontttfb="/srv/www/htdocs/fhz/include/VeraBd.ttf"; + + + ############################### end of settings putenv('GDFONTPATH=' . realpath('.')); diff --git a/fhem/webfrontend/pgm3/docs/README b/fhem/webfrontend/pgm3/docs/README index c7e47f067..be3bb3a53 100644 --- a/fhem/webfrontend/pgm3/docs/README +++ b/fhem/webfrontend/pgm3/docs/README @@ -4,8 +4,13 @@ Make something like "chown -R wwwrun.www tmp" Hint: you need the package php-gd to see the graphics -All the other Documentation of pgm3 is now only online +Look at the wiki on http://www.fhemwiki.de. In the future there will th most of Documentation + +All the other Documentation of pgm3 is there: http://www.martin-haas.de/fhz Enjoy it :-) + +Martin Haas +fhz@martin-haas.de diff --git a/fhem/webfrontend/pgm3/include/fht.php b/fhem/webfrontend/pgm3/include/fht.php index 7ee13151a..ffa15a585 100755 --- a/fhem/webfrontend/pgm3/include/fht.php +++ b/fhem/webfrontend/pgm3/include/fht.php @@ -76,7 +76,10 @@ setlocale (LC_ALL, 'de_DE.utf8'); if ($type=="desired-temp:") {$desired_temp=$temp;$desired_date=$date;} if ($type=="actuator:") + { + if (trim($temp) != 'lime-protection') {$actuator=rtrim($temp);$actuator_date=$date;} + } if ((($array[$x][14] != $oldmin) or ($array[$x][12] != $oldhour)) and ($type=="measured-temp:")) { $oldmin=$array[$x][14]; @@ -94,8 +97,8 @@ setlocale (LC_ALL, 'de_DE.utf8'); $im = ImageCreateTrueColor($imgmaxxfht,$imgmaxyfht); $black = ImageColorAllocate($im, 0, 0, 0); - $bg1p = ImageColorAllocate($im, 110,148,183); - $bg2p = ImageColorAllocate($im, 175,198,219); + $bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B); + $bg2p = ImageColorAllocate($im, $buttonBg_R,$buttonBg_G,$buttonBg_B); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); @@ -200,7 +203,7 @@ setlocale (LC_ALL, 'de_DE.utf8'); - if ($actuator=="lime-protection") $actuator="0%"; + if ($actuator=="lime-protection") $actuator="?"; $text="Actuator: $actuator"; ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-230-$XcorrectDate, 33, $txtcolor, $fontttf, $text); diff --git a/fhem/webfrontend/pgm3/include/fs20.php b/fhem/webfrontend/pgm3/include/fs20.php index 2fa742a4b..f23893950 100755 --- a/fhem/webfrontend/pgm3/include/fs20.php +++ b/fhem/webfrontend/pgm3/include/fs20.php @@ -42,8 +42,8 @@ include "../config.php"; $im = ImageCreateTrueColor($imgmaxxfs20,$imgmaxyfs20); $black = ImageColorAllocate($im, 0, 0, 0); - $bg1p = ImageColorAllocate($im, 110,148,183); - $bg2p = ImageColorAllocate($im, 175,198,219); + $bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B); + $bg2p = ImageColorAllocate($im, $buttonBg_R,$buttonBg_G,$buttonBg_B); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); diff --git a/fhem/webfrontend/pgm3/include/hms100.php b/fhem/webfrontend/pgm3/include/hms100.php index 79d8ea2b4..5432f7e8d 100755 --- a/fhem/webfrontend/pgm3/include/hms100.php +++ b/fhem/webfrontend/pgm3/include/hms100.php @@ -56,8 +56,8 @@ $supported_HMS= array('HMS100T','HMS100TF','HMS100WD','HMS100MG','HMS100TFK','HM $im = ImageCreateTrueColor($imgmaxxhms,$imgmaxyhms); $black = ImageColorAllocate($im, 0, 0, 0); - $bg1p = ImageColorAllocate($im, 110,148,183); - $bg2p = ImageColorAllocate($im, 175,198,219); + $bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B); + $bg2p = ImageColorAllocate($im, $buttonBg_R,$buttonBg_G,$buttonBg_B); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); diff --git a/fhem/webfrontend/pgm3/include/ks300.php b/fhem/webfrontend/pgm3/include/ks300.php index 93a03435e..7a648b2cf 100755 --- a/fhem/webfrontend/pgm3/include/ks300.php +++ b/fhem/webfrontend/pgm3/include/ks300.php @@ -47,8 +47,8 @@ $avgmonth=$_GET['avgmonth']; $im = ImageCreateTrueColor($imgmaxxks,$imgmaxyks); $black = ImageColorAllocate($im, 0, 0, 0); - $bg1p = ImageColorAllocate($im, 110,148,183); - $bg2p = ImageColorAllocate($im, 175,198,219); + $bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B); + $bg2p = ImageColorAllocate($im, $buttonBg_R,$buttonBg_G,$buttonBg_B); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); @@ -141,7 +141,8 @@ $avgmonth=$_GET['avgmonth']; if ($mintemp < 0) { $y = round($imgmaxyks-((0-$mintemp)*$fac)); - ImageLine($im, $imgmaxxks, $y,0 , $y, $bg1p); + #ImageLine($im, $imgmaxxks-$maxcountKS, $y,0 , $y, $bg1p); + ImageLine($im, $imgmaxxks, $y,$imgmaxxks-$maxcountKS , $y, $bg1p); } $text="Temperature"; $fontsize=7; diff --git a/fhem/webfrontend/pgm3/include/room.php b/fhem/webfrontend/pgm3/include/room.php index 9e4c88f84..c57acfce9 100755 --- a/fhem/webfrontend/pgm3/include/room.php +++ b/fhem/webfrontend/pgm3/include/room.php @@ -11,8 +11,8 @@ include "../config.php"; $im = ImageCreateTrueColor($imgmaxxroom,$imgmaxyroom); $black = ImageColorAllocate($im, 0, 0, 0); - $bg1p = ImageColorAllocate($im, 110,148,183); - $bg2p = ImageColorAllocate($im, 175,198,219); + $bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B); + $bg2p = ImageColorAllocate($im, $buttonBg_R,$buttonBg_G,$buttonBg_B); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); diff --git a/fhem/webfrontend/pgm3/include/userdefs.php b/fhem/webfrontend/pgm3/include/userdefs.php index 9382e2a64..d97160be1 100755 --- a/fhem/webfrontend/pgm3/include/userdefs.php +++ b/fhem/webfrontend/pgm3/include/userdefs.php @@ -111,8 +111,8 @@ include "functions.php"; # Start Graphic $im = ImageCreateTrueColor($imgmaxxuserdef,$imgmaxyuserdef); $black = ImageColorAllocate($im, 0, 0, 0); - $bg1p = ImageColorAllocate($im, 110,148,183); - $bg2p = ImageColorAllocate($im, 175,198,219); + $bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B); + $bg2p = ImageColorAllocate($im, $buttonBg_R,$buttonBg_G,$buttonBg_B); $bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B); $white = ImageColorAllocate($im, 255, 255, 255); $gray= ImageColorAllocate($im, 133, 133, 133); diff --git a/fhem/webfrontend/pgm3/include/weather.php b/fhem/webfrontend/pgm3/include/weather.php index f5d2fc2e5..3a8a5e354 100644 --- a/fhem/webfrontend/pgm3/include/weather.php +++ b/fhem/webfrontend/pgm3/include/weather.php @@ -3,6 +3,8 @@ setlocale (LC_ALL, 'de_DE.utf8'); +#include '../config.php'; #only debug + function website_WEATHER($station, $land, $sprache) diff --git a/fhem/webfrontend/pgm3/index.php b/fhem/webfrontend/pgm3/index.php index 19b52eea4..3ead69634 100644 --- a/fhem/webfrontend/pgm3/index.php +++ b/fhem/webfrontend/pgm3/index.php @@ -6,7 +6,7 @@ # # Copyright notice # -# (c) 2006-2009 Copyright: Martin Haas (fhz@martin-haas.de) +# (c) 2006-2010 Copyright: Martin Haas (fhz@martin-haas.de) # All rights reserved # # This script is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ include "include/gnuplot.php"; include "include/functions.php"; -$pgm3version='091219'; +$pgm3version='100108'; $Action = $_POST['Action']; $order = $_POST['order']; @@ -143,6 +143,7 @@ $pgm3version='091219'; # try to get the URL: $homeurl='http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; $forwardurl=$homeurl.'?'; + $phpfileurl=$_SERVER['SCRIPT_NAME']; $testFirstStart=$_SERVER['QUERY_STRING']; if ($testFirstStart=='') ##new session (??) then start-values { @@ -229,18 +230,6 @@ function execFHZ($order,$machine,$port) global $errormessage; -#PHP4 is not supported any more 20091115 -#$version = explode('.', phpversion()); - -#if ( $version[0] == 4 ) -#{ -# include "config.php"; -# $order="$fhem_pl $port '$order'"; #PHP4, only localhost -# exec($order,$res); -# $errormessage = $res[0]; -#}# -#else -#{ if ($usenetcat=='1') { $order="$echo xmllist | netcat -w3 $machine $port"; @@ -254,8 +243,6 @@ if ($usenetcat=='1') echo "$errstr ($errno)
\n"; } else { fwrite($fp, "$order\n;quit\n"); - #$errormessage= fgets($fp, 1024); - #$errormessage= fgets($fp, 65535); $errormessage= fgets($fp); fclose($fp); } @@ -275,25 +262,18 @@ unset($longxml); $version = explode('.', phpversion()); -if ( $version[0] == 4 ) -{ - $xmllist="$fhem_pl $fhemport xmllist"; - exec($xmllist,$output); -} -else -{ + +# get the xmllist from fhem $fp = stream_socket_client("tcp://$fhem:$fhemport", $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)
\n"; } else { fwrite($fp, "xmllist\r\n;quit\r\n"); - while (!feof($fp)) { - $outputvar = fgets($fp, 1024); - array_push($output,$outputvar); - } + $outputvar=stream_get_contents($fp); + array_push($output,$outputvar); fclose($fp); } -} + @@ -550,7 +530,7 @@ xml_parser_free($xml_parser); - + $titel"; include ("include/style.css"); @@ -559,13 +539,13 @@ xml_parser_free($xml_parser); echo" $errormessage -
- + \r
\r
+ \r -
- +
+ \r "; @@ -630,16 +612,18 @@ xml_parser_free($xml_parser); ############################ WEATHER if ($enableweather==1) { - echo ""; - if ($showweath==1) include 'include/weather.php'; + if (($weatherroom != 'hidden') + and ($showroom=='ALL' or $showroom==$weatherroom or $weatherroom=='donthide') + and ($showweath==1)) include 'include/weather.php'; } @@ -647,14 +631,14 @@ xml_parser_free($xml_parser); ############################ FHZ if ($show_fs20pulldown==1 or $show_general==1 or $show_fhtpulldown==1) { - echo ""; } @@ -688,9 +672,14 @@ xml_parser_free($xml_parser); ############################ ROOMS if (($showroombuttons==1) and (count($rooms)>1)) { - echo ""; + +echo "\r\r\r"; + echo ""; + #echo "\r"; + echo "\r\r\r"; $counter=0; echo ""; + echo "\r"; if (isset($showfs20) and $showgnuplot == 1) { drawgnuplot($showfs20,"FS20",$gnuplot,$pictype,$logpath, $FHTyrange,$FHTy2range); $FS20dev1=$showfs20.'1'; - echo ""; @@ -772,8 +765,15 @@ xml_parser_free($xml_parser); elseif (substr($stack[0][children][$i][name],0,4)=='FHT_') { $type=$stack[0][children][$i][name]; - echo ""; + #echo "\r"; + echo "\r\r\r"; + + + for($j=0; $j < count($stack[0][children][$i][children]); $j++) { $room=""; @@ -792,7 +792,7 @@ xml_parser_free($xml_parser); $FHTdev=$stack[0][children][$i][children][$j][attrs][name]; if ($showfht == $FHTdev) - {echo ""; } else - {echo ""; }; - echo ""; echo ""; @@ -821,23 +821,23 @@ xml_parser_free($xml_parser); { drawgnuplot($FHTdev,"FHT",$gnuplot,$pictype,$logpath, $FHTyrange,$FHTy2range); $FHTdev1=$FHTdev.'1'; - echo ""; } if ( $showfht==$FHTdev) { - echo "\r\r"; } } } @@ -846,8 +846,16 @@ xml_parser_free($xml_parser); elseif ((substr($stack[0][children][$i][name],0,4)=='HMS_') or (substr($stack[0][children][$i][name],0,6)=='CUL_WS')) { $type=$stack[0][children][$i][name]; - echo ""; + #echo "\r"; + echo "\r\r\r"; + + + + for($j=0; $j < count($stack[0][children][$i][children]); $j++) { $room=""; @@ -870,7 +878,7 @@ xml_parser_free($xml_parser); { if ($showhmsgnu== $HMSdev) {$formvalue="hide";$gnuvalue="";} else {$formvalue="show";$gnuvalue=$HMSdev;}; - echo ""; if ($showhmsgnu == $HMSdev and $showgnuplot == 1) { drawgnuplot($HMSdev,$type,$gnuplot,$pictype,$logpath,0,0); $HMSdev1=$HMSdev.'1'; - echo ""; } @@ -899,8 +907,12 @@ 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_') { $type=$stack[0][children][$i][name]; - echo ""; + #echo "\r"; + echo "\r\r\r"; for($j=0; $j < count($stack[0][children][$i][children]); $j++) { $KSdev=$stack[0][children][$i][children][$j][attrs][name]; @@ -927,14 +939,14 @@ xml_parser_free($xml_parser); $Yks=$imgmaxyks*4; ##gnuplot if ($showks == $KSdev) - {echo "";} else - {echo ""; }; - echo ""; if (! isset ($willi)) $drawtype="KS300"; else $drawtype="WS300"; @@ -962,7 +974,7 @@ xml_parser_free($xml_parser); drawgnuplot($KSdev,$drawtype."_t2",$gnuplot,$pictype,$logpath,0,0); } $KSdev1=$KSdev.'1'; - echo ""; } @@ -974,8 +986,8 @@ xml_parser_free($xml_parser); ############################ elseif ($stack[0][children][$i][name]=='LOGS'or $stack[0][children][$i][name]=='FileLog_LIST') { - echo "\r"; if (isset ($showlogs)) for($j=0; $j < count($stack[0][children][$i][children]); $j++) { @@ -996,7 +1008,7 @@ xml_parser_free($xml_parser); } } $name=$stack[0][children][$i][children][$j][attrs][name]; - echo " + echo "\r"; } @@ -1004,14 +1016,14 @@ xml_parser_free($xml_parser); ############################ elseif ($stack[0][children][$i][name]=='NOTIFICATIONS' or $stack[0][children][$i][name]=='notify_LIST') { - echo "\r\r"; if (isset ($shownoti)) for($j=0; $j < count($stack[0][children][$i][children]); $j++) @@ -1025,20 +1037,20 @@ xml_parser_free($xml_parser); } } $name=$stack[0][children][$i][children][$j][attrs][name]; - echo ""; + echo "\r"; } } ############################ elseif ($stack[0][children][$i][name]=='AT_JOBS' or $stack[0][children][$i][name]=='at_LIST') { - echo "\r\r"; if (isset ($showat)) @@ -1057,7 +1069,7 @@ xml_parser_free($xml_parser); } $order='delete '.$order; - echo ""; + echo "\r"; } } }; @@ -1065,10 +1077,10 @@ xml_parser_free($xml_parser); ##################### User defined graphics?? if ($UserDefs==1) { - echo "\r"; $type='userdef'; @@ -1084,19 +1096,19 @@ xml_parser_free($xml_parser); { if ($showuserdefgnu== $UserDef) {$formvalue="hide";$gnuvalue="";} else {$formvalue="show";$gnuvalue=$UserDef;}; - echo ""; + echo "\r"; if ($showuserdefgnu == $UserDef and $showgnuplot == 1) { drawgnuplot($UserDef,$type,$gnuplot,$pictype,$logpath,$userdef[$i],$i); $UserDef1=$UserDef.'1'; - echo ""; } @@ -1111,18 +1123,18 @@ xml_parser_free($xml_parser); if ($taillog==1) { - echo ""; + if (isset ($showhist)) {foreach($tailoutput as $data) echo "\r";}; }; - echo "
- + \r

$titel
$now @@ -579,7 +559,7 @@ xml_parser_free($xml_parser); { echo "
- + \r
-
WEBCAM "; if (! isset($showpics)) @@ -591,6 +571,8 @@ xml_parser_free($xml_parser); echo" "; + if (($webcamroom != 'hidden') + and ($showroom=='ALL' or $showroom==$webcamroom or $webcamroom=='donthide')) if (isset($showpics)) { for($i=0; $i < count($webcam); $i++) @@ -617,7 +599,7 @@ xml_parser_free($xml_parser); echo"
+ \r
+ echo "\r
\r
WEATHER"; if ($showweath != '1') { echo "show";} else { echo "hide";} - echo "
"; + echo "
"; echo "
+ echo "\r
\r
FHZ_DEVICE"; if ($showmenu != '1') { echo "show";} else { echo "hide";} - echo "
"; + echo "
"; echo "
"; - echo "ROOMS "; - echo "
+ \r\r + \r
ROOMS +
"; $counter=0; for($i=0; $i < count($rooms); $i++) @@ -698,7 +687,7 @@ xml_parser_free($xml_parser); $room=$rooms[$i]; if ($room != 'hidden') { - echo""; + echo""; $counter++; if (fmod($counter,$roommaxiconperline)== 0.0) echo "
"; @@ -714,7 +703,7 @@ xml_parser_free($xml_parser); {echo "Error!! There is no FHEM. You need at least FHEM-4.0 to run this pgm3!!";} - + ## now the xmllist will be writen on screen as html ##### Let's go.... :-))))) for($i=0; $i < count($stack[0][children]); $i++) { @@ -722,8 +711,12 @@ xml_parser_free($xml_parser); if ((substr($stack[0][children][$i][name],0,5)=='FS20_') || (substr( $stack[0][children][$i][name],0,4)=='X10_')) { $type=$stack[0][children][$i][name]; - echo "
"; - echo "$type
"; + #echo "$type
+ \r\r + \r
$type +
"; for($j=0; $j < count($stack[0][children][$i][children]); $j++) @@ -753,16 +746,16 @@ xml_parser_free($xml_parser); if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room)) { $counter++; - echo""; + echo""; if (fmod($counter,$fs20maxiconperline)== 0.0) echo "
"; }; } - echo "

+ echo "\r


"; - echo "$type
"; + #echo "$type
+ \r\r + \r
$type +
+ {echo "\r
@@ -802,7 +802,7 @@ xml_parser_free($xml_parser); adjust
+ {echo "\r
@@ -812,7 +812,7 @@ xml_parser_free($xml_parser); adjust + echo "\r

+ echo "\r


"; + echo "\r"; + echo "\r
\r"; for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++) { $name=$stack[0][children][$i][children][$j][children][$k][attrs][key]; $value=$stack[0][children][$i][children][$j][children][$k][attrs][value]; $measured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; - echo ""; } - echo "
$FHTdev (FHT): $name$value + echo "\r
$FHTdev (FHT): $name$value $measured
"; - echo "$type
"; +# echo "$type
+ \r\r + \r
$type +
+ echo "\r
@@ -880,14 +888,14 @@ xml_parser_free($xml_parser); } else - {echo "
";} + {echo "\
";} echo "

+ echo "\r

"; - echo "$type
"; + #echo "$type
+ \r\r + \r
$type +
+ {echo "\r
+ {echo "\r
"; echo "
Temp./Hum.
@@ -947,7 +959,7 @@ xml_parser_free($xml_parser);
"; + echo "\r"; echo ""; echo "

+ echo "\r

- + echo "\r"; + echo "\r
+ \r
LOGS"; if (! isset ($showlogs)) { echo "show";} @@ -983,7 +995,7 @@ xml_parser_free($xml_parser); { echo "hide";} - echo "
Log:
Log: $value / $name
- + echo "\r"; + echo "\r
+ \r
NOTIFICATIONS"; if (! isset ($shownoti)) { echo "show";} else { echo "hide";} - echo "
Notification:$value / $name
Notification:$value / $name
- + echo "\r"; + echo "\r
+ \r
AT_JOBS"; if (! isset ($showat)) { echo "show";} else { echo "hide";} - echo "
AT-Job: del $value / $next / $command
AT-Job: del $value / $next / $command
- + echo "\r\r"; + \r
+ \r\r
USER DEFINED -
-
+ echo "\r
+ \r - "; + \r"; - echo "

+ echo "\r

- + echo "\r\r"; - if (isset ($showhist)) {foreach($tailoutput as $data) echo "";}; + echo "\r
+ \r\r
$taillogorder"; if (! isset ($showhist)) { echo "show";} else { echo "hide";} - echo "
History$data
History$data
"; + echo "\r\r\r\r"; ?>