[HowTo] Temperatur und Feuchtigkeitssensor DHT11/DHT22 an SaS

Theoretisch ist das in ähnlicher Form hinzubekommen. Mal sehen, ob ich so ein info-PsG so basteln kann, dass man mit der Anzeige was anfangen kann. ;)

- - - Aktualisiert - - -

multitemp.jpg
psgMultiTemp.php
PHP:
<?php 

    /*
        ╔═══╗ ╔═══╗ ╔═══╗ ┌───────────────────────────────────────────────────┐
        ║     ║   ║ ║     │  SensorAndSwitch (C)2014-16 Bluedragon            │
        ╚═══╗ ╠═══╣ ╚═══╗ ├──────────────────┬────────────────────────────────┤
            ║ ║   ║     ║ │  SAS-PsG (Info)  │  psginfoMultiTemp.php          │
        ╚═══╝ ╝   ╚ ╚═══╝ ├──────────────────┴────────────────────────────────┤
        ┌─────────────────┤  Infografik Multi Temperatur                      │
        │  Info:          ╘═══════════════════════════════════════════════════╡
        ├─────────────────────────────────────────────────────────────────────┤
        │  Infoslot                                                           │
        ╘═════════════════════════════════════════════════════════════════════╛
    */
 
    include_once __DIR__."/../include/psg.php";

    $ver="V#V 6.00#";

    $name="Sensor";
    $gerarray=getGerInfo($name);
    $tempz=unserialize($gerarray["tempz"]);
    $info ="";
    $info.='<div style="opacity:0.90;filter:alpha(opacity=90);left:-135px;top:0px;position:absolute;"><img src="'.picdesign("hgr/temp.png").'" border="0"></div>';
    
    # 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>';
        }
    }

    $name="Sensor";
    $gerarray=getGerInfo($name);
    $tempz=unserialize($gerarray["tempz"]);
    graph(0);
    $name="Wetter";
    $gerarray=getGerInfo($name);
    $tempz=unserialize($gerarray["tempz"]);
    graph(1);
    $name="Himbeere";
    $gerarray=getGerInfo($name);
    $tempz=unserialize($gerarray["tempz"]);
    graph(2);
#    $name="Helix";
#    $gerarray=getGerInfo($name);
#    $tempz=unserialize($gerarray["tempz"]);
#    graph(3);
    
    $name="Sensor";
    $gerarray=getGerInfo($name);
    $tempz=unserialize($gerarray["tempz"]);

    # 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>';
    }
    
    # Zeitskala
    
    for ($z=0;$z<=23;$z++) {
        $p=$z*20+5+30;
        $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>';
    }

    $zh=$gerarray["zeith"];
    $zvh=$zh-1;
    if ($zvh<0) {$zvh=23;}
    $pfeil="&rArr;";
    $w=($tempz[$zh]["max"]+$tempz[$zh]["min"])/2;
    $wv=($tempz[$zvh]["max"]+$tempz[$zvh]["min"])/2;
    if ($wv>$w) {$pfeil='&dArr;';}
    if ($wv<$w) {$pfeil='&uArr;';}
    $info.='<div id="text" style="position:absolute;border:1px;top:0px;left:520px;text-align:right;width:90px;font-size:12px;">Temperatur</div>';
    echo 'IB#<div style="position:absolute;left:85px;top:0px;">'.$info.'</div>#'.$ver;

    
