diff --git a/webfrontend/pgm3/config.php b/webfrontend/pgm3/config.php index 62eaf8191..27c01db2d 100644 --- a/webfrontend/pgm3/config.php +++ b/webfrontend/pgm3/config.php @@ -286,6 +286,8 @@ $userdef[$sortnumber]['logrotatelines']=2200; $showNOTI='no'; #show the NOTIFICATIONS at startup. Default: no Values: yes/no $showHIST='yes'; #show the HISTORY (if taillog=1) at startup. Default: yes Values: yes/no + $RSStitel='FHEM :-)'; + $urlreload=90; # Automatic reloading page [sec]. Default fast: 60 slow:90 diff --git a/webfrontend/pgm3/include/rssfeeds.php b/webfrontend/pgm3/include/rssfeeds.php new file mode 100644 index 000000000..a86126eb9 --- /dev/null +++ b/webfrontend/pgm3/include/rssfeeds.php @@ -0,0 +1,181 @@ + + + + + + + $RSStitel + http://www.fhem.de + RSS-Feeds for FHEM + \nLast Update: $now\n$forwardurl\n +"; + + ##### Let's go.... :-))))) + for($i=0; $i < count($stack[0][children]); $i++) + { + ############################ + if (substr($stack[0][children][$i][name],0,5)=='FS20_') + { + echo "\n************* FS20 state *************\n$forwardurl\n"; + $type=$stack[0][children][$i][name]; + $counter=0; + for($j=0; $j < count($stack[0][children][$i][children]); $j++) + { + $fs20=$stack[0][children][$i][children][$j][attrs][name]; + $state=$stack[0][children][$i][children][$j][attrs][state]; + $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') + { + $measured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; + } + 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]; + } + } + } + if (($state=='on') or ($state=='dimup')) + {$order="set $fs20 off";} + else + {$order="set $fs20 on";}; + $url=$forwardurl.'rssorder='.$order; + echo $url; + if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room)) + { + echo "\n$fs20 $state\n$url\n\n"; + }; + } + } + + ############################ + elseif (substr($stack[0][children][$i][name],0,4)=='FHT_') + { + echo "\n************* FHT state *************\n$forwardurl\n"; + $type=$stack[0][children][$i][name]; + for($j=0; $j < count($stack[0][children][$i][children]); $j++) + { + $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]; + if ( $check=="room") + {$room=$stack[0][children][$i][children][$j][children][$k][attrs][value]; } + if ( $check=="measured-temp") + {$measuredtemp=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + $pos=strpos($measuredtemp,' '); + $measuredtemp=substr($measuredtemp,0,$pos); + } + } + if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room)) + { + $FHTdev=$stack[0][children][$i][children][$j][attrs][name]; + echo "\n$FHTdev $measuredtemp\n$forwardurl\n\n"; + + } + } + } + ############################ + elseif (substr($stack[0][children][$i][name],0,4)=='HMS_') + { + echo "\n************* HMS state *************\n$forwardurl\n"; + $type=$stack[0][children][$i][name]; + for($j=0; $j < count($stack[0][children][$i][children]); $j++) + { + $room=""; + for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++) + { + if ( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="room") + {$room=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + } + if ( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="type") + {$type=$stack[0][children][$i][children][$j][children][$k][attrs][value];}; + if ( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="STATE") + {$state=$stack[0][children][$i][children][$j][children][$k][attrs][value];}; + } + if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room)) + { + $HMSdev=$stack[0][children][$i][children][$j][attrs][name]; + echo "\n$HMSdev $state\n$forwardurl\n\n"; + + + } + + } + } + ############################ + elseif (substr($stack[0][children][$i][name],0,6)=='KS300_' or substr($stack[0][children][$i][name],0,6)=='WS300_') + { + echo "\n*********** KS300/WS300 ***********\n$forwardurl\n"; + $type=$stack[0][children][$i][name]; + 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++) + { + if ( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="STATE") + {$state=$stack[0][children][$i][children][$j][children][$k][attrs][value];}; + } + echo "\n$KSdev $state\n$forwardurl\n\n"; + + } + } + + ############################ +} + + +echo " + + +"; + + + + +?> diff --git a/webfrontend/pgm3/index.php b/webfrontend/pgm3/index.php index 9e7db4439..c0fa2b472 100644 --- a/webfrontend/pgm3/index.php +++ b/webfrontend/pgm3/index.php @@ -41,7 +41,7 @@ include "include/gnuplot.php"; include "include/functions.php"; -$pgm3version='071030'; +$pgm3version='071130'; $Action = $_POST['Action']; @@ -64,6 +64,14 @@ $pgm3version='071030'; $fs20dev = $_POST['fs20dev']; $errormessage = $_POST['errormessage']; + if (! isset($showrss)) $showrss=$_GET['showrss']; + if (! isset($rssorder)) $rssorder=$_GET['rssorder']; + if ($rssorder=="") + {unset($rssorder);} + else + {$Action='exec'; $order=$rssorder;} + + if (! isset($showhmsgnu)) $showhmsgnu=$_GET['showhmsgnu']; if ($showhmsgnu=="") unset($showhmsgnu); @@ -230,17 +238,6 @@ $fp = stream_socket_client("tcp://$machine:$port", $errno, $errstr, 30); return $errormessage; } -###### write the header on screen - echo " - - - - - - - $titel"; - include ("include/style.css"); - echo " "; ###### make an array from the xmllist @@ -431,11 +428,34 @@ xml_parser_free($xml_parser); #print_r($fs20devs); exit; #echo count($stack[0][children]);exit; + + + + # Print Array on Screen $now=date($timeformat); +# only RSS-Feeds?? + if (isset($showrss)) { include "include/rssfeeds.php"; exit; } + + + +###### write the header on screen + echo " + + + + + + + + $titel"; + include ("include/style.css"); + echo " "; + + echo" $errormessage
@@ -514,7 +534,7 @@ xml_parser_free($xml_parser); ##### Check Version of FHEM if (! ($stack[0][children][0][name]=='_internal__LIST')) ##older FHZ100 have no Internal_LIST - {echo "Error!! You need at least FHEM-4.0 to run this pgm3!!";} + {echo "Error!! There is no FHEM. You need at least FHEM-4.0 to run this pgm3!!";}