<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch |
| Pseudo-Script |
| =============================================================== |
| Info |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include __DIR__."/../include/psg.php";
$ver="V#V 4.80#";
$name="Wetter";
$gerarray=getGerInfo($name);
$luftdz=unserialize($gerarray["luftdz"]);
$info ="";
# 10%-Linien
for ($g=0;$g<=10;$g++) {
$l=$g*10+1;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(80,80,80);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.($l-4).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(1050-$g*10).'</div>';
}
# 5%-Linien
for ($g=0;$g<=9;$g++) {
$l=$g*10+6;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(60,60,60);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
# Markierung akt. Stunde
for ($z=0;$z<=23;$z++) {
$h=113;
$t=1;
$p=$z*20+5+30;
if ($z==$gerarray["zeith"]) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p-2).'px;background-color:rgb(80,80,80);border-style:solid;border-color:rgb(80,80,80);font-size:8px;width:19px;height:'.$h.'px"></div>';
}
}
# hPa-Säulen
for ($z=0;$z<=23;$z++) {
$h=$luftdz[$z]["max"]-$luftdz[$z]["min"];
$h0=($luftdz[$z]["max"]-950);
$t=100+1-($luftdz[$z]["max"]-950);
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=50+7;}
$ld=(1050-$luftdz[$z]["max"])/2;
$fr=intval((50-$ld)+$f0);
$fg=intval($f0);
$fb=intval(($ld)+$f0+13);
if (isset($luftdz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($fr/1).','.($fg/1).','.($fb/1).');border-style:solid;border-color:rgb('.($fr/1).','.($fg/1).','.($fb/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
}
# Rest
for ($z=0;$z<=23;$z++) {
if ($z<=$gerarray["zeith"]) {
if ($luftdz[$z]["min"]<$luftdz[24]["min"] or !isset($luftdz[24]["min"])) {
if (isset($luftdz[$z]["min"])) {
$luftdz[24]["min"]=$luftdz[$z]["min"];
$luftdz[24]["minh"]=$z;
}
}
if ($luftdz[$z]["max"]>$luftdz[24]["max"] or !isset($luftdz[24]["max"])) {
if (isset($luftdz[$z]["max"])) {
$luftdz[24]["max"]=$luftdz[$z]["max"];
$luftdz[24]["maxh"]=$z;
}
}
}
$h=$luftdz[$z]["max"]-$luftdz[$z]["min"];
$h0=($luftdz[$z]["max"]-950);
$t=100+1-($luftdz[$z]["max"]-950);
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=$luftdz[$z]["max"]*-1+50+7;}
# Zeitskala
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(103).'px;left:'.$p.'px;font-size:7px;width:15px;text-align:center">'.$z.'h</div>';
# Werte
if (isset($luftdz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb(0,'.$f.','.$f.');border-style:solid;border-color:rgb(0,'.$f.','.$f.');font-size:8px;width:15px;height:'.$h.'px"></div>';
if (($luftdz[$z]["max"]-950)>80) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(83).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["max"]),0,",","").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(92).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["min"]),0,",","").'</div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(3).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["max"]),0,",","").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(12).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["min"]),0,",","").'</div>';
}
}
}
$zh=$gerarray["zeith"];
$zvh=$zh-1;
if ($zvh<0) {$zvh=23;}
$pfeil="⇒";
$w=($luftdz[$zh]["max"]+$luftdz[$zh]["min"])/2;
$wv=($luftdz[$zvh]["max"]+$luftdz[$zvh]["min"])/2;
if ($wv>$w) {$pfeil='⇓';}
if ($wv<$w) {$pfeil='⇑';}
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:left;width:90px;font-size:30px;">'.$pfeil.'</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:right;width:90px;font-size:12px;">Luftdruck</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:35px;left:520px;text-align:right;width:90px;font-size:18px;">'.number_format(sprintf('%.0f',$luftdz[24]["max"]),0,",",".").' hPa</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:55px;left:520px;text-align:right;width:90px;font-size:12px;">('.$luftdz[24]["maxh"].'h) max.</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:70px;left:520px;text-align:right;width:90px;font-size:18px;">'.number_format(sprintf('%.0f',$luftdz[24]["min"]),0,",",".").' hPa</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:90px;left:520px;text-align:right;width:90px;font-size:12px;">('.$luftdz[24]["minh"].'h) min.</div>';
echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.'</div>#'.$ver;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch PSG-Script |
| =============================================================== |
| Wetter Web (curl) |
| --------------------------------------------------------------- |
| openweathermap.org |
| Informationen von obiger Homepage für den Ort, der anhand der |
| in den Einstellungen eingelesenen Längen- und Breitengraden |
| ermittelt wurde. |
| |
| (C)2014/15 BlueDragon !
| |
+---------------------------------------------------------------------+
*/
include __DIR__."/../include/psg.php";
$gerarray=getGerInfo(substr(basename(__FILE__,".php"),3));
if ($gerarray["Counter"]>=9) {
$ver="V#V 4.80#";
$zeit=date("H:i");
$url="http://api.openweathermap.org/data/2.5/weather?lat=".BREITENGRAD."&lon=".LAENGENGRAD."&mode=xml&units=metric&lang=de";
$Status=web($url,$post);
if ($Status) {
$Cont=simplexml_load_string($Status);
$Temp=number_format(sprintf('%.1f',$Cont->temperature->attributes()->value),1,",",".");
$Wind=$Cont->wind->speed->attributes()->name;
$WGeschwindigkeit=number_format(sprintf('%.2f',$Cont->wind->speed->attributes()->value*6),0,",",".");
$WRichtung=$Cont->wind->direction->attributes()->code;
$Luftdruck=number_format(sprintf('%.0f',$Cont->pressure->attributes()->value),0,",",".");
$Feuchtigkeit=number_format(sprintf('%.0f',$Cont->humidity->attributes()->value),0,",",".");
$Stadt=$Cont->city->attributes()->name;
$Symbol='<img src="http://openweathermap.org/img/w/'.$Cont->weather->attributes()->icon.'.png" width="50" height="50">';
$Wetter=$Cont->weather->attributes()->value;
$temp=sprintf('%.1f',$Cont->temperature->attributes()->value);
$feucht=sprintf('%.0f',$Cont->humidity->attributes()->value);
$luftd=sprintf('%.0f',$Cont->pressure->attributes()->value);
$zeitl=$gerarray["zeitl"];
$zeith=date("G")*1;
$tempz=unserialize($gerarray["tempz"]);
$feuchtz=unserialize($gerarray["feuchtz"]);
$luftdz=unserialize($gerarray["luftdz"]);
if ($zeith!=$zeitl) {
$tempz[$zeith]=array();
$feuchtz[$zeith]=array();
$luftdz[$zeith]=array();
$zeitl=$zeith;
}
if ($zeitl>23) {$zeitl=0;}
if ($temp<$tempz[$zeith]["min"] or !isset($tempz[$zeith]["min"])) {
$tempz[$zeith]["min"]=$temp;
}
if ($temp>$tempz[$zeith]["max"] or !isset($tempz[$zeith]["max"])) {
$tempz[$zeith]["max"]=$temp;
}
if ($feucht<$feuchtz[$zeith]["min"] or !isset($feuchtz[$zeith]["min"])) {
$feuchtz[$zeith]["min"]=$feucht;
}
if ($feucht>$feuchtz[$zeith]["max"] or !isset($feuchtz[$zeith]["max"])) {
$feuchtz[$zeith]["max"]=$feucht;
}
if ($luftd<$luftdz[$zeith]["min"] or !isset($luftdz[$zeith]["min"])) {
$luftdz[$zeith]["min"]=$luftd;
}
if ($luftd>$luftdz[$zeith]["max"] or !isset($luftdz[$zeith]["max"])) {
$luftdz[$zeith]["max"]=$luftd;
}
$echo="T#".sprintf('%.2f',$Cont->temperature->attributes()->value)."#P#".'<div style="font-size:12px;text-align:right;width:60px;position:absolute;top:-12px;">'.$Luftdruck.' hPa</div><div style="font-size:12px;text-align:left;width:60px;position:absolute;top:14px;"><img src="'.picdesign("wind.png").'" border="0" height="24"></div><div style="font-size:12px;text-align:right;width:60px;position:absolute;top:12px;">'.$WRichtung.'</div><div style="font-size:12px;text-align:right;width:60px;position:absolute;top:26px;">'.$WGeschwindigkeit.' km/h</div><div style="font-size:14px;text-align:right;width:310px;position:absolute;top:-20px;">'.$Symbol.'</div><div style="font-size:14px;text-align:right;width:310px;position:absolute;top:25px;left:0px;">'.$Wetter.'</div><div style="font-size:14px;text-align:left;width:30px;position:absolute;top:-20px;left:70px;"><img class="block" src="'.picdesign("temp.png").'" border="0"></div><div style="font-size:14px;text-align:right;width:100px;position:absolute;top:-12px;left:70px;"><img src="'.picdesign("feucht.png").'" border="0" height="12"> '.$Feuchtigkeit."%%".'</div><div style="font-size:22px;text-align:right;width:100px;position:absolute;top:2px;left:70px;">'.$Temp."°C".'</div>'."*HTML#V#".$Wetter."*ANZWETTER##V#".$Feuchtigkeit."*ANZFEUCHT#V#".$zeit."*Mode#V#".serialize($tempz)."*tempz#V#".serialize($feuchtz)."*feuchtz#V#".serialize($luftdz)."*luftdz#V#".$zeith."*zeith#V#".$zeitl."*zeitl#".$ver;
}
else {
$echo=$ver."C##";
}
}
else {
$echo=$ver."C##";
}
echo $echo;
exit;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch PSG-Script |
| =============================================================== |
| Status RaspberryPI sashelper (PI) |
| Web (curl) |
| (C)2014/15 BlueDragon !
| |
+---------------------------------------------------------------------+
*/
include __DIR__."/../include/psg.php";
$gerarray=getGerInfo(substr(basename(__FILE__,".php"),3));
$ver="4.40";
$ver="V#V ".$ver."#V#PC*AIN#";
$befehl='cat /sys/class/thermal/thermal_zone0/temp';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustemp=trim(web($url,$post))/1000;
if ($Statustemp!=0) {
$befehl='sudo /usr/bin/vcgencmd measure_clock arm';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustakt=web($url,$post);
$befehl='sudo /usr/bin/vcgencmd measure_volts core';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusvolt=web($url,$post);
$befehl='sudo /usr/bin/vcgencmd measure_clock core';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustaktc=web($url,$post);
$befehl='sudo free | grep "Mem"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusram=web($url,$post);
$Statusram=explode(" ",preg_replace("/\s+/", " ", $Statusram));
$Statusram=$Statusram[2]/$Statusram[1]*100;
$befehl='sudo df | grep "rootfs"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk=web($url,$post);
$Statusdisk=substr($Statusdisk,strpos($Statusdisk,"%")-3,3);
if ($Statustakt) {
$temp=sprintf('%.1f',$Statustemp);
$zeitl=$gerarray["zeitl"];
$zeith=date("G")*1;
$tempz=unserialize($gerarray["tempz"]);
if ($zeith!=$zeitl) {
$tempz[$zeith]=array();
$zeitl=$zeith;
}
if ($zeitl>23) {$zeitl=0;}
if ($temp<$tempz[$zeith]["min"] or !isset($tempz[$zeith]["min"])) {
$tempz[$zeith]["min"]=$temp;
}
if ($temp>$tempz[$zeith]["max"] or !isset($tempz[$zeith]["max"])) {
$tempz[$zeith]["max"]=$temp;
}
echo 'P#<div style="position:absolute;top:-6px;font-size:13px;text-align:left;">CPU: '.number_format(sprintf('%.0f',(substr($Statustakt,strpos($Statustakt,"=")+1)*1/1000000)),0,",",".").' MHz<br />Temp: '.number_format(($Statustemp*1),1,",",".").'°C<br />RAM used:'.number_format($Statusram,0,",",".").'%%</div><div style="position:absolute;top:-6px;font-size:13px;left:105px;text-align:left;">Core: '.number_format(sprintf('%.0f',(substr($Statustaktc,strpos($Statustaktc,"=")+1)*1/1000000)),0,",",".").' MHz<br />Core: '.number_format(sprintf('%.2f',(substr($Statusvolt,strpos($Statusvolt,"=")+1)*1/1)),2,",",".").' V<br />Disk used: '.$Statusdisk.'%%</div><div style="position:absolute;top:-20px;font-size:14px;width:320px;"><span id="klick"><a href="'.$Conf["PSG"].'doitshutdown.php"><img src="'.picdesign("schalter3.png").'"></a></span></div><div style="position:absolute;top:-20px;font-size:14px;width:265px"><span id="klick"><a href="'.$Conf["PSG"].'doitreboot.php"><img src="'.picdesign("schalterr.png").'"></a></span></div>*HTML#V#'.serialize($tempz).'*tempz#V#'.$zeith.'*zeith#V#'.$zeitl.'*zeitl#'.$ver;
}
}
exit;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch |
| Pseudo-Script |
| =============================================================== |
| Info |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include __DIR__."/../include/psg.php";
$ver="V#V 4.50#";
$name="Himbeere";
$gerarray=getGerInfo($name);
$tempz=unserialize($gerarray["tempz"]);
$info ="";
# 10°C-Linien
for ($g=0;$g<=10;$g++) {
$l=$g*10+1;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(80,80,80);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.($l-4).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(100-$g*10).'°C</div>';
}
# 5°C-Linien
for ($g=0;$g<=9;$g++) {
$l=$g*10+6;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(60,60,60);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
# Markierung akt. Stunde
for ($z=0;$z<=23;$z++) {
$h=113;
$t=1;
$p=$z*20+5+30;
if ($z==$gerarray["zeith"]) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p-2).'px;background-color:rgb(80,80,80);border-style:solid;border-color:rgb(80,80,80);font-size:8px;width:19px;height:'.$h.'px"></div>';
}
}
# Tempsäulen
for ($z=0;$z<=23;$z++) {
$h=$tempz[$z]["max"]-$tempz[$z]["min"];
$h0=$tempz[$z]["max"];
$t=100+1-$tempz[$z]["max"];
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=50+7;}
if (isset($tempz[$z]["max"])) {
if ($tempz[$z]["max"]>=80) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.',0,0);border-style:solid;border-color:rgb('.$f0.',0,0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if (isset($tempz[$z]["max"])) {
if ($tempz[$z]["max"]>=70) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($f0/1).','.($f0/2).',0);border-style:solid;border-color:rgb('.($f0/1).','.($f0/2).',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=60) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($f0/1).','.($f0/1).',0);border-style:solid;border-color:rgb('.($f0/1).','.($f0/1).',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=50) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.$f0.',0);border-style:solid;border-color:rgb(0,'.$f0.',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=40) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.($f0/1).','.($f0/2).');border-style:solid;border-color:rgb(0,'.($f0/1).','.($f0/2).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=30) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.($f0/1).','.($f0/1).');border-style:solid;border-color:rgb(0,'.($f0/1).','.($f0/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=20) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.($f0/2).','.($f0/1).');border-style:solid;border-color:rgb(0,'.($f0/2).','.($f0/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,0,'.($f0/1).');border-style:solid;border-color:rgb(0,0,'.($f0/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
}
}
}
}
}
}
}
}
}
# Rest
for ($z=0;$z<=23;$z++) {
if ($z<=$gerarray["zeith"]) {
if ($tempz[$z]["min"]<$tempz[24]["min"] or !isset($tempz[24]["min"])) {
if (isset($tempz[$z]["min"])) {
$tempz[24]["min"]=$tempz[$z]["min"];
$tempz[24]["minh"]=$z;
}
}
if ($tempz[$z]["max"]>$tempz[24]["max"] or !isset($tempz[24]["max"])) {
if (isset($tempz[$z]["max"])) {
$tempz[24]["max"]=$tempz[$z]["max"];
$tempz[24]["maxh"]=$z;
}
}
}
$h=$tempz[$z]["max"]-$tempz[$z]["min"];
$h0=$tempz[$z]["max"];
$t=100+1-$tempz[$z]["max"];
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=$tempz[$z]["max"]*-1+50+7;}
# Zeitskala
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(103).'px;left:'.$p.'px;font-size:7px;width:15px;text-align:center">'.$z.'h</div>';
# Werte
if (isset($tempz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb(0,'.$f.','.$f.');border-style:solid;border-color:rgb(0,'.$f.','.$f.');font-size:8px;width:15px;height:'.$h.'px"></div>';
if ($tempz[$z]["max"]>80) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(83).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$tempz[$z]["max"]),1,",",".").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(92).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$tempz[$z]["min"]),1,",",".").'</div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(3).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$tempz[$z]["max"]),1,",",".").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(12).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$tempz[$z]["min"]),1,",",".").'</div>';
}
}
}
$zh=$gerarray["zeith"];
$zvh=$zh-1;
if ($zvh<0) {$zvh=23;}
$pfeil="⇒";
$w=($tempz[$zh]["max"]+$tempz[$zh]["min"])/2;
$wv=($tempz[$zvh]["max"]+$tempz[$zvh]["min"])/2;
if ($wv>$w) {$pfeil='⇓';}
if ($wv<$w) {$pfeil='⇑';}
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:left;width:90px;font-size:30px;">'.$pfeil.'</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:right;width:90px;font-size:12px;">CPU-<br />Temperatur</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:35px;left:520px;text-align:right;width:90px;font-size:20px;">'.number_format(sprintf('%.1f',$tempz[24]["max"]),1,",",".").'°C</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:55px;left:520px;text-align:right;width:90px;font-size:12px;">('.$tempz[24]["maxh"].'h) max.</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:70px;left:520px;text-align:right;width:90px;font-size:20px;">'.number_format(sprintf('%.1f',$tempz[24]["min"]),1,",",".").'°C</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:90px;left:520px;text-align:right;width:90px;font-size:12px;">('.$tempz[24]["minh"].'h) min.</div>';
echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.'</div>#'.$ver;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch PSG-Script |
| =============================================================== |
| Status RaspberryPI sashelper (PI) |
| Web (curl) |
| (C)2014/15 BlueDragon !
| |
+---------------------------------------------------------------------+
*/
include __DIR__."/../include/psg.php";
$ver="4.40";
$ver="V#V ".$ver."#V#PI 2*AIN#";
$befehl='sudo /usr/bin/vcgencmd measure_temp';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustemp=web($url,$post);
if ($Statustemp) {
$befehl='sudo /usr/bin/vcgencmd measure_clock arm';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustakt=web($url,$post);
$befehl='sudo free | grep "Mem"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusram=web($url,$post);
$Statusram=explode(" ",preg_replace("/\s+/", " ", $Statusram));
$Statusram=$Statusram[2]/$Statusram[1]*100;
$befehl='sudo df | grep "root"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk=web($url,$post);
$Statusdisk=substr($Statusdisk,strpos($Statusdisk,"%")-3,3);
$befehl='sudo df | grep "/dev/sda"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk1=web($url,$post);
$Statusdisk1=substr($Statusdisk1,strpos($Statusdisk1,"%")-3,3);
$befehl='sudo df | grep "/dev/sdb"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk2=web($url,$post);
$Statusdisk2=substr($Statusdisk2,strpos($Statusdisk2,"%")-3,3);
if ($Statustakt) {
echo 'P#
<div style="position:absolute;top:-6px;font-size:13px;text-align:left;">CPU: '.number_format(sprintf('%.0f',(substr($Statustakt,strpos($Statustakt,"=")+1)*1/1000000)),0,",",".").' MHz<br />Temp: '.number_format((substr($Statustemp,5)*1),1,",",".").'°C<br />Memory:'.number_format($Statusram,0,",",".").'%%</div>
<div style="position:absolute;top:-6px;font-size:13px;left:105px;text-align:left;">Card 16 GB: '.$Statusdisk.'%%<br />Stick1 4 GB: '.$Statusdisk1.'%%<br />Stick2 - GB: '.$Statusdisk2.'%%</div>
<div style="position:absolute;top:-14px;font-size:14px;width:315px;"><a href="./psg/doitshutdown.php"><img src="'.picdesign("schalter0.png").'" height="30px"></a></div>
<div style="position:absolute;top:-14px;font-size:14px;width:292px;"><a href="./psg/doitreboot.php"><img src="'.picdesign("schalter8.png").'" height="30px"></a></div>
<div style="position:absolute;top:-14px;font-size:14px;width:269px"><a href="./sas.php?info=ui&sortierung=name&name=PiB&schalter=an"><img src="'.picdesign("schalter7.png").'" height="30px"></a></div>
<div style="position:absolute;top:-14px;font-size:14px;width:246px"><a href="./sas.php?info=ui&sortierung=name&name=PLA546e&schalter=an"><img src="'.picdesign("schalter7.png").'" height="30px"></a></div>
<div style="position:absolute;top:+12px;font-size:14px;width:315px;"><a href="./psg/doitsicherung-delete.php"><img src="'.picdesign("schalter0.png").'" height="30px"></a></div>
<div style="position:absolute;top:+12px;font-size:14px;width:292px;"><a href="./psg/doitsicherung-ftp.php"><img src="'.picdesign("schalter8.png").'" height="30px"></a></div>
<div style="position:absolute;top:+12px;font-size:14px;width:269px"><a href="./psg/doitsicherung-sas.php"><img src="'.picdesign("schalter1.png").'" height="30px"></a></div>
*HTML#'.$ver;
}
}
exit;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch PSG-Script |
| =============================================================== |
| Status RaspberryPI sashelper (PI) |
| Web (curl) |
| (C)2014/15 BlueDragon !
| |
+---------------------------------------------------------------------+
*/
include __DIR__."/../include/psg.php";
$ver="4.40";
$ver="V#V ".$ver."#V#PI 2*AIN#";
$befehl='sudo /usr/bin/vcgencmd measure_temp';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustemp=web($url,$post);
if ($Statustemp) {
$befehl='sudo /usr/bin/vcgencmd measure_clock arm';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statustakt=web($url,$post);
$befehl='sudo free | grep "Mem"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusram=web($url,$post);
$Statusram=explode(" ",preg_replace("/\s+/", " ", $Statusram));
$Statusram=$Statusram[2]/$Statusram[1]*100;
$befehl='sudo df | grep "root"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk=web($url,$post);
$Statusdisk=substr($Statusdisk,strpos($Statusdisk,"%")-3,3);
$befehl='sudo df | grep "/dev/sda"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk1=web($url,$post);
$Statusdisk1=substr($Statusdisk1,strpos($Statusdisk1,"%")-3,3);
$befehl='sudo df | grep "/dev/sdb"';
$url=$helperurlpi."?befehl=".encodiere($befehl,33455);
$Statusdisk2=web($url,$post);
$Statusdisk2=substr($Statusdisk2,strpos($Statusdisk2,"%")-3,3);
if ($Statustakt) {
$temp=sprintf('%.1f',$Statustemp);
$zeitl=$gerarray["zeitl"];
$zeith=date("G")*1;
$tempz=unserialize($gerarray["tempz"]);
if ($zeith!=$zeitl) {
$tempz[$zeith]=array();
$zeitl=$zeith;
}
if ($zeitl>23) {$zeitl=0;}
if ($temp<$tempz[$zeith]["min"] or !isset($tempz[$zeith]["min"])) {
$tempz[$zeith]["min"]=$temp;
}
if ($temp>$tempz[$zeith]["max"] or !isset($tempz[$zeith]["max"])) {
$tempz[$zeith]["max"]=$temp;
}
echo 'P#
<div style="position:absolute;top:-6px;font-size:13px;text-align:left;">CPU: '.number_format(sprintf('%.0f',(substr($Statustakt,strpos($Statustakt,"=")+1)*1/1000000)),0,",",".").' MHz<br />Temp: '.number_format((substr($Statustemp,5)*1),1,",",".").'°C<br />Memory:'.number_format($Statusram,0,",",".").'%%</div>
<div style="position:absolute;top:-6px;font-size:13px;left:105px;text-align:left;">Card 16 GB: '.$Statusdisk.'%%<br />Stick1 4 GB: '.$Statusdisk1.'%%<br />Stick2 - GB: '.$Statusdisk2.'%%</div>
<div style="position:absolute;top:-14px;font-size:14px;width:315px;"><a href="./psg/doitshutdown.php"><img src="'.picdesign("schalter0.png").'" height="30px"></a></div>
<div style="position:absolute;top:-14px;font-size:14px;width:292px;"><a href="./psg/doitreboot.php"><img src="'.picdesign("schalter8.png").'" height="30px"></a></div>
<div style="position:absolute;top:-14px;font-size:14px;width:269px"><a href="./sas.php?info=ui&sortierung=name&name=PiB&schalter=an"><img src="'.picdesign("schalter7.png").'" height="30px"></a></div>
<div style="position:absolute;top:-14px;font-size:14px;width:246px"><a href="./sas.php?info=ui&sortierung=name&name=PLA546e&schalter=an"><img src="'.picdesign("schalter7.png").'" height="30px"></a></div>
<div style="position:absolute;top:+12px;font-size:14px;width:315px;"><a href="./psg/doitsicherung-delete.php"><img src="'.picdesign("schalter0.png").'" height="30px"></a></div>
<div style="position:absolute;top:+12px;font-size:14px;width:292px;"><a href="./psg/doitsicherung-ftp.php"><img src="'.picdesign("schalter8.png").'" height="30px"></a></div>
<div style="position:absolute;top:+12px;font-size:14px;width:269px"><a href="./psg/doitsicherung-sas.php"><img src="'.picdesign("schalter1.png").'" height="30px"></a></div>
*HTML#V#'.serialize($tempz).'*tempz#V#'.$zeith.'*zeith#V#'.$zeitl.'*zeitl#'.$ver;
}
}
exit;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch Automation Pro (Helper) (sasaph) |
| =============================================================== |
| Helper-Script zum Befehlsaufruf unter root-Rechten |
| |
| (C)2014/15 BlueDragon !
| |
+---------------------------------------------------------------------+
*/
if (isset($_GET["befehl"])) {
$locale='de_DE.UTF-8';
setlocale(LC_ALL,$locale);
putenv('LC_ALL='.$locale);
$Status=shell_exec(decodiere($_GET["befehl"],33455));
echo $Status;
}
else {
echo "E##";
}
exit;
function encodiere($str,$key) {
/***************************/
mt_srand($key);
$Status=array();
for ($x=0,$lang=strlen($str); $x<$lang; $x++) {
$Status[$x]=(ord($str[$x])*3)+mt_rand(350,16000);
}
mt_srand();
return implode('*',$Status);
}
function decodiere($str,$key) {
/***************************/
mt_srand($key);
$StatusBlock=explode('*',$str);
$Status=array();
foreach ($StatusBlock as $SBlock) {
$ord=(intval($SBlock)-mt_rand(350,16000))/3;
$Status[]=chr($ord);
}
mt_srand();
return implode('',$Status);
}
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch PSG-Script |
| =============================================================== |
| Wetter Web (curl) |
| --------------------------------------------------------------- |
| openweathermap.org |
| Informationen von obiger Homepage für den Ort, der anhand der |
| in den Einstellungen eingelesenen Längen- und Breitengraden |
| ermittelt wurde. |
| |
| (C)2014/15 BlueDragon !
| |
+---------------------------------------------------------------------+
*/
include __DIR__."/../include/psg.php";
$gerarray=getGerInfo(substr(basename(__FILE__,".php"),3));
if ($gerarray["Counter"]>=9) {
$ver="V#V 4.87#";
$zeit=date("H:i");
$url="http://api.openweathermap.org/data/2.5/weather?lat=".BREITENGRAD."&lon=".LAENGENGRAD."&mode=xml&units=metric&lang=de";
$Status=web($url,$post);
if ($Status) {
$Cont=simplexml_load_string($Status);
$Temp=number_format(sprintf('%.1f',$Cont->temperature->attributes()->value),1,",",".");
$Wind=$Cont->wind->speed->attributes()->name;
$WGeschwindigkeit=number_format(sprintf('%.2f',$Cont->wind->speed->attributes()->value*6),0,",",".");
$WRichtung=$Cont->wind->direction->attributes()->code;
$Luftdruck=number_format(sprintf('%.0f',$Cont->pressure->attributes()->value),0,",",".");
$Feuchtigkeit=number_format(sprintf('%.0f',$Cont->humidity->attributes()->value),0,",",".");
$Stadt=$Cont->city->attributes()->name;
$Symbol='<img src="http://openweathermap.org/img/w/'.$Cont->weather->attributes()->icon.'.png" width="50" height="50">';
$Wetter=$Cont->weather->attributes()->value;
$temp=sprintf('%.1f',$Cont->temperature->attributes()->value);
$feucht=sprintf('%.0f',$Cont->humidity->attributes()->value);
$luftd=sprintf('%.0f',$Cont->pressure->attributes()->value);
$zeitl=$gerarray["zeitl"];
$zeith=date("G")*1;
$tempz=unserialize($gerarray["tempz"]);
$feuchtz=unserialize($gerarray["feuchtz"]);
$luftdz=unserialize($gerarray["luftdz"]);
if ($zeith!=$zeitl) {
$tempz[$zeith]=array();
$feuchtz[$zeith]=array();
$luftdz[$zeith]=array();
$zeitl=$zeith;
}
if ($zeitl>23) {$zeitl=0;}
if ($temp<$tempz[$zeith]["min"] or !isset($tempz[$zeith]["min"])) {
$tempz[$zeith]["min"]=$temp;
}
if ($temp>$tempz[$zeith]["max"] or !isset($tempz[$zeith]["max"])) {
$tempz[$zeith]["max"]=$temp;
}
if ($feucht<$feuchtz[$zeith]["min"] or !isset($feuchtz[$zeith]["min"])) {
$feuchtz[$zeith]["min"]=$feucht;
}
if ($feucht>$feuchtz[$zeith]["max"] or !isset($feuchtz[$zeith]["max"])) {
$feuchtz[$zeith]["max"]=$feucht;
}
if ($luftd<$luftdz[$zeith]["min"] or !isset($luftdz[$zeith]["min"])) {
$luftdz[$zeith]["min"]=$luftd;
}
if ($luftd>$luftdz[$zeith]["max"] or !isset($luftdz[$zeith]["max"])) {
$luftdz[$zeith]["max"]=$luftd;
}
$echo="T#".sprintf('%.2f',$Cont->temperature->attributes()->value)."#P#".'<div style="font-size:12px;text-align:right;width:60px;position:absolute;top:-12px;">'.$Luftdruck.' hPa</div><div style="font-size:12px;text-align:left;width:60px;position:absolute;top:14px;"><img src="'.picdesign("wind.png").'" border="0" height="24"></div><div style="font-size:12px;text-align:right;width:60px;position:absolute;top:12px;">'.$WRichtung.'</div><div style="font-size:12px;text-align:right;width:60px;position:absolute;top:26px;">'.$WGeschwindigkeit.' km/h</div><div style="font-size:14px;text-align:right;width:310px;position:absolute;top:-20px;">'.$Symbol.'</div><div style="font-size:14px;text-align:right;width:310px;position:absolute;top:25px;left:0px;">'.$Wetter.'</div><div style="font-size:14px;text-align:left;width:30px;position:absolute;top:-20px;left:70px;"><img class="block" src="'.picdesign("temp.png").'" border="0"></div><div style="font-size:14px;text-align:right;width:100px;position:absolute;top:-12px;left:70px;"><img src="'.picdesign("feucht.png").'" border="0" height="12"> '.$Feuchtigkeit."%%".'</div><div style="font-size:22px;text-align:right;width:100px;position:absolute;top:2px;left:70px;">'.$Temp."°C".'</div>'."*HTML#V#".$Wetter."*ANZWETTER##V#".$Feuchtigkeit."*ANZFEUCHT#V#".$Symbol."*ANZSYMBOL#V#".$WRichtung."*ANZWRICHTUNG#V#".$WGeschwindigkeit."*ANZWGESCHWINDIGKEIT#V#".$Luftdruck."*ANZLUFTDRUCK#V#".$zeit."*Mode#V#".serialize($tempz)."*tempz#V#".serialize($feuchtz)."*feuchtz#V#".serialize($luftdz)."*luftdz#V#".$zeith."*zeith#V#".$zeitl."*zeitl#V#".$zeit."*ANZZEITUPDATE#".$ver;
}
else {
$echo=$ver."C##";
}
}
else {
$echo=$ver."C##";
}
echo $echo;
exit;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch |
| Pseudo-Script |
| =============================================================== |
| Info |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include __DIR__."/../include/psg.php";
$ver="V#V 4.85#";
$name="Wetter";
$gerarray=getGerInfo($name);
$tempz=unserialize($gerarray["tempz"]);
$info ="";
# 10 Grad-Linien
for ($g=0;$g<=8;$g++) {
$l=$g*10+6;
if ($g!=5) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(80,80,80);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
$info.='<div id="tab" style="position:absolute;border:1px;top:'.($l-4).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(50-$g*10).'°C</div>';
}
# 5 Grad-Linien
for ($g=0;$g<=9;$g++) {
$l=$g*10+1;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(60,60,60);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
# Markierung akt. Stunde
for ($z=0;$z<=23;$z++) {
$h=50+30+10+15;
$t=1;
$p=$z*20+5+30;
if ($z==$gerarray["zeith"]) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p-2).'px;background-color:rgb(80,80,80);border-style:solid;border-color:rgb(80,80,80);font-size:8px;width:19px;height:'.$h.'px"></div>';
}
}
# Temperatursäulen
for ($z=0;$z<=23;$z++) {
$h=$tempz[$z]["max"]-$tempz[$z]["min"];
$h0=$tempz[$z]["max"];
$t=50+7-$tempz[$z]["max"];
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=50+7;}
if (isset($tempz[$z]["max"])) {
if ($tempz[$z]["max"]>=40) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.','.($f0/1).','.$f0.');border-style:solid;border-color:rgb('.$f0.','.($f0/1).','.$f0.');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=37.5) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.','.intval($f0/1.25).','.$f0.');border-style:solid;border-color:rgb('.$f0.','.intval($f0/1.25).','.$f0.');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=35) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.','.intval($f0/4).','.$f0.');border-style:solid;border-color:rgb('.$f0.','.intval($f0/4).','.$f0.');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if (isset($tempz[$z]["max"])) {
if ($tempz[$z]["max"]>=30) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.',0,0);border-style:solid;border-color:rgb('.$f0.',0,0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=27.5) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.','.($f0/2).',0);border-style:solid;border-color:rgb('.$f0.','.($f0/2).',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=25) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.','.($f0/1).',0);border-style:solid;border-color:rgb('.$f0.','.($f0/1).',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=20) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($f0/2).','.$f0.',0);border-style:solid;border-color:rgb('.($f0/2).','.$f0.',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=10) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.$f0.',0);border-style:solid;border-color:rgb(0,'.$f0.',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["max"]>=0) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.$f0.','.$f0.');border-style:solid;border-color:rgb(0,'.$f0.','.$f0.');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($tempz[$z]["min"]<=-15) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb('.($f0/2).',0,'.$f0.');border-style:solid;border-color:rgb('.($f0/2).',0,'.$f0.');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb(0,0,'.$f0.');border-style:solid;border-color:rgb(0,0,'.$f0.');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
}
}
}
}
}
}
}
}
}
}
}
}
# 0 Grad-Linie
for ($g=0;$g<=8;$g++) {
$l=$g*10+6;
if ($g==5) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(120,120,120);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
$info.='<div id="tab" style="position:absolute;border:1px;top:'.($l-4).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(50-$g*10).'°C</div>';
}
# Rest
for ($z=0;$z<=23;$z++) {
if ($z<=$gerarray["zeith"]) {
if ($tempz[$z]["min"]<$tempz[24]["min"] or !isset($tempz[24]["min"])) {
if (isset($tempz[$z]["min"])) {
$tempz[24]["min"]=$tempz[$z]["min"];
$tempz[24]["minh"]=$z;
}
}
if ($tempz[$z]["max"]>$tempz[24]["max"] or !isset($tempz[24]["max"])) {
if (isset($tempz[$z]["max"])) {
$tempz[24]["max"]=$tempz[$z]["max"];
$tempz[24]["maxh"]=$z;
}
}
}
$h=$tempz[$z]["max"]-$tempz[$z]["min"];
$h0=$tempz[$z]["max"];
$t=50+7-$tempz[$z]["max"];
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=$tempz[$z]["max"]*-1+50+7;}
# Zeitskala
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(97).'px;left:'.$p.'px;font-size:10px;width:15px;text-align:center">'.$z.'h</div>';
# Werte
if (isset($tempz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb(0,'.$f.','.$f.');border-style:solid;border-color:rgb(0,'.$f.','.$f.');font-size:8px;width:15px;height:'.$h.'px"></div>';
if ($tempz[$z]["max"]>=0) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(69).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;">'.number_format(sprintf('%.1f',$tempz[$z]["max"]),1,",",".").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(79).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;">'.number_format(sprintf('%.1f',$tempz[$z]["min"]),1,",",".").'</div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(29).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;">'.number_format(sprintf('%.1f',$tempz[$z]["max"]),1,",",".").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(39).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;">'.number_format(sprintf('%.1f',$tempz[$z]["min"]),1,",",".").'</div>';
}
}
}
$zh=$gerarray["zeith"];
$zvh=$zh-1;
if ($zvh<0) {$zvh=23;}
$pfeil="⇒";
$w=($tempz[$zh]["max"]+$tempz[$zh]["min"])/2;
$wv=($tempz[$zvh]["max"]+$tempz[$zvh]["min"])/2;
if ($wv>$w) {$pfeil='⇓';}
if ($wv<$w) {$pfeil='⇑';}
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:left;width:90px;font-size:30px;">'.$pfeil.'</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:right;width:90px;font-size:12px;">Außen-<br />temperatur</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:35px;left:520px;text-align:right;width:90px;font-size:20px;">'.number_format(sprintf('%.1f',$tempz[24]["max"]),1,",",".").'°C</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:55px;left:520px;text-align:right;width:90px;font-size:12px;">('.$tempz[24]["maxh"].'h) max.</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:70px;left:520px;text-align:right;width:90px;font-size:20px;">'.number_format(sprintf('%.1f',$tempz[24]["min"]),1,",",".").'°C</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:90px;left:520px;text-align:right;width:90px;font-size:12px;">('.$tempz[24]["minh"].'h) min.</div>';
echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.'</div>#'.$ver;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch |
| Pseudo-Script |
| =============================================================== |
| Info |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include __DIR__."/../include/psg.php";
$ver="V#V 4.85#";
$name="Wetter";
$gerarray=getGerInfo($name);
$feuchtz=unserialize($gerarray["feuchtz"]);
$info ="";
# 10%-Linien
for ($g=0;$g<=10;$g++) {
$l=$g*10+1;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(80,80,80);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.($l-4).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(100-$g*10).'%%</div>';
}
# 5%-Linien
for ($g=0;$g<=9;$g++) {
$l=$g*10+6;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(60,60,60);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
# Markierung akt. Stunde
for ($z=0;$z<=23;$z++) {
$h=113;
$t=1;
$p=$z*20+5+30;
if ($z==$gerarray["zeith"]) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p-2).'px;background-color:rgb(80,80,80);border-style:solid;border-color:rgb(80,80,80);font-size:8px;width:19px;height:'.$h.'px"></div>';
}
}
# Hydrosäulen
for ($z=0;$z<=23;$z++) {
$h=$feuchtz[$z]["max"]-$feuchtz[$z]["min"];
$h0=$feuchtz[$z]["max"];
$t=100+1-$feuchtz[$z]["max"];
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=50+7;}
if (isset($feuchtz[$z]["max"])) {
if ($feuchtz[$z]["max"]>=80) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,0,'.($f0/1).');border-style:solid;border-color:rgb(0,0,'.($f0/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if (isset($feuchtz[$z]["max"])) {
if ($feuchtz[$z]["max"]>=70) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.($f0/2).','.($f0/1).');border-style:solid;border-color:rgb(0,'.($f0/2).','.($f0/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($feuchtz[$z]["max"]>=60) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.($f0/1).','.($f0/1).');border-style:solid;border-color:rgb(0,'.($f0/1).','.($f0/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($feuchtz[$z]["max"]>=50) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.($f0/1).','.($f0/2).');border-style:solid;border-color:rgb(0,'.($f0/1).','.($f0/2).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($feuchtz[$z]["max"]>=40) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb(0,'.$f0.',0);border-style:solid;border-color:rgb(0,'.$f0.',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($feuchtz[$z]["max"]>=30) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($f0/1).','.($f0/1).',0);border-style:solid;border-color:rgb('.($f0/1).','.($f0/1).',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
if ($feuchtz[$z]["max"]>=20) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($f0/1).','.($f0/2).',0);border-style:solid;border-color:rgb('.($f0/1).','.($f0/2).',0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.$f0.',0,0);border-style:solid;border-color:rgb('.$f0.',0,0);font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
}
}
}
}
}
}
}
}
}
# Rest
for ($z=0;$z<=23;$z++) {
if ($z<=$gerarray["zeith"]) {
if ($feuchtz[$z]["min"]<$feuchtz[24]["min"] or !isset($feuchtz[24]["min"])) {
if (isset($feuchtz[$z]["min"])) {
$feuchtz[24]["min"]=$feuchtz[$z]["min"];
$feuchtz[24]["minh"]=$z;
}
}
if ($feuchtz[$z]["max"]>$feuchtz[24]["max"] or !isset($feuchtz[24]["max"])) {
if (isset($feuchtz[$z]["max"])) {
$feuchtz[24]["max"]=$feuchtz[$z]["max"];
$feuchtz[24]["maxh"]=$z;
}
}
}
$h=$feuchtz[$z]["max"]-$feuchtz[$z]["min"];
$h0=$feuchtz[$z]["max"];
$t=100+1-$feuchtz[$z]["max"];
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=$feuchtz[$z]["max"]*-1+50+7;}
# Zeitskala
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(103).'px;left:'.$p.'px;font-size:7px;width:15px;text-align:center">'.$z.'h</div>';
# Werte
if (isset($feuchtz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb(0,'.$f.','.$f.');border-style:solid;border-color:rgb(0,'.$f.','.$f.');font-size:8px;width:15px;height:'.$h.'px"></div>';
if ($feuchtz[$z]["max"]>80) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(83).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$feuchtz[$z]["max"]),0,",",".").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(92).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$feuchtz[$z]["min"]),0,",",".").'</div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(3).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$feuchtz[$z]["max"]),0,",",".").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(12).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$feuchtz[$z]["min"]),0,",",".").'</div>';
}
}
}
$zh=$gerarray["zeith"];
$zvh=$zh-1;
if ($zvh<0) {$zvh=23;}
$pfeil="⇒";
$w=($feuchtz[$zh]["max"]+$feuchtz[$zh]["min"])/2;
$wv=($feuchtz[$zvh]["max"]+$feuchtz[$zvh]["min"])/2;
if ($wv>$w) {$pfeil='⇓';}
if ($wv<$w) {$pfeil='⇑';}
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:left;width:90px;font-size:30px;">'.$pfeil.'</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:right;width:90px;font-size:12px;">Hydrometer</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:35px;left:520px;text-align:right;width:90px;font-size:20px;">'.number_format(sprintf('%.0f',$feuchtz[24]["max"]),0,",",".").'%%</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:55px;left:520px;text-align:right;width:90px;font-size:12px;">('.$feuchtz[24]["maxh"].'h) max.</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:70px;left:520px;text-align:right;width:90px;font-size:20px;">'.number_format(sprintf('%.0f',$feuchtz[24]["min"]),0,",",".").'%%</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:90px;left:520px;text-align:right;width:90px;font-size:12px;">('.$feuchtz[24]["minh"].'h) min.</div>';
echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.'</div>#'.$ver;
?>
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch |
| Pseudo-Script |
| =============================================================== |
| Info |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include __DIR__."/../include/psg.php";
$ver="V#V 4.85#";
$name="Wetter";
$gerarray=getGerInfo($name);
$luftdz=unserialize($gerarray["luftdz"]);
$info ="";
# 10%-Linien
for ($g=0;$g<=10;$g++) {
$l=$g*10+1;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(80,80,80);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.($l-4).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(1050-$g*10).'</div>';
}
# 5%-Linien
for ($g=0;$g<=9;$g++) {
$l=$g*10+6;
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$l.'px;background-color:rgb(60,60,60);border-style:solid;border-color:black;left:30px;width:485px;height:1px"></div>';
}
# Markierung akt. Stunde
for ($z=0;$z<=23;$z++) {
$h=113;
$t=1;
$p=$z*20+5+30;
if ($z==$gerarray["zeith"]) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p-2).'px;background-color:rgb(80,80,80);border-style:solid;border-color:rgb(80,80,80);font-size:8px;width:19px;height:'.$h.'px"></div>';
}
}
# 24
for ($z=0;$z<=23;$z++) {
if ($z<=23) {
if ($luftdz[$z]["min"]<$luftdz[25]["min"] or !isset($luftdz[25]["min"])) {
if (isset($luftdz[$z]["min"])) {
$luftdz[25]["min"]=$luftdz[$z]["min"];
$luftdz[25]["minh"]=$z;
}
}
if ($luftdz[$z]["max"]>$luftdz[25]["max"] or !isset($luftdz[25]["max"])) {
if (isset($luftdz[$z]["max"])) {
$luftdz[25]["max"]=$luftdz[$z]["max"];
$luftdz[25]["maxh"]=$z;
}
}
}
}
# hPa-Säulen
for ($z=0;$z<=23;$z++) {
$h=$luftdz[$z]["max"]-$luftdz[$z]["min"];
$h0=($luftdz[$z]["max"]-950);
$t=100+1-($luftdz[$z]["max"]-950);
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=50+7;}
$ld=100/($luftdz[25]["max"]-$luftdz[25]["min"])*($luftdz[$z]["max"]-$luftdz[25]["min"]);
if ($ld<0) {$ld=0;}
if ($ld>100) {$ld=100;}
$fb=intval((100-$ld)+$f0)-60;
$fg=intval($f0)-100+40+20;
$fr=intval(($ld)+$f0)-60;
if (isset($luftdz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.$p.'px;background-color:rgb('.($fr/1).','.($fg/1).','.($fb/1).');border-style:solid;border-color:rgb('.($fr/1).','.($fg/1).','.($fb/1).');font-size:8px;width:15px;height:'.$h0.'px"></div>';
}
}
# Rest
for ($z=0;$z<=23;$z++) {
if ($z<=$gerarray["zeith"]) {
if ($luftdz[$z]["min"]<$luftdz[24]["min"] or !isset($luftdz[24]["min"])) {
if (isset($luftdz[$z]["min"])) {
$luftdz[24]["min"]=$luftdz[$z]["min"];
$luftdz[24]["minh"]=$z;
}
}
if ($luftdz[$z]["max"]>$luftdz[24]["max"] or !isset($luftdz[24]["max"])) {
if (isset($luftdz[$z]["max"])) {
$luftdz[24]["max"]=$luftdz[$z]["max"];
$luftdz[24]["maxh"]=$z;
}
}
}
$h=$luftdz[$z]["max"]-$luftdz[$z]["min"];
$h0=($luftdz[$z]["max"]-950);
$t=100+1-($luftdz[$z]["max"]-950);
$t0=$t;
$p=$z*20+5+30;
$f=120;if ($z<=$gerarray["zeith"]) {$f=200;}
$f0=100;if ($z<=$gerarray["zeith"]) {$f0=140;}
if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=$luftdz[$z]["max"]*-1+50+7;}
# Zeitskala
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(103).'px;left:'.$p.'px;font-size:7px;width:15px;text-align:center">'.$z.'h</div>';
# Werte
if (isset($luftdz[$z]["max"])) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.$p.'px;background-color:rgb(0,'.$f.','.$f.');border-style:solid;border-color:rgb(0,'.$f.','.$f.');font-size:8px;width:15px;height:'.$h.'px"></div>';
if (($luftdz[$z]["max"]-950)>80) {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(83).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["max"]),0,",","").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(92).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["min"]),0,",","").'</div>';
}
else {
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(3).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["max"]),0,",","").'</div>';
$info.='<div id="tab" style="position:absolute;border:1px;top:'.(12).'px;left:'.$p.'px;width:15px;text-align:center;font-size:8px;text-shadow:0px 0px 1px black,0px 0px 1px black,0px 0px 1px black;">'.number_format(sprintf('%.1f',$luftdz[$z]["min"]),0,",","").'</div>';
}
}
}
$zh=$gerarray["zeith"];
$zvh=$zh-1;
if ($zvh<0) {$zvh=23;}
$pfeil="⇒";
$w=($luftdz[$zh]["max"]+$luftdz[$zh]["min"])/2;
$wv=($luftdz[$zvh]["max"]+$luftdz[$zvh]["min"])/2;
if ($wv>$w) {$pfeil='⇓';}
if ($wv<$w) {$pfeil='⇑';}
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:left;width:90px;font-size:30px;">'.$pfeil.'</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:right;width:90px;font-size:12px;">Luftdruck</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:35px;left:520px;text-align:right;width:90px;font-size:18px;">'.number_format(sprintf('%.0f',$luftdz[24]["max"]),0,",",".").' hPa</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:55px;left:520px;text-align:right;width:90px;font-size:12px;">('.$luftdz[24]["maxh"].'h) max.</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:70px;left:520px;text-align:right;width:90px;font-size:18px;">'.number_format(sprintf('%.0f',$luftdz[24]["min"]),0,",",".").' hPa</div>';
$info.='<div id="text" style="position:absolute;border:1px;top:90px;left:520px;text-align:right;width:90px;font-size:12px;">('.$luftdz[24]["minh"].'h) min.</div>';
echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.'</div>#'.$ver;
?>