function graph($tnr) {
/******************/
    global $gerarray,$tempz,$info;

    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+1;
        $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;}
        $w=1;
        if (isset($tempz[$z]["max"])) {
            if ($tempz[$z]["max"]>=40) {
                $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p+$tnr*5).'px;background-color:rgb('.$f0.','.($f0/1).','.$f0.');border-style:solid;border-color:rgb('.$f0.','.($f0/1).','.$f0.');font-size:8px;width:'.$w.'px;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+$tnr*5).'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:'.$w.'px;height:'.$h0.'px"></div>';
                }
                else {
                    if ($tempz[$z]["max"]>=35) {
                        $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p+$tnr*5).'px;background-color:rgb('.$f0.','.intval($f0/4).','.$f0.');border-style:solid;border-color:rgb('.$f0.','.intval($f0/4).','.$f0.');font-size:8px;width:'.$w.'px;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+$tnr*5).'px;background-color:rgb('.$f0.',0,0);border-style:solid;border-color:rgb('.$f0.',0,0);font-size:8px;width:'.$w.'px;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+$tnr*5).'px;background-color:rgb('.$f0.','.($f0/2).',0);border-style:solid;border-color:rgb('.$f0.','.($f0/2).',0);font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                }
                                else {
                                    if ($tempz[$z]["max"]>=25) {
                                        $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p+$tnr*5).'px;background-color:rgb('.$f0.','.($f0/1).',0);border-style:solid;border-color:rgb('.$f0.','.($f0/1).',0);font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                    }
                                    else {
                                        if ($tempz[$z]["max"]>=20) {
                                            $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p+$tnr*5).'px;background-color:rgb('.($f0/2).','.$f0.',0);border-style:solid;border-color:rgb('.($f0/2).','.$f0.',0);font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                        }
                                        else {
                                            if ($tempz[$z]["max"]>=10) {
                                                $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p+$tnr*5).'px;background-color:rgb(0,'.$f0.',0);border-style:solid;border-color:rgb(0,'.$f0.',0);font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                            }
                                            else {
                                                if ($tempz[$z]["max"]>=0) {
                                                    $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t.'px;left:'.($p+$tnr*5).'px;background-color:rgb(0,'.$f0.','.$f0.');border-style:solid;border-color:rgb(0,'.$f0.','.$f0.');font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                                }
                                                else {
                                                    if ($tempz[$z]["min"]<=-15) {
                                                        $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.($p+$tnr*5).'px;background-color:rgb('.($f0/2).',0,'.$f0.');border-style:solid;border-color:rgb('.($f0/2).',0,'.$f0.');font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                                    }
                                                    else {
                                                        $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.($p+$tnr*5).'px;background-color:rgb(0,0,'.$f0.');border-style:solid;border-color:rgb(0,0,'.$f0.');font-size:8px;width:'.$w.'px;height:'.$h0.'px"></div>';
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    # Skala
    
    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+0;
        $farben=array('yellow','red','green','blue');
        $f=$farben[$tnr];
        $fl=50;if ($z<=$gerarray["zeith"]) {$fl=75;}
        if ($h0<0) {$t=50+7; $h0=$h0*-1; $t0=$tempz[$z]["max"]*-1+50+7;}
        $w=3;
        
        # Werte
        
        if (isset($tempz[$z]["max"])) {
            $info.='<div id="tab" style="position:absolute;border:1px;top:'.$t0.'px;left:'.($p+$tnr*5).'px;background-color:'.$f.';border-style:solid;border-color:'.$f.';font-size:8px;width:'.$w.'px;height:'.$h.'px"></div>';
        }
    }
    $info.='<div id="text" style="position:absolute;border:1px;top:'.($tnr*14+15).'px;left:510px;text-align:right;width:100px;font-size:14px;color:'.$f.';">'.number_format(sprintf('%.1f',$tempz[24]["min"]),1,",",".").' - '.number_format(sprintf('%.1f',$tempz[24]["max"]),1,",",".").'°C</div>';
}

?>

- - - Aktualisiert - - -

Zufrieden bin ich damit noch nicht...

- - - Aktualisiert - - -

Ich werde einen anderen Weg versuchen und per PHP eiin Bild mit den Skalen erzeugen. Vielleicht ist dies übersichtlicher.
 
Ich glaube auch dass die Einfachheit hier ausschlaggebend sein wird. Wie bekommt man viele Information auf kleinem Raum unter?
 
Grafiken in PHP zu erzeugen ist prinzipiell kein Problem, jedoch die Beschriftung ist es. Es stehen zwar 5 etwas "mikrig kleine" Schriftarten zur Verfügung, doch will man eine normale TTF-Schift verwenden, so muss diese auf dem Pi an bestimmter Stelle vorhanden sein. Das ist dann etwas kompliziert.

Ich suche noch nach anderen Lösungen...

- - - Aktualisiert - - -

Inzwischen ist mir die Idee gekommen, ein png mit einem Grafikprogramm zu erstellen, welches Skalierung und Beschriftung enthält und auf welches man dann mit php die Messpunkte einzeichnet. Es ist auch keine ideale Lösung, aber ein weiterer Ansatzpunkt für das Problem.

Nachtrag: Ist leider auch noch nicht so wirklich das Wahre, da muss ich noch experimentieren. Problem sind Alpha-Channel (transparenz) und Handhabung des PsG. Hier muss ich wohl die interne function-Bibliothek von SaS erweitern...
 
Zuletzt bearbeitet:
hier mein vorläufiger Stand, das ist schon richtig cool, ich denke das kann man auch so lassen, ist hochspannend zu sehen wie sich die Temperatur, Die thermische Desinfektion mache ich jetzt elektrisch.

Einzig die gesamte breite zu nutzen wäre noch toll.

Unbenannt.PNG

psginfoWasserTemp.php
Code:
<?php


    /*
        +---+ +---+ +---+ +---------------------------------------------------+
        ¦     ¦   ¦ ¦     ¦  SensorAndSwitch (C)2014-16 Bluedragon            ¦
        +---+ ¦---¦ +---+ +---------------------------------------------------¦
            ¦ ¦   ¦     ¦ ¦  SAS-PsG (Info)  ¦  psginfoWasserTemp.php         ¦
        +---+ +   + +---+ +---------------------------------------------------¦
        +-----------------¦  Infografik Temp                                  ¦
        ¦  Info:          +---------------------------------------------------¦
        +---------------------------------------------------------------------¦
        ¦  Infoslot                                                           ¦
        +---------------------------------------------------------------------+
    */
 
    include_once __DIR__."/../include/psg.php";


    $ver="V#V 6.00#";
    $name="TempDS18B20_s1";
    $gerarray=getGerInfo($name);
    $tempz=unserialize($gerarray["tempz"]);
    $info ="";
    


    # 10°C-Linien
    
    for ($g=1;$g<=8;$g++) {
        $l=$g*10+1;
        $info.='<div id="tab" style="position:absolute;border:1px;top:'.($l+20).'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+20).'px;left:0px;font-size:10px;width:30px;text-align:right">'.(80-$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"]>=60) {
                $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"]>=55) {
                        $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"]>=50) {
                            $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"]>=47) {
                                $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"]>=43) {
                                    $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"]>=40) {
                                        $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"]>=30) {
                                            $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="&rArr;";
    $w=($tempz[$zh]["max"]+$tempz[$zh]["min"])/2;
    $wv=($tempz[$zvh]["max"]+$tempz[$zvh]["min"])/2;
    if ($wv>$w) {$pfeil='&dArr;';}
    if ($wv<$w) {$pfeil='&uArr;';}
    $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;">Wasser-<br />Temp.</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;
    
?>
 
Die gesamte Breite nutzen geht theoretisch schon, aber Aufwand und Nutzen... naja, da müssten einige Variablen, die für die Aufteilung der Breite verantwortlich sind, neu berechnet und abgeändert werden, dass es insgesamt passt.
 
lass mal, passt erstmal .. wenn ich Zeit habe schaue ich selbst mal rein, diese Woche kommen meine Helligkeitssensoren, dann habe ich damit erst mal zu tun ..
 
Die Variable $p ist übrigens für die Position auf der Breite und $w bzw. width in der style-Angabe für die Breite der Balken verantwortlich.

- - - Aktualisiert - - -

Helligkeitssensor: Das Ausleseprogramm lichti2c ist in der Alpha-Zip mit drin.

- - - Aktualisiert - - -

i2c.jpg
Ausgabe sieht mit info so aus, ansonsten reiner Zahlenwert (Lux).

i2c2.jpg
 
Zuletzt bearbeitet:
neue function digits() in einem PsG:
digits1.jpg
 

Zurzeit aktive Besucher

Statistik des Forums

Themen
244,832
Beiträge
2,219,107
Mitglieder
371,534
Neuestes Mitglied
vignajeanniegolabek
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.