From 3f1631d3318366bb9f19122e862af0048cc4dd90 Mon Sep 17 00:00:00 2001 From: martinhaas <> Date: Sat, 19 Dec 2009 06:20:16 +0000 Subject: [PATCH] MartinH: pgm3: automatic support for CUL_WS (S300TH) added git-svn-id: https://svn.fhem.de/fhem/trunk@515 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/HISTORY | 3 +++ fhem/webfrontend/pgm3/CHANGED | 4 ++++ fhem/webfrontend/pgm3/HISTORY | 3 +++ fhem/webfrontend/pgm3/include/gnuplot.php | 1 + fhem/webfrontend/pgm3/include/hms100.php | 9 +++++---- fhem/webfrontend/pgm3/index.php | 9 +++++---- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 78a0ae6c2..6f07b179a 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -558,4 +558,5 @@ - bugfix: 21_OWTEMP.pm Defining a device now fail when no OWFS device was defined (M.Fischer) - bugfix: 21_OWTEMP.pm missing trigger fo notify/filelog (M.Fischer) - feature: 99_getstate.pm get state from S555TH now (M.Fischer) + - feature: pgm3: automatic support for CUL_WS (S300TH) added (MartinH) diff --git a/fhem/HISTORY b/fhem/HISTORY index 3a5a710b2..b938fc43a 100644 --- a/fhem/HISTORY +++ b/fhem/HISTORY @@ -451,3 +451,6 @@ are shown in the graphics. php4 disabled. Now only php5 is supported. A lot of examples of the UserDefs are added. The pgm3-section of fhem.html was changed. + +- Sat Dec 19 2009 (MartinH) + - pgm3: Automatic support for CUL_WS (S300TH) added diff --git a/fhem/webfrontend/pgm3/CHANGED b/fhem/webfrontend/pgm3/CHANGED index 3cbe179dc..0273b707b 100644 --- a/fhem/webfrontend/pgm3/CHANGED +++ b/fhem/webfrontend/pgm3/CHANGED @@ -191,3 +191,7 @@ It is not necessary to tell fhem that there are other logs. 2009-11-16 -- New version with Battery-check, Log-Pull-Down, Google-Weather-Api -- Changed Files: index.php, config.php, fhtpulldown.php, weather.php + +2009-12-19 + -- Feature: CUL_WS added. Automatic support for S300TH (eg. S555TH). + Changed: index.php, hms100.php, gnuplot.php diff --git a/fhem/webfrontend/pgm3/HISTORY b/fhem/webfrontend/pgm3/HISTORY index 2dcf47c57..648f0d54f 100644 --- a/fhem/webfrontend/pgm3/HISTORY +++ b/fhem/webfrontend/pgm3/HISTORY @@ -93,3 +93,6 @@ -- Feature: The status of the batteries of FHT and HMS are shown in the graphics -- php4 disabled. Only php5 is supported. -- A lot of examples of the UserDefs are added. + +- Martin 2009-12-19 + -- Feature: CUL_WS added. Automatic support for S300TH (eg. S555TH) diff --git a/fhem/webfrontend/pgm3/include/gnuplot.php b/fhem/webfrontend/pgm3/include/gnuplot.php index c39e9431c..4ddef6df8 100644 --- a/fhem/webfrontend/pgm3/include/gnuplot.php +++ b/fhem/webfrontend/pgm3/include/gnuplot.php @@ -165,6 +165,7 @@ EOD; break; Case HMS100TF: ############################################ + Case CUL_WS: ############################################ $gplotmain=" set ylabel 'Temperature (Celsius)' set y2label 'Humidity (%)' diff --git a/fhem/webfrontend/pgm3/include/hms100.php b/fhem/webfrontend/pgm3/include/hms100.php index e061c93c7..79d8ea2b4 100755 --- a/fhem/webfrontend/pgm3/include/hms100.php +++ b/fhem/webfrontend/pgm3/include/hms100.php @@ -15,7 +15,7 @@ $drawhms=$_GET['drawhms']; $room=$_GET['room']; $type=$_GET['type']; $battery=$_GET['battery']; -$supported_HMS= array('HMS100T','HMS100TF','HMS100WD','HMS100MG','HMS100TFK','HMS100W','RM100-2','HMS100CO'); +$supported_HMS= array('HMS100T','HMS100TF','HMS100WD','HMS100MG','HMS100TFK','HMS100W','RM100-2','HMS100CO','CUL_WS'); @@ -85,7 +85,7 @@ $supported_HMS= array('HMS100T','HMS100TF','HMS100WD','HMS100MG','HMS100TFK','HM #print_r($array[1][12]); exit; ########################################################################### -if ( $type == "HMS100T" or $type == "HMS100TF" ) ## hms100t-Device. +if ( $type == "HMS100T" or $type == "HMS100TF" or $type == "CUL_WS") ## hms100t-Device. { for ($x = 0; $x < $counter; $x++) @@ -145,7 +145,7 @@ if ( $type == "HMS100T" or $type == "HMS100TF" ) ## hms100t-Device. }; #HMS100T -if ( $type == "HMS100TF") ## hms100tf-Device. +if (( $type == "HMS100TF") or ( $type == "CUL_WS")) ## hms100tf-Device. { #Humidity... @@ -200,7 +200,7 @@ if ( $type == "HMS100TF") ## hms100tf-Device. ############################################################################# -if ( $type == "HMS100T" or $type == "HMS100TF" ) +if ( $type == "HMS100T" or $type == "HMS100TF" or $type == "CUL_WS") { $text="Temperature"; @@ -242,6 +242,7 @@ if ( $type == "HMS100TF" and $showdewpoint=='yes' ) ImageTTFText ($im, 8, 0,90-$XcorrectMainTextHMS, 22, $txtcolor, $fontttfb, $text); $fontsize=7; $text='Bat: '.$battery; + if ($type=="CUL_WS") $text=""; if ($battery != 'ok') {$txtcolor=$red; $text='Bat: low';}; ImageTTFText ($im, $fontsize, 0, 105, 10, $txtcolor, $fontttf, $text); $fontsize=7; diff --git a/fhem/webfrontend/pgm3/index.php b/fhem/webfrontend/pgm3/index.php index a7c505f0d..19b52eea4 100644 --- a/fhem/webfrontend/pgm3/index.php +++ b/fhem/webfrontend/pgm3/index.php @@ -41,7 +41,7 @@ include "include/gnuplot.php"; include "include/functions.php"; -$pgm3version='091116a'; +$pgm3version='091219'; $Action = $_POST['Action']; $order = $_POST['order']; @@ -843,7 +843,7 @@ xml_parser_free($xml_parser); } } ############################ - elseif (substr($stack[0][children][$i][name],0,4)=='HMS_') + 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 ""; @@ -859,13 +859,14 @@ xml_parser_free($xml_parser); 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") + if (( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="type") or + ( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="TYPE") ) {$type=$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]; - if ($type=="HMS100T" or $type=="HMS100TF") + if ($type=="HMS100T" or $type=="HMS100TF" or $type=="CUL_WS") { if ($showhmsgnu== $HMSdev) {$formvalue="hide";$gnuvalue="";} else {$formvalue="show";$gnuvalue=$HMSdev;};