Feature, new version with homematic and different Buttons fuer FS20
git-svn-id: https://svn.fhem.de/fhem/trunk@1546 2b470e98-0d58-463d-a4d8-8e2adae1ed80
@ -220,4 +220,5 @@ It is not necessary to tell fhem that there are other logs.
|
||||
2012-05-07
|
||||
-- Bugfix: userdefs.php works with new gnuplot-version
|
||||
|
||||
|
||||
2012-05-08
|
||||
-- Feature: homematic added, FS20-Buttons now different depending of the state
|
||||
|
@ -122,3 +122,6 @@
|
||||
|
||||
- Martin 2012-05-07
|
||||
-- bugfix: userdefs.php. Now wokrs with new Gnuplot (imagecopy)
|
||||
|
||||
. Martin 2012-05-08
|
||||
-- Feature: Homematic added, FS20-Buttons now depending of the state
|
||||
|
@ -7,11 +7,14 @@
|
||||
|
||||
|
||||
###### required settings
|
||||
#$fhem="fritz.box"; # 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: "attr global port <nr> global"
|
||||
$fhemport="7072"; # port of fhem.pl
|
||||
#$logpath="/mnt/fritzbox/"; # where are your logs? Use a writabel nfs-share if pgm3 and fhem are not on the same machine
|
||||
#mount your fritzbox with something like this in the /etc/fstab: //fritz.box/fritz.nas /mnt/fritzbox cifs guest 0 0
|
||||
$logpath="/var/tmp/"; # where are your logs? Use a writabel nfs-share if pgm3 and fhem are not on the same machine
|
||||
$AbsolutPath="/var/www/"; # where ist your pgm3?
|
||||
|
||||
@ -48,8 +51,8 @@
|
||||
$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[0]='http://webcam/IMAGE.JPG';
|
||||
#$webcam[1]='http://webcam2/IMAGE.JPG';
|
||||
#$webcam[1]='http://www.bostream.nu/hoganas/OutsideTempHistory.gif';
|
||||
#$webcam[1]='IMAGE.PNG'; # Supported are Webcams with http:// ftp:// ....
|
||||
# and Images wich must be copied to <pgm3>/tmp/
|
||||
@ -59,12 +62,13 @@
|
||||
|
||||
|
||||
# Weather # Google-Api. It requires an Internet Connection
|
||||
$enableweather=0; # show the google-weather?
|
||||
$weathercity='Linden';
|
||||
$enableweather=1; # show the google-weather?
|
||||
$weathercity='Butzbach';
|
||||
$weathercountry='Germany';
|
||||
$weatherlang='de';
|
||||
#$weatherlang='en';
|
||||
$weatherroom='donthide'; # existing room. Otherwise it will either
|
||||
# $weatherroom='(19)Garten'; # existing room. Otherwise it will either
|
||||
# be in ALL or with 'donthide' not hided
|
||||
|
||||
|
||||
@ -72,6 +76,7 @@
|
||||
## 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_hmpulldown=1; #Pull-Down for the HomeMatic Devices 0/1 Default:1
|
||||
$show_fhtpulldown=1; #Pull-Down for the FHT-Devices 0/1 Default:1
|
||||
$show_logpulldown=1; #Pull-Down for Log-files and FS20 (grep fhem.log)
|
||||
$logsort='| sort -r'; #sort the Log-Output how you want;
|
||||
@ -81,10 +86,22 @@
|
||||
# or delete the old pictures: rm <pgm>/tmp/*
|
||||
##############################################################################################
|
||||
## FS20-Device, adjust it if you have e.g. long titles
|
||||
$imgmaxxfs20=85; #Size of the pictures, default=85
|
||||
$imgmaxyfs20=85; # default=85
|
||||
|
||||
#$imgmaxxfs20=166; # Size of the pictures, default=85
|
||||
$imgmaxxfs20=115; # Size of the pictures, default=115
|
||||
$imgmaxyfs20=75; # default=75
|
||||
$fs20fontsizetitel=10; # default=10
|
||||
$fs20maxiconperline=9; # default=9
|
||||
$fs20maxiconperline=7; # default=r79
|
||||
|
||||
# look at http://fhemwiki.de for explanations
|
||||
$roomname='0'; # Show Roomname on Button [1|0]
|
||||
$roomcorr='5'; # Correction for Iconposition if roomname = 0 [n]
|
||||
$dategerman='1'; # Date in German Format (25.03.2012) [1|0]
|
||||
$umlaute='1'; # Changes "ue" in "ü"... [1|0]
|
||||
$namesortbutton='1'; # [1|0]
|
||||
$namesortbuttonsign='_'; # If $namesortbutton = 1 the Sign "_" will replace with " " [x]
|
||||
$namereplacebutton='1'; # Changes "This_is_a_Test" in "This is a Test" [1|0]
|
||||
$namereplacebuttonsign='_'; # If $namereplaceroom = 1 the Sign "_" will replace with " " [x]
|
||||
|
||||
# room. Write e.g. "attr rolowz room wzo"
|
||||
# into your fhem.cfg and restart fhem.pl
|
||||
@ -94,12 +111,18 @@
|
||||
|
||||
##############################################################################################
|
||||
## 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
|
||||
$imgmaxyroom=30; # default=30
|
||||
$imgmaxyroom=22; # default=30
|
||||
$roomfontsizetitel=10; # default=9
|
||||
$roommaxiconperline=$fs20maxiconperline; # default=$fs20maxiconperline
|
||||
|
||||
$namesortroom='1'; # [1|0]
|
||||
$namesortroomsign=')'; # If $namesortroom = 1 the Sign ")" will replace with " " [x]
|
||||
$namereplaceroom='1'; # Changes "This_is_a_Test" in "This is a Test" [1|0]
|
||||
$namereplaceroomsign='_'; # If $namereplaceroom = 1 the Sign "_" will replace with " " [x]
|
||||
|
||||
##############################################################################################
|
||||
|
||||
## FHT-Devices
|
||||
@ -228,11 +251,11 @@ $UserDefs=0;
|
||||
# example:
|
||||
#define solarpumpe.log FileLog /var/tmp/solarpumpe.log solarpumpe:.*(on|off).*
|
||||
$sortnumber=0;
|
||||
$userdef[$sortnumber]['name']='PiriO';
|
||||
$userdef[$sortnumber]['name']='SolarPumpe';
|
||||
#$userdef[$sortnumber]['name']='';
|
||||
$userdef[$sortnumber]['valuefield']=3;
|
||||
$userdef[$sortnumber]['gnuplottype']='fs20';
|
||||
$userdef[$sortnumber]['logpath']='/mnt/fhz/solarpumpe.log';
|
||||
$userdef[$sortnumber]['logpath']='/var/tmp/solarpumpe.log';
|
||||
$userdef[$sortnumber]['room']='cellar';
|
||||
$userdef[$sortnumber]['semlong']='Solarpumpe';
|
||||
$userdef[$sortnumber]['semshort']='';
|
||||
@ -241,83 +264,48 @@ $userdef[$sortnumber]['imagemay']=52;
|
||||
$userdef[$sortnumber]['maxcount']=575;
|
||||
$userdef[$sortnumber]['XcorrectMainText']=25;
|
||||
$userdef[$sortnumber]['logrotatelines']=50;
|
||||
|
||||
|
||||
##########################
|
||||
# example:
|
||||
#define rolu1.log FileLog /var/tmp/rolu1.log rolu1:.*(on|off|dimup|dimdown).*
|
||||
#$sortnumber=2;
|
||||
#$userdef[$sortnumber]['name']='Rolu1';
|
||||
#$userdef[$sortnumber]['valuefield']=3;
|
||||
#$userdef[$sortnumber]['gnuplottype']='fs20';
|
||||
#$userdef[$sortnumber]['logpath']='/var/tmp/rolu1.log';
|
||||
#$userdef[$sortnumber]['room']='wgu';
|
||||
#$userdef[$sortnumber]['semlong']='Rolladen';
|
||||
#$userdef[$sortnumber]['semshort']='';
|
||||
#$userdef[$sortnumber]['imagemax']=725;
|
||||
#$userdef[$sortnumber]['imagemay']=52;
|
||||
#$userdef[$sortnumber]['maxcount']=575;
|
||||
#$userdef[$sortnumber]['XcorrectMainText']=25;
|
||||
#$userdef[$sortnumber]['logrotatelines']=30;
|
||||
|
||||
##########################
|
||||
# example:
|
||||
#define rolu1.log FileLog /var/tmp/rolu1.log rolu1:.*(on|off|dimup|dimdown).*
|
||||
$sortnumber=1;
|
||||
$userdef[$sortnumber]['name']='allight';
|
||||
$userdef[$sortnumber]['name']='netbook';
|
||||
$userdef[$sortnumber]['valuefield']=3;
|
||||
$userdef[$sortnumber]['gnuplottype']='fs20';
|
||||
$userdef[$sortnumber]['logpath']='/mnt/fhz/allight.log';
|
||||
$userdef[$sortnumber]['room']='alarm';
|
||||
$userdef[$sortnumber]['semlong']='Alarm light';
|
||||
$userdef[$sortnumber]['logpath']='/var/tmp/netbook.User.log';
|
||||
$userdef[$sortnumber]['room']='wgo';
|
||||
$userdef[$sortnumber]['semlong']='netbook';
|
||||
$userdef[$sortnumber]['semshort']='';
|
||||
$userdef[$sortnumber]['imagemax']=725;
|
||||
$userdef[$sortnumber]['imagemay']=52;
|
||||
$userdef[$sortnumber]['maxcount']=575;
|
||||
$userdef[$sortnumber]['XcorrectMainText']=25;
|
||||
$userdef[$sortnumber]['logrotatelines']=30;
|
||||
$userdef[$sortnumber]['logrotatelines']=2000;
|
||||
##########################
|
||||
|
||||
|
||||
#$sortnumber=2;
|
||||
#$userdef[$sortnumber]['name']='tARV';
|
||||
#$userdef[$sortnumber]['valuefield']=3;
|
||||
$sortnumber=2;
|
||||
$userdef[$sortnumber]['name']='PiriU';
|
||||
$userdef[$sortnumber]['valuefield']=3;
|
||||
$userdef[$sortnumber]['gnuplottype']='piri';
|
||||
$userdef[$sortnumber]['logpath']='/var/tmp/piriu.log';
|
||||
$userdef[$sortnumber]['room']='wgu';
|
||||
$userdef[$sortnumber]['semlong']='Piri unten';
|
||||
$userdef[$sortnumber]['semshort']='';
|
||||
$userdef[$sortnumber]['imagemax']=725;
|
||||
$userdef[$sortnumber]['imagemay']=52;
|
||||
$userdef[$sortnumber]['maxcount']=575;
|
||||
$userdef[$sortnumber]['XcorrectMainText']=25;
|
||||
$userdef[$sortnumber]['logrotatelines']=500;
|
||||
##########################
|
||||
#$sortnumber=3;
|
||||
#$userdef[$sortnumber]['name']='water';
|
||||
#$userdef[$sortnumber]['valuefield']=4;
|
||||
#$userdef[$sortnumber]['gnuplottype']='temperature';
|
||||
#$userdef[$sortnumber]['logpath']='/mnt/fhz/t_arv.log';
|
||||
##$userdef[$sortnumber]['logpath']='/mnt/fhz/allight.log';
|
||||
#$userdef[$sortnumber]['room']='Hautpg';
|
||||
#$userdef[$sortnumber]['semlong']='tARV';
|
||||
#$userdef[$sortnumber]['semshort']='°C';
|
||||
#$userdef[$sortnumber]['imagemax']=725;
|
||||
#$userdef[$sortnumber]['imagemay']=52;
|
||||
##$userdef[$sortnumber]['maxcount']=575;
|
||||
#$userdef[$sortnumber]['XcorrectMainText']=25;
|
||||
#$userdef[$sortnumber]['logrotatelines']=2200;
|
||||
|
||||
|
||||
|
||||
|
||||
# example:
|
||||
#define rolu1.log FileLog /var/tmp/rolu1.log rolu1:.*(on|off|dimup|dimdown).*
|
||||
#$sortnumber=5;
|
||||
#$userdef[$sortnumber]['name']='FS10';
|
||||
#$userdef[$sortnumber]['valuefield']=2;
|
||||
#$userdef[$sortnumber]['gnuplottype']='temperature';
|
||||
#$userdef[$sortnumber]['logpath']='/var/tmp/wspd_7.gnu';
|
||||
#$userdef[$sortnumber]['timeformat']='%Y/%m/%d %H:%M:%S';
|
||||
#$userdef[$sortnumber]['room']='hidden';
|
||||
#$userdef[$sortnumber]['semlong']='FS10';
|
||||
#$userdef[$sortnumber]['semshort']='°C';
|
||||
#$userdef[$sortnumber]['logpath']='/var/tmp/water.log';
|
||||
#$userdef[$sortnumber]['room']='cellar';
|
||||
#$userdef[$sortnumber]['semlong']='Water';
|
||||
#$userdef[$sortnumber]['semshort']='C';
|
||||
#$userdef[$sortnumber]['imagemax']=725;
|
||||
#$userdef[$sortnumber]['imagemay']=52;
|
||||
#$userdef[$sortnumber]['maxcount']=575;
|
||||
#$userdef[$sortnumber]['XcorrectMainText']=25;
|
||||
#$userdef[$sortnumber]['logrotatelines']=3300;
|
||||
#################
|
||||
## Userdef: x
|
||||
#
|
||||
#$userdef[x]['name']='';
|
||||
#........
|
||||
#$userdef[$sortnumber]['logrotatelines']=2000;
|
||||
|
||||
|
||||
|
||||
@ -348,16 +336,18 @@ $userdef[$sortnumber]['logrotatelines']=30;
|
||||
$showAT='no'; #show the AT_JOBS at startup. Default: yes Values: yes/no
|
||||
$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
|
||||
$showPICS='no'; #if shwowebcam=1 then initial the Pics will be shown. Default: yes
|
||||
#$showPICS='no'; #if shwowebcam=1 then initial the Pics will be shown. Default: yes
|
||||
$showPICS='yes'; #if shwowebcam=1 then initial the Pics will be shown. Default: yes
|
||||
$showWeath='yes'; # Show weather on startup? $enableweather must 1
|
||||
|
||||
$RSStitel='FHEM :-)';
|
||||
$RSStitel='FHEM';
|
||||
|
||||
$urlreload=90; # Automatic reloading page [sec]. Default fast: 60 slow:90
|
||||
$urlreload=60; # 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"; # English
|
||||
$timeformat="d.m.Y H:i:s"; # German
|
||||
$winsize=800; # width of the pgm3
|
||||
#$winsize="100%"; # width of the pgm3
|
||||
|
||||
|
||||
|
||||
@ -377,6 +367,7 @@ $userdef[$sortnumber]['logrotatelines']=30;
|
||||
# You must delete the old graphics after the change. "rm <pgm3>/tmp/*"
|
||||
$buttonBg_R='175';$buttonBg_G='198';$buttonBg_B='219';
|
||||
$bg1_R='110';$bg1_G='148';$bg1_B='181';
|
||||
|
||||
##########################
|
||||
##ORANGE
|
||||
#$bodybg="bgcolor='#FFDAB9'";
|
||||
|
16
fhem/webfrontend/pgm3/include/dblog.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
##DB-Functions for pgm3
|
||||
|
||||
include "config.php";
|
||||
|
||||
|
||||
|
||||
### If DB-query is used, this is the only point of connect. ###
|
||||
if ($DBUse=="1") {
|
||||
@mysql_connect($DBNode, $DBUser, $DBPass) or die("Can't connect");
|
||||
@mysql_select_db($DBName) or die("No database found");
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -9,8 +9,12 @@ include "../config.php";
|
||||
$drawfs20=$_GET['drawfs20'];
|
||||
$statefs20=$_GET['statefs20'];
|
||||
$datefs20=$_GET['datefs20'];
|
||||
$icon=$_GET['icon'];
|
||||
$emap=$_GET['emap'];
|
||||
$subType=$_GET['subType'];
|
||||
$room=$_GET['room'];
|
||||
|
||||
$img_path=$AbsolutPath."/include/img/";
|
||||
|
||||
## do we really need a new graphic??
|
||||
#$execorder=$tailpath.' -1 '.$file;
|
||||
@ -36,10 +40,6 @@ include "../config.php";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$im = ImageCreateTrueColor($imgmaxxfs20,$imgmaxyfs20);
|
||||
$black = ImageColorAllocate($im, 0, 0, 0);
|
||||
$bg1p = ImageColorAllocate($im, $bg1_R,$bg1_G,$bg1_B);
|
||||
@ -56,63 +56,103 @@ include "../config.php";
|
||||
ImageFill($im, 0, 0, $bg2p);
|
||||
ImageRectangle($im, 0, 0, $imgmaxxfs20-1, $imgmaxyfs20-1, $white);
|
||||
|
||||
if ((rtrim($statefs20)=="on" ) or (rtrim($statefs20)=="dimup") or (rtrim($statefs20)=="thermo-on"))
|
||||
{
|
||||
$im2 = ImageCreateFromGIF("FS20.on.gif");
|
||||
$datefs20sep=explode(" ",$datefs20);
|
||||
$statefs20sep=explode(" ",$statefs20);
|
||||
|
||||
if (($icon!='')) {
|
||||
if ((substr($statefs20sep[0],0,3)=='dim')) {
|
||||
$statefs20tmp = 'on';
|
||||
}
|
||||
else
|
||||
{
|
||||
$im2 = ImageCreateFromGIF("FS20.off.gif");
|
||||
};
|
||||
else {
|
||||
$statefs20tmp = $statefs20sep[0];
|
||||
}
|
||||
$im2 = ImageCreateFromPNG($img_path.$icon.".".$statefs20tmp.".png");
|
||||
}
|
||||
else {
|
||||
$im2 = ImageCreateFromPNG($img_path.$statefs20sep[0].".png");
|
||||
}
|
||||
|
||||
$w = imagesx($im2);
|
||||
$h = imagesy($im2);
|
||||
|
||||
$datefs20sep=explode(" ",$datefs20);
|
||||
if ((substr($statefs20,0,12)=="on-for-timer" )
|
||||
or
|
||||
($statefs20=="toggle"))
|
||||
{
|
||||
$im2 = ImageCreateFromGIF("FS20.on.gif");
|
||||
$im3 = ImageCreateFromGIF("FS20.off.gif");
|
||||
Imagecopy($im,$im3,($imgmaxxfs20/2)-12,($imgmaxyfs20/2)-14,0,0,$w,$h);
|
||||
Imagecopy($im,$im2,($imgmaxxfs20/2)-2,($imgmaxyfs20/2)-14,0,0,$w,$h);
|
||||
if ($roomname=='0') {
|
||||
$roomc=$roomcorr;
|
||||
}
|
||||
else
|
||||
{
|
||||
Imagecopy($im,$im2,($imgmaxxfs20/2)-8,($imgmaxyfs20/2)-14,0,0,$w,$h);
|
||||
};
|
||||
else {
|
||||
$roomc='0';
|
||||
}
|
||||
|
||||
Imagecopy($im,$im2,($imgmaxxfs20/2)-20,($imgmaxyfs20/2)-7-$roomc,0,0,$w,$h);
|
||||
|
||||
|
||||
$datefs20sep_1=explode(" ",$datefs20);
|
||||
if (($dategerman == '1')) {
|
||||
$datefs20_tmp_1 = $datefs20sep_1[0];
|
||||
$datefs20sep_2=explode("-",$datefs20_tmp_1);
|
||||
$date_button = $datefs20sep_2[2].".".$datefs20sep_2[1].".".$datefs20sep_2[0];
|
||||
}
|
||||
else {
|
||||
$date_button = $datefs20sep_1[0];
|
||||
}
|
||||
$time_button = $datefs20sep_1[1];
|
||||
|
||||
|
||||
if ($namesortbutton == '1') {
|
||||
$pos_1 = strpos($drawfs20,$namesortbuttonsign);
|
||||
if ($pos_1 > 0) {
|
||||
$drawfs20=substr($drawfs20,$pos_1+1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($namereplacebutton == '1') {
|
||||
$drawfs20=str_replace($namereplacebuttonsign, " ", $drawfs20);
|
||||
}
|
||||
|
||||
|
||||
|
||||
###ttf
|
||||
|
||||
$txtcolor=$bg3p;
|
||||
if ($emap=='') {
|
||||
$text=$statefs20;
|
||||
}
|
||||
else {
|
||||
$text=$emap;
|
||||
}
|
||||
|
||||
$txtcolor=$bg3p;
|
||||
$fontsize=7;
|
||||
$box = @imageTTFBbox($fontsize,0, $fontttfb,$text);
|
||||
$textwidth = abs($box[4] - $box[0]);
|
||||
$textheight = abs($box[5] - $box[1]);
|
||||
$xcord = ($imgmaxxfs20/2)-($textwidth/2)-2;
|
||||
$ycord = ($imgmaxyfs20/2)+20;
|
||||
$ycord = ($imgmaxyfs20/2)+23;
|
||||
ImageTTFText ($im, $fontsize, 0, $xcord, $ycord, $txtcolor, $fontttfb, $text);
|
||||
|
||||
$text=$datefs20sep[0];
|
||||
$text=$date_button;
|
||||
$box = @imageTTFBbox($fontsize,0, $fontttf,$text);
|
||||
$textwidth = abs($box[4] - $box[0]);
|
||||
$textheight = abs($box[5] - $box[1]);
|
||||
$xcord = ($imgmaxxfs20/2)-($textwidth/2)-2;
|
||||
$ycord = ($imgmaxyfs20/2)+30;
|
||||
#$xcord = ($imgmaxxfs20/2)-($textwidth/2)+53;
|
||||
$xcord = ($imgmaxxfs20)-($textwidth)-2;
|
||||
$ycord = ($imgmaxyfs20/2)+33;
|
||||
ImageTTFText ($im, $fontsize, 0, $xcord, $ycord, $txtcolor, $fontttf, $text);
|
||||
|
||||
$text=$datefs20sep[1];
|
||||
$text=$time_button;
|
||||
$box = @imageTTFBbox($fontsize,0, $fontttf,$text);
|
||||
$textwidth = abs($box[4] - $box[0]);
|
||||
$textheight = abs($box[5] - $box[1]);
|
||||
$xcord = ($imgmaxxfs20/2)-($textwidth/2)-2;
|
||||
$ycord = ($imgmaxyfs20/2)+40;
|
||||
#$xcord = ($imgmaxxfs20/2)-($textwidth/2)-58;
|
||||
$xcord = 3;
|
||||
$ycord = ($imgmaxyfs20/2)+33;
|
||||
ImageTTFText ($im, $fontsize, 0, $xcord, $ycord, $txtcolor, $fontttf, $text);
|
||||
|
||||
$txtcolor=$bg3p;
|
||||
|
||||
|
||||
ImageTTFText ($im, $fs20fontsizetitel, 0, 5, 15, $txtcolor, $fontttfb, $drawfs20);
|
||||
if ($room != '') {ImageTTFText ($im, 7, 0, 5, 26, $txtcolor, $fontttf, $txtroom.$room);};
|
||||
if ($room != '' and $roomname=='1') {
|
||||
ImageTTFText ($im, 7, 0, 5, 26, $txtcolor, $fontttf, $txtroom.$room);
|
||||
};
|
||||
|
||||
|
||||
imagePng($im,$savefile);
|
||||
|
@ -66,15 +66,73 @@
|
||||
echo "<option>$orders[$m]</option>";
|
||||
}
|
||||
};
|
||||
|
||||
function mknullfs20($zahl,$stellen) {
|
||||
for($i=strlen($zahl);$i<$stellen;$i++){
|
||||
$zahl="0" . $zahl;
|
||||
}
|
||||
return $zahl;
|
||||
}
|
||||
|
||||
echo "</select>
|
||||
<select name=valuetime size=1>
|
||||
<select name=valuetime size=1> ### <------ valuetime muß eindeutig werden !!!
|
||||
<option></option>";
|
||||
for ($m=0; $m < 6000; $m++)
|
||||
{if ( $m > 20) $m = $m+4;
|
||||
if ( $m > 60) $m = $m+55;
|
||||
echo "<option>$m</option>";}
|
||||
echo "<option value=0>HH:MM:SS:MS</option>";
|
||||
echo "<option value=0>00:00:00:00</option>";
|
||||
echo "<option value=0.25>00:00:00:25</option>";
|
||||
echo "<option value=0.5>00:00:00:50</option>";
|
||||
echo "<option value=0.75>00:00:00:75</option>";
|
||||
echo "<option value=1>00:00:01:00</option>";
|
||||
echo "<option value=1.25>00:00:01:25</option>";
|
||||
echo "<option value=1.5>00:00:01:50</option>";
|
||||
echo "<option value=1.75>00:00:01:75</option>";
|
||||
echo "<option value=2>00:00:02:00</option>";
|
||||
echo "<option value=2.25>00:00:02:25</option>";
|
||||
echo "<option value=2.5>00:00:02:50</option>";
|
||||
echo "<option value=2.75>00:00:02:75</option>";
|
||||
echo "<option value=3>00:00:03:00</option>";
|
||||
echo "<option value=3.25>00:00:03:25</option>";
|
||||
echo "<option value=3.5>00:00:03:50</option>";
|
||||
echo "<option value=3.75>00:00:03:75</option>";
|
||||
echo "<option value=4>00:00:04:00</option>";
|
||||
echo "<option value=4.5>00:00:04:50</option>";
|
||||
echo "<option value=5>00:00:05:00</option>";
|
||||
echo "<option value=5.5>00:00:05:50</option>";
|
||||
echo "<option value=6>00:00:06:00</option>";
|
||||
echo "<option value=6.5>00:00:06:50</option>";
|
||||
echo "<option value=7>00:00:07:00</option>";
|
||||
echo "<option value=7.5>00:00:07:50</option>";
|
||||
for ($m=8; $m < 15360; $m++) {
|
||||
if ( $m > 16) $m = $m+1;
|
||||
if ( $m > 32) $m = $m+2;
|
||||
if ( $m > 64) $m = $m+4;
|
||||
if ( $m > 128) $m = $m+8;
|
||||
if ( $m > 256) $m = $m+16;
|
||||
if ( $m > 512) $m = $m+32;
|
||||
if ( $m > 1024) $m = $m+64;
|
||||
if ( $m > 2048) $m = $m+128;
|
||||
if ( $m > 4096) $m = $m+256;
|
||||
if ( $m > 8192) $m = $m+512;
|
||||
if ( $m > 7)
|
||||
$sek=$m;
|
||||
$std=floor($sek/3600);
|
||||
$min=floor(($sek-$std*3600)/60);
|
||||
$sec=$sek-$std*3600-$min*60;
|
||||
$std=mknullfs20($std,2);
|
||||
$min=mknullfs20($min,2);
|
||||
$sec=mknullfs20($sec,2);
|
||||
echo "<option value=$m>$std:$min:$sec</option>";}
|
||||
|
||||
echo"</select>
|
||||
<input type=submit value='go!'></form></td></tr>";
|
||||
|
||||
# <select name=valuetime size=1>
|
||||
# <option></option>";
|
||||
# for ($m=0; $m < 6000; $m++)
|
||||
# {if ( $m > 20) $m = $m+4;
|
||||
# if ( $m > 60) $m = $m+55;
|
||||
# echo "<option>$m</option>";}
|
||||
#
|
||||
# echo"</select>
|
||||
|
||||
?>
|
||||
|
@ -51,7 +51,7 @@ function drawgnuplot($gnudraw,$gnutyp,$gnuplot,$pictype,$logpath,$FHTyrange,$FHT
|
||||
$OUT2="set output 'tmp/$gnudraw1.$pictype'";
|
||||
|
||||
$gplothdr="
|
||||
set terminal $pictype
|
||||
set terminal $pictype crop
|
||||
set xdata time
|
||||
set timefmt '%Y-%m-%d_%H:%M:%S'
|
||||
set xlabel ' '
|
||||
|
131
fhem/webfrontend/pgm3/include/hmpulldown.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
##Pulldown for HomeMatic-Devices
|
||||
|
||||
|
||||
$order1=array("on","off","toggle","on-for-timer");
|
||||
$order2=range(0, 100, 1);
|
||||
$order3=array("pair","unpair","statusRequest","sign","raw","reset");
|
||||
$order8=array("-- Dim in % --");
|
||||
$order9=array("---------------");
|
||||
$orders=array_merge($order1, $order9, $order8, $order2, $order9, $order3);
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td colspan=1 align=right $bg2><font $fontcolor3>HomeMatic: </font></td><td align=left $bg2><font $fontcolor3>
|
||||
<form action=$forwardurl method='POST'>
|
||||
<input type=hidden name=showfht value=$showfht>
|
||||
<input type=hidden name=showhms value=$showhms>
|
||||
<input type=hidden name=showmenu value=$showmenu>
|
||||
<input type=hidden name=Action value=exec4>
|
||||
|
||||
<select name=atorder size=1>
|
||||
<option></option>;
|
||||
<option>at</option></select>
|
||||
|
||||
<select name=attime size=1>
|
||||
<option></option>;";
|
||||
for ($m=0; $m < 24; $m++)
|
||||
{
|
||||
if ( $m < 10) $m = '0'.$m;
|
||||
for ($k=0; $k < 60; $k=$k+2)
|
||||
{
|
||||
if ( $k < 10) $k = '0'.$k;
|
||||
echo "<option>$m:$k:00</option>";
|
||||
}
|
||||
}
|
||||
|
||||
echo"</select>";
|
||||
|
||||
|
||||
|
||||
|
||||
echo"
|
||||
set
|
||||
<select name=culhmdev size=1>
|
||||
<option></option>";
|
||||
for ($m=0; $m < count($culhmdevs); $m++)
|
||||
{
|
||||
echo $culhmdev;
|
||||
if ($culhmdev==$culhmdevs[$m])
|
||||
{
|
||||
echo "<option selected>$culhmdevs[$m]</option>";
|
||||
} else {
|
||||
echo "<option>$culhmdevs[$m]</option>";
|
||||
}
|
||||
};
|
||||
|
||||
echo "
|
||||
</select><select name=orderpulldown size=1>
|
||||
<option></option>";
|
||||
|
||||
for ($m=0; $m < count($orders); $m++)
|
||||
{
|
||||
if ($orderpulldown==$orders[$m])
|
||||
{
|
||||
echo "<option selected>$orders[$m]</option>";
|
||||
} else {
|
||||
echo "<option>$orders[$m]</option>";
|
||||
}
|
||||
};
|
||||
|
||||
function mknullhm($zahl,$stellen) {
|
||||
for($i=strlen($zahl);$i<$stellen;$i++){
|
||||
$zahl="0" . $zahl;
|
||||
}
|
||||
return $zahl;
|
||||
}
|
||||
|
||||
echo "</select>
|
||||
<select name=valuetime size=1> ### <------ valuetime muß eindeutig werden !!!
|
||||
<option></option>";
|
||||
echo "<option value=0>HH:MM:SS:MS</option>";
|
||||
echo "<option value=0>00:00:00:00</option>";
|
||||
echo "<option value=0.25>00:00:00:25</option>";
|
||||
echo "<option value=0.5>00:00:00:50</option>";
|
||||
echo "<option value=0.75>00:00:00:75</option>";
|
||||
echo "<option value=1>00:00:01:00</option>";
|
||||
echo "<option value=1.25>00:00:01:25</option>";
|
||||
echo "<option value=1.5>00:00:01:50</option>";
|
||||
echo "<option value=1.75>00:00:01:75</option>";
|
||||
echo "<option value=2>00:00:02:00</option>";
|
||||
echo "<option value=2.25>00:00:02:25</option>";
|
||||
echo "<option value=2.5>00:00:02:50</option>";
|
||||
echo "<option value=2.75>00:00:02:75</option>";
|
||||
echo "<option value=3>00:00:03:00</option>";
|
||||
echo "<option value=3.25>00:00:03:25</option>";
|
||||
echo "<option value=3.5>00:00:03:50</option>";
|
||||
echo "<option value=3.75>00:00:03:75</option>";
|
||||
echo "<option value=4>00:00:04:00</option>";
|
||||
echo "<option value=4.5>00:00:04:50</option>";
|
||||
echo "<option value=5>00:00:05:00</option>";
|
||||
echo "<option value=5.5>00:00:05:50</option>";
|
||||
echo "<option value=6>00:00:06:00</option>";
|
||||
echo "<option value=6.5>00:00:06:50</option>";
|
||||
echo "<option value=7>00:00:07:00</option>";
|
||||
echo "<option value=7.5>00:00:07:50</option>";
|
||||
for ($m=8; $m < 15360; $m++) {
|
||||
if ( $m > 16) $m = $m+1;
|
||||
if ( $m > 32) $m = $m+2;
|
||||
if ( $m > 64) $m = $m+4;
|
||||
if ( $m > 128) $m = $m+8;
|
||||
if ( $m > 256) $m = $m+16;
|
||||
if ( $m > 512) $m = $m+32;
|
||||
if ( $m > 1024) $m = $m+64;
|
||||
if ( $m > 2048) $m = $m+128;
|
||||
if ( $m > 4096) $m = $m+256;
|
||||
if ( $m > 8192) $m = $m+512;
|
||||
if ( $m > 7)
|
||||
$sek=$m;
|
||||
$std=floor($sek/3600);
|
||||
$min=floor(($sek-$std*3600)/60);
|
||||
$sec=$sek-$std*3600-$min*60;
|
||||
$std=mknullhm($std,2);
|
||||
$min=mknullhm($min,2);
|
||||
$sec=mknullhm($sec,2);
|
||||
echo "<option value=$m>$std:$min:$sec</option>";}
|
||||
|
||||
echo"</select>
|
||||
<input type=submit value='go!'></form></td></tr>";
|
||||
|
||||
?>
|
BIN
fhem/webfrontend/pgm3/include/img/FS20.off.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
fhem/webfrontend/pgm3/include/img/FS20.on.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim06%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim100%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim12%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim18%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim25%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim31%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim37%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim43%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim50%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim56%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim62%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim68%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim75%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim81%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim87%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dim93%.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dimdown.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
fhem/webfrontend/pgm3/include/img/dimup.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
fhem/webfrontend/pgm3/include/img/off-for-timer.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
fhem/webfrontend/pgm3/include/img/off.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
fhem/webfrontend/pgm3/include/img/on-for-timer.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
fhem/webfrontend/pgm3/include/img/on-till.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
fhem/webfrontend/pgm3/include/img/on.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
fhem/webfrontend/pgm3/include/img/switch.off.png
Normal file
After Width: | Height: | Size: 427 B |
BIN
fhem/webfrontend/pgm3/include/img/switch.on.png
Normal file
After Width: | Height: | Size: 430 B |
BIN
fhem/webfrontend/pgm3/include/img/switch_gn.off-for-timer.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
fhem/webfrontend/pgm3/include/img/switch_gn.off.png
Normal file
After Width: | Height: | Size: 359 B |
BIN
fhem/webfrontend/pgm3/include/img/switch_gn.on-for-timer.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
fhem/webfrontend/pgm3/include/img/switch_gn.on.png
Normal file
After Width: | Height: | Size: 355 B |
BIN
fhem/webfrontend/pgm3/include/img/switch_rt.off-for-timer.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
fhem/webfrontend/pgm3/include/img/switch_rt.off.png
Normal file
After Width: | Height: | Size: 359 B |
BIN
fhem/webfrontend/pgm3/include/img/switch_rt.on.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
fhem/webfrontend/pgm3/include/img/toggle.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright notice
|
||||
#
|
||||
# (c) 2006-2012 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='120503';
|
||||
$pgm3version='120508';
|
||||
|
||||
|
||||
|
||||
@ -64,8 +64,11 @@ $pgm3version='120503';
|
||||
|
||||
$fhtdev = $_POST['fhtdev'];
|
||||
$fs20dev = $_POST['fs20dev'];
|
||||
$culhmdev = $_POST['culhmdev'];
|
||||
$errormessage = $_POST['errormessage'];
|
||||
|
||||
|
||||
|
||||
if (! isset($showrss)) $showrss=$_GET['showrss'];
|
||||
if (! isset($rssorder)) $rssorder=$_GET['rssorder'];
|
||||
if ($rssorder=="")
|
||||
@ -134,6 +137,9 @@ $pgm3version='120503';
|
||||
if (! isset($fs20dev)) $fs20dev=$_GET['fs20dev'];
|
||||
if ($fs20dev=="") unset($fs20dev);
|
||||
|
||||
if (! isset($culhmdev)) $culhmdev=$_GET['culhmdev'];
|
||||
if ($culhmdev=="") unset($culhmdev);
|
||||
|
||||
if (! isset($errormessage)) $errormessage=$_GET['errormessage'];
|
||||
if ($errormessage=="") unset($errormessage);
|
||||
|
||||
@ -161,6 +167,8 @@ $pgm3version='120503';
|
||||
if (isset ($showfht)) { $forwardurl=$forwardurl.'&showfht='.$showfht;};
|
||||
if (isset ($fs20dev))
|
||||
{ $forwardurl=$forwardurl.'&fs20dev='.$fs20dev.'&orderpulldown='.$orderpulldown.'&showmenu='.$showmenu.'&showroom='.$showroom.'&showweath'.$showweath;};
|
||||
if (isset ($culhmdev))
|
||||
{ $forwardurl=$forwardurl.'&culhmdev='.$culhmdev.'&orderpulldown='.$orderpulldown.'&showmenu='.$showmenu.'&showroom='.$showroom.'&showweath'.$showweath;};
|
||||
if (isset ($showks)) { $forwardurl=$forwardurl.'&showks='.$showks.'&kstyp='.$kstyp;};
|
||||
if (isset ($showhmsgnu)) { $forwardurl=$forwardurl.'&showhmsgnu='.$showhmsgnu;};
|
||||
if (isset ($showuserdefgnu)) { $forwardurl=$forwardurl.'&showuserdefgnu='.$showuserdefgnu;};
|
||||
@ -171,6 +179,7 @@ $pgm3version='120503';
|
||||
if (isset ($showpics)) { $forwardurl=$forwardurl.'&showpics';};
|
||||
if (isset ($showhist)) { $forwardurl=$forwardurl.'&showhist';};
|
||||
if (isset ($showfs20)) { $forwardurl=$forwardurl.'&showfs20='.$showfs20;};
|
||||
if (isset ($showculhm)) { $forwardurl=$forwardurl.'&showculhm='.$showculhm;};
|
||||
if (isset ($showweath)) { $forwardurl=$forwardurl.'&showweath='.$showweath;};
|
||||
if (isset ($showmenu))
|
||||
{ $forwardurl=$forwardurl.'&fs20dev='.$fs20dev.'&orderpulldown='.$orderpulldown.'&valuetime='.$valuetime.'&showmenu='.$showmenu.'&showroom='.$showroom;}
|
||||
@ -210,6 +219,12 @@ switch ($Action):
|
||||
if (! isset($fhtdev)) {echo "FHT-Device not set - exit"; break;}
|
||||
$order="$atorder $attime set $fhtdev $orderpulldown $valuetime";
|
||||
if ($kioskmode=='off') execFHZ($order,$fhem,$fhemport);
|
||||
Case exec4:
|
||||
if ($atorder=='at')
|
||||
{ $atorder='define '.randdefine().' '.$atorder; }
|
||||
$order="$atorder $attime set $culhmdev $orderpulldown $valuetime";
|
||||
if ($kioskmode=='off') execFHZ($order,$fhem,$fhemport);
|
||||
header("Location: $forwardurl");
|
||||
Case execfht:
|
||||
$order="set $dofht desired-temp $temp";
|
||||
if ($kioskmode=='off') execFHZ($order,$fhem,$fhemport);
|
||||
@ -225,10 +240,7 @@ endswitch;
|
||||
if (! isset($showroom)) $showroom="ALL";
|
||||
if (($taillog==1) and (isset ($showhist)) ) exec($taillogorder,$tailoutput);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################################
|
||||
#executes over the network to the fhem.pl (or localhost)
|
||||
function execFHZ($order,$machine,$port)
|
||||
{
|
||||
@ -243,14 +255,11 @@ global $errormessage;
|
||||
$errormessage= fgets($fp);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
return $errormessage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
###### make an array from the xmllist
|
||||
unset($output);
|
||||
$stack = array();
|
||||
@ -260,7 +269,7 @@ unset($longxml);
|
||||
$version = explode('.', phpversion());
|
||||
|
||||
|
||||
################################################################################
|
||||
######################################################################
|
||||
# get the xmllist from fhem
|
||||
$fp = stream_socket_client("tcp://$fhem:$fhemport", $errno, $errstr, 30);
|
||||
if (!$fp) {
|
||||
@ -270,13 +279,14 @@ $version = explode('.', phpversion());
|
||||
$outputvar=stream_get_contents($fp);
|
||||
array_push($output,$outputvar);
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# start_element_handler ( resource parser, string name, array attribs )
|
||||
function startElement($parser, $name, $attribs)
|
||||
{
|
||||
@ -314,6 +324,7 @@ if (!(list($xml_parser, $live) = new_xml_parser($live))) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
#change the xmllist into an intern array
|
||||
foreach($output as $data) {
|
||||
if (!xml_parse($xml_parser, $data)) {
|
||||
@ -329,19 +340,26 @@ foreach($output as $data) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
xml_parser_free($xml_parser);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#print_r($stack);
|
||||
#exit;
|
||||
|
||||
|
||||
|
||||
#searching for rooms/fs20/Logpaths
|
||||
#searching for rooms/fs20/HomeMatic/Logpaths
|
||||
$rooms=array();
|
||||
$fs20devs=array();
|
||||
$culhmdevs=array();
|
||||
$fhtdevs=array();
|
||||
$logpaths=array();
|
||||
|
||||
for($i=0; $i < count($stack[0][children]); $i++)
|
||||
{
|
||||
if ((substr($stack[0][children][$i][name],0,5)=='FS20_')
|
||||
@ -352,21 +370,46 @@ xml_parser_free($xml_parser);
|
||||
$fs20devxml=$stack[0][children][$i][children][$j][attrs][name];
|
||||
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='ATTR')
|
||||
{
|
||||
#$check=$stack[0][children][$i][children][$j][children][$k][attrs][name];
|
||||
# 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 (! in_array($room,$rooms)) array_push($rooms,$room);
|
||||
}
|
||||
}
|
||||
#}#
|
||||
}
|
||||
if ((! in_array($fs20devxml,$fs20devs)) AND ( $room != 'hidden')) array_push($fs20devs,$fs20devxml);
|
||||
}
|
||||
}#FS20
|
||||
|
||||
|
||||
|
||||
#################################################### HomeMatic
|
||||
|
||||
elseif ((substr($stack[0][children][$i][name],0,7)=='CUL_HM_'))
|
||||
{
|
||||
for($j=0; $j < count($stack[0][children][$i][children]); $j++)
|
||||
{
|
||||
$culhmdevxml=$stack[0][children][$i][children][$j][attrs][name];
|
||||
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='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 (! in_array($room,$rooms)) array_push($rooms,$room);
|
||||
}
|
||||
#}#
|
||||
}
|
||||
if ((! in_array($culhmdevxml,$culhmdevs)) AND ( $room != 'hidden')) array_push($culhmdevs,$culhmdevxml);
|
||||
}
|
||||
}#HomeMatic
|
||||
|
||||
|
||||
#################################################### FHTs
|
||||
|
||||
|
||||
@ -474,15 +517,15 @@ xml_parser_free($xml_parser);
|
||||
{
|
||||
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='ATTR')
|
||||
{
|
||||
# $check=$stack[0][children][$i][children][$j][children][$k][attrs][name];
|
||||
#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 (! in_array($room,$rooms)) array_push($rooms,$room);
|
||||
}
|
||||
}
|
||||
# }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -505,7 +548,9 @@ xml_parser_free($xml_parser);
|
||||
|
||||
|
||||
#print_r($rooms); echo "Count: $countrooms"; exit;
|
||||
#print_r($fs20devs); exit;
|
||||
#print_r($fs20devs); # exit;
|
||||
#echo "#################################";
|
||||
#print_r($culhmdevs); exit;
|
||||
#echo count($stack[0][children]);exit;
|
||||
#print_r($logpaths); exit;
|
||||
#exit;
|
||||
@ -550,8 +595,7 @@ xml_parser_free($xml_parser);
|
||||
<tr> <td>
|
||||
\r<table width='100%' cellspacing='2' cellpadding='2' align=center border='0'>
|
||||
<tr><td $bg1 colspan=4><br>
|
||||
<font size=+1 $fontcolor1><center><b>$titel</b></font>
|
||||
<font size=3 $fontcolor1><br><b>$now</b>
|
||||
<font size=3 $fontcolor1><center><b>$titel $now</b></font>
|
||||
</font></center>
|
||||
<font size=-2 $fontcolor1><div align='right'>v$pgm3version</div></font>
|
||||
</td></tr>";
|
||||
@ -590,7 +634,6 @@ xml_parser_free($xml_parser);
|
||||
{
|
||||
$webcamname=str_replace("/","",$webcam1);
|
||||
$webcamname=str_replace(":","",$webcamname);
|
||||
# $order="$wgetpath -O tmp/$webcamname $webcam1; /usr/bin/touch tmp/$webcamname";
|
||||
$order="$wgetpath -O tmp/$webcamname $webcam1";
|
||||
exec($order,$res);
|
||||
$errormessage = $res[0];
|
||||
@ -631,9 +674,8 @@ xml_parser_free($xml_parser);
|
||||
|
||||
|
||||
|
||||
|
||||
############################ FHZ
|
||||
if ($show_fs20pulldown==1 or $show_general==1 or $show_fhtpulldown==1)
|
||||
if ($show_fs20pulldown==1 or $show_general==1 or $show_hmpulldown==1 or $show_fhtpulldown==1)
|
||||
{
|
||||
echo "<tr><td $bg1 colspan=4><font $fontcolor1>\r<table cellspacing='0' cellpadding='0' width='100%'>
|
||||
<tr><td><font $fontcolor1>FHZ_DEVICE</td><td align=right><font $fontcolor1><b>";
|
||||
@ -655,7 +697,7 @@ xml_parser_free($xml_parser);
|
||||
<td colspan=1 align=right $bg2><font $fontcolor3> General: </font></td>
|
||||
<td align=left $bg2 colspan=1><font $fontcolor3>
|
||||
<form action=$forwardurl method='POST'>
|
||||
<input type=text name=order size=30>
|
||||
<input type=text name=order size=61>
|
||||
<input type=hidden name=showfht value=$showfht>
|
||||
<input type=hidden name=showhms value=$showhms>
|
||||
<input type=hidden name=showmenu value=$showmenu>
|
||||
@ -665,14 +707,13 @@ xml_parser_free($xml_parser);
|
||||
};
|
||||
|
||||
if ($show_fs20pulldown=='1') include 'include/fs20pulldown.php';
|
||||
if ($show_hmpulldown=='1') include 'include/hmpulldown.php';
|
||||
if ($show_fhtpulldown=='1') include 'include/fhtpulldown.php';
|
||||
if ($show_logpulldown=='1') include 'include/logpulldown.php';
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
############################ ROOMS
|
||||
if (($showroombuttons==1) and (count($rooms)>1))
|
||||
{
|
||||
@ -702,17 +743,16 @@ ht><font $fontcolor1><b>
|
||||
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
## now the xmllist will be writen on screen as html
|
||||
##### Let's go.... :-)))))
|
||||
for($i=0; $i < count($stack[0][children]); $i++)
|
||||
{
|
||||
############################
|
||||
if ((substr($stack[0][children][$i][name],0,5)=='FS20_') || (substr( $stack[0][children][$i][name],0,4)=='X10_'))
|
||||
if ((substr($stack[0][children][$i][name],0,5)=='FS20_')
|
||||
|| (substr( $stack[0][children][$i][name],0,4)=='X10_')
|
||||
|| (substr( $stack[0][children][$i][name],0,7)=='CUL_HM_'))
|
||||
{
|
||||
$type=$stack[0][children][$i][name];
|
||||
#echo "\r<tr><td $bg1 colspan=4><font $fontcolor1>";
|
||||
#echo "$type</font></td></tr>";
|
||||
echo "\r\r<tr><td $bg1 colspan=4><font $fontcolor1>
|
||||
\r\r<table cellspacing='0' cellpadding='0' width='100%'>
|
||||
<tr><td><font $fontcolor1>$type</td><td align=right><font $fontcolor1><b>
|
||||
@ -723,40 +763,116 @@ ht><font $fontcolor1><b>
|
||||
{
|
||||
$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')
|
||||
{
|
||||
$check=$stack[0][children][$i][children][$j][children][$k][name];
|
||||
switch ($check) {
|
||||
case 'STATE':
|
||||
$measured=$stack[0][children][$i][children][$j][children][$k][attrs][measured];
|
||||
break;
|
||||
}
|
||||
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];
|
||||
|
||||
|
||||
$check=$stack[0][children][$i][children][$j][children][$k][attrs][key];
|
||||
switch ($check) {
|
||||
case 'room':
|
||||
$room=$stack[0][children][$i][children][$j][children][$k][attrs][value];break;
|
||||
case 'webCmd':
|
||||
$wcmd=$stack[0][children][$i][children][$j][children][$k][attrs][value];break;
|
||||
case 'follow-on-for-timer':
|
||||
$foft=$stack[0][children][$i][children][$j][children][$k][attrs][value];break;
|
||||
case 'icon':
|
||||
$icon=$stack[0][children][$i][children][$j][children][$k][attrs][value];break;
|
||||
case 'eventMap':
|
||||
$eventMap=$stack[0][children][$i][children][$j][children][$k][attrs][value];break;
|
||||
case 'subType':
|
||||
$subType=$stack[0][children][$i][children][$j][children][$k][attrs][value];break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
If (($eventMap!='')) {
|
||||
If ((substr($eventMap,0,1)==',') or (substr($eventMap,0,1)=='/')) {
|
||||
$eMap_sign=(substr($eventMap,0,1));
|
||||
$eventMap=substr($eventMap,1);
|
||||
$eventMap=str_replace($eMap_sign, ":", $eventMap);
|
||||
}
|
||||
else {
|
||||
$eventMap=str_replace(" ", ":", $eventMap);
|
||||
}
|
||||
$eMapsep=explode(":",$eventMap);
|
||||
if ($state==$eMapsep[1]) {
|
||||
$state=$eMapsep[0];
|
||||
$emap=$eMapsep[1];
|
||||
}
|
||||
elseif ($state==$eMapsep[3]) {
|
||||
$state=$eMapsep[2];
|
||||
$emap=$eMapsep[3];
|
||||
}
|
||||
elseif ($state=='off') {
|
||||
$emap=$eMapsep[3];
|
||||
}
|
||||
elseif ($state!='off') {
|
||||
$emap=$eMapsep[1];
|
||||
}
|
||||
};
|
||||
|
||||
$tmp_file=$AbsolutPath."/tmp/FS20.".$fs20."_foft.txt";
|
||||
if (($state=='off') and (file_exists($tmp_file))) {
|
||||
$delfile2=$AbsolutPath."/tmp/FS20.".$fs20.".log.".$measured.".png";
|
||||
unlink ($tmp_file);
|
||||
unlink ($delfile2);
|
||||
}
|
||||
|
||||
if (($state=='off') and (substr($wcmd,0,12)=='on-for-timer')) {
|
||||
$wcmd_count = strpos($wcmd, ':',0);
|
||||
$wcmd_order = substr($wcmd, 0, $wcmd_count);
|
||||
$order="set $fs20 $wcmd_order";
|
||||
}
|
||||
elseif (($state!='off')) {
|
||||
$order="set $fs20 off";
|
||||
if ((substr($state,0,12)=='on-for-timer')) {
|
||||
if (file_exists($tmp_file))
|
||||
{}
|
||||
else{
|
||||
$x1=fopen ($tmp_file, "w");
|
||||
fwrite ($x1,$foft);
|
||||
fclose ($x1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (($state=='on') or ($state=='dimup'))
|
||||
{$order="set $fs20 off";}
|
||||
else
|
||||
{$order="set $fs20 on";};
|
||||
else {
|
||||
$order="set $fs20 on";
|
||||
};
|
||||
|
||||
|
||||
if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room))
|
||||
{
|
||||
$counter++;
|
||||
echo"<a href='$phpfileurl?Action=exec&order=$order&showroom=$showroom$link'><img src='include/fs20.php?drawfs20=$fs20&statefs20=$state&datefs20=$measured&room=$room'></a>";
|
||||
echo"<a href='$phpfileurl?Action=exec&order=$order&showroom=$showroom$link'><img src='include/fs20.php?drawfs20=$fs20&statefs20=$state&datefs20=$measured&icon=$icon&emap=$emap&subType=$subType&room=$room'></a>";
|
||||
if (fmod($counter,$fs20maxiconperline)== 0.0) echo "<br>";
|
||||
};
|
||||
# $fs20="";
|
||||
$state="";
|
||||
$check="";
|
||||
$measured="";
|
||||
$room="";
|
||||
$wcmd="";
|
||||
$foft="";
|
||||
$icon="";
|
||||
$eventMap="";
|
||||
$subType="";
|
||||
$emap="";
|
||||
}
|
||||
echo "</td></tr>\r";
|
||||
if (isset($showfs20) and $showgnuplot == 1)
|
||||
{
|
||||
drawgnuplot($showfs20,"FS20",$gnuplot,$pictype,$logpath, $FHTyrange,$FHTy2range,$DBUse);
|
||||
$FS20dev1=$showfs20.'1';
|
||||
echo "\r<tr><td colspan=5 align=center><img src='tmp/$showfs20.$pictype'><br>
|
||||
<img src='tmp/$FS20dev1.$pictype'>
|
||||
echo "\r<tr><td colspan=5 align=center><br><img src='tmp/$showfs20.$pictype'><br><br><br>
|
||||
<img src='tmp/$FS20dev1.$pictype'><br><br>
|
||||
</td></tr>
|
||||
<tr><td colspan=4><hr color='#AFC6DB'></td></tr>";
|
||||
}
|
||||
@ -821,8 +937,8 @@ ht><font $fontcolor1><b>
|
||||
{
|
||||
drawgnuplot($FHTdev,"FHT",$gnuplot,$pictype,$logpath, $FHTyrange,$FHTy2range,$DBUse);
|
||||
$FHTdev1=$FHTdev.'1';
|
||||
echo "\r<tr><td colspan=5 align=center><img src='tmp/$FHTdev.$pictype'><br>
|
||||
<img src='tmp/$FHTdev1.$pictype'>
|
||||
echo "\r<tr><td colspan=5 align=center><br><img src='tmp/$FHTdev.$pictype'><br><br><br>
|
||||
<img src='tmp/$FHTdev1.$pictype'><br><br>
|
||||
</td></tr>
|
||||
<tr><td colspan=4><hr color='#AFC6DB'></td></tr>";
|
||||
}
|
||||
@ -895,8 +1011,8 @@ ht><font $fontcolor1><b>
|
||||
if ($showhmsgnu == $HMSdev and $showgnuplot == 1)
|
||||
{ drawgnuplot($HMSdev,$type,$gnuplot,$pictype,$logpath,0,0,$DBUse);
|
||||
$HMSdev1=$HMSdev.'1';
|
||||
echo "\r<tr><td colspan=5 align=center><img src='tmp/$HMSdev.$pictype'><br>
|
||||
<img src='tmp/$HMSdev1.$pictype'>
|
||||
echo "\r<tr><td colspan=5 align=center><br><img src='tmp/$HMSdev.$pictype'><br><br><br>
|
||||
<img src='tmp/$HMSdev1.$pictype'><br><br>
|
||||
</td></tr>";
|
||||
}
|
||||
}
|
||||
@ -907,8 +1023,6 @@ ht><font $fontcolor1><b>
|
||||
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 "\r<tr><td $bg1 colspan=4><font $fontcolor1>";
|
||||
#echo "$type</font></td></tr>";
|
||||
echo "\r\r<tr><td $bg1 colspan=4><font $fontcolor1>
|
||||
\r\r<table cellspacing='0' cellpadding='0' width='100%'>
|
||||
<tr><td><font $fontcolor1>$type</td><td align=right><font $fontcolor1><b>
|
||||
@ -974,8 +1088,8 @@ ht><font $fontcolor1><b>
|
||||
drawgnuplot($KSdev,$drawtype."_t2",$gnuplot,$pictype,$logpath,0,0,$DBUse);
|
||||
}
|
||||
$KSdev1=$KSdev.'1';
|
||||
echo "\r<tr><td colspan=5 align=center><img src='tmp/$KSdev.$pictype'><br>
|
||||
<img src='tmp/$KSdev1.$pictype'>
|
||||
echo "\r<tr><td colspan=5 align=center><br><img src='tmp/$KSdev.$pictype'><br><br><br>
|
||||
<img src='tmp/$KSdev1.$pictype'><br><br>
|
||||
</td></tr>";
|
||||
}
|
||||
|
||||
@ -1108,8 +1222,8 @@ ht><font $fontcolor1><b>
|
||||
if ($showuserdefgnu == $UserDef and $showgnuplot == 1)
|
||||
{drawgnuplot($UserDef,$type,$gnuplot,$pictype,$logpath,$userdef[$i],$i,$DBUse);
|
||||
$UserDef1=$UserDef.'1';
|
||||
echo "\r<tr><td colspan=5 align=center><img src='tmp/$UserDef.$pictype'><br>
|
||||
<img src='tmp/$UserDef1.$pictype'>
|
||||
echo "\r<tr><td colspan=5 align=center><br><img src='tmp/$UserDef.$pictype'><br><br><br>
|
||||
<img src='tmp/$UserDef1.$pictype'><br><br>
|
||||
</td></tr>";
|
||||
}
|
||||
}# /not room hidden
|
||||
|