<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hallo Jan,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>vielen Dank. Habe es jetzt doch per PHP versucht, da ich über die direkte Verbindung vom ESP8266 keine 2 Verbindungen aufgebaut bekomme bzw. 2 Werte gleichzeitig geschrieben bekomme.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Leider hagt es noch und es wird nichts in die Datenbank geschrieben.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Vermute das meine Links noch nicht sauber sind, aber sicher bin ich nicht und habe schon etliche Versuche durch. Wie sollte der Link aussehen? (die php-Datei (heizung.php) liegt im gleichen Ordner wie die middleware.php -> htdocs):<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>$link = "http://192.168.7.6/var/www/volkszaehler.org/htdocs/middleware.php/data/$uuid.json?operation=add&value=$var";<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>$link = "http://192.168.7.6/volkszaehler.org/htdocs/middleware.php/data/$uuid.json?operation=add&value=$var";<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>$link = "http://192.168.7.6/middleware.php/data/$uuid.json?operation=add&value=$var";<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Habt Ihr hier eine Idee?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Danke und Grüße<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ralf<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> volkszaehler-users [mailto:volkszaehler-users-bounces@demo.volkszaehler.org] <b>Im Auftrag von </b>Jan Goe<br><b>Gesendet:</b> Samstag, 10. Oktober 2015 20:37<br><b>An:</b> volkszaehler.org - users<br><b>Betreff:</b> Re: [vz-users] PHP Nachhilfe<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hallo Ralf,<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>ich sende bei mir auch temperaturen über den ESP an ein php skript und dann zu vz und gleichzeitig zu shc <br><br><o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>php skript:<br><?php<br>$temp1 = $_GET[temp1];<br>$temp2 = $_GET[temp2];<br><br># e067e9c0-35eb-11e5-86d4-8f6d44079040 zirkulation<br># d7629af0-35eb-11e5-a340-cf6ca39ee085 warmwasser<br><br>send_to_vz("e067e9c0-35eb-11e5-86d4-8f6d44079040", $temp1);<br>temp_to_shc($temp1,"031551595azz");<br>send_to_vz("d7629af0-35eb-11e5-a340-cf6ca39ee085", $temp2);<br>temp_to_shc($temp2,"031551595aww");<br><br>function send_to_vz($uuid,$var)<br>{<br>$link = "<a href="http://192.168.0.54/vz/htdocs/middleware.php/data/$uuid.json?operation=add&value=$var">http://192.168.0.54/vz/htdocs/middleware.php/data/$uuid.json?operation=add&value=$var</a>";<br>$result = file_get_contents($link);<br>}<br>function temp_to_shc($temp,$name)<br>{<br>echo "shc: $wire1 @ $temp";<br>$send = file_get_contents("<a href="http://192.168.0.54/shc/index.php?app=shc&a&ajax=pushsensorvalues&spid=3&sid=28-$name&type=1&v1=$temp">http://192.168.0.54/shc/index.php?app=shc&a&ajax=pushsensorvalues&spid=3&sid=28-$name&type=1&v1=$temp</a>");<br>echo"Status: $send";<br>}<br><br>?><br><br><o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>bsp aufruf im esp über temp.php?temp1=25.0&temp2=25.0<o:p></o:p></p></div><div><p class=MsoNormal>gruß<o:p></o:p></p></div><div><p class=MsoNormal>jan<o:p></o:p></p></div><div><div><p class=MsoNormal><o:p> </o:p></p></div></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Am 10. Oktober 2015 um 20:08 schrieb Alexander Finkhäuser <<a href="mailto:alex@elaon.de" target="_blank">alex@elaon.de</a>>:<o:p></o:p></p><div><p class=MsoNormal>So kann man es z.b. auf einem Raspberry pi machen: da werden die Daten mit PHP ausgelesen und dann per PHP geschickt. Musst dir dann nur den teil an gucken wie man es schickt. Ist eigentlich nicht schwer.<br><br><a href="https://m.youtube.com/?gl=DE&hl=de#/watch?v=gVRCDQw7EFE" target="_blank">https://m.youtube.com/?gl=DE&hl=de#/watch?v=gVRCDQw7EFE</a><br><br>Dein script da holt die Daten von dem ESP ab in dem auf dem ein Webserver mit den Daten angeboten wird. Und genau er holt sich das bei dem ab und diese tpl Datei bietet das irgendwie an. Ich weiß nicht wie. <br><br><br>LG<br>Alex<o:p></o:p></p><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>Am 10. Oktober 2015 19:49:30 MESZ, schrieb Ralf Wismann <<a href="mailto:ralf.wismann@gmx.de" target="_blank">ralf.wismann@gmx.de</a>>:<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hallo Zusammen,<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>ich würde gerne Temperaturwerte (DS18B20) die Wireless(ESP8266) geschickt werden in die Volkszähler-Datenbank aufnehmen.<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Leider gibt es nicht viele Beispiele um mich dort spezifisch einlesen zu können, darum die Frage an Euch. Ich kann/kenne praktisch kein PHP und würde mich über einen Verständnisabgleich sehr freuen.  Dies ist ein Code für einen DHT22 Sensor mit ESP8266 .<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Die PHP Datei ist im www Ordner des Volkszählers abzulegen. Wenn ich das richtig verstehe holt diese Datei sich aber Informationen und bekommt sie nicht über eine Connection vom ESP8266 gesendet. Ist das richtig verstanden? Könnt Ihr sagen, wie diese dht22.tpl zu verstehen ist?  <o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Vielen Dank und Grüße<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Ralf<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><?php<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    while(true) {<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>        $html = file_get_contents('<a href="http://1.2.3.4/dht22.tpl'" target="_blank">http://1.2.3.4/dht22.tpl'</a>);<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>        if(preg_match('/temperature reading is ([\d\.]+)\*C, humidity is ([\d\.]+) ./', $html, $match)) {<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>            vz_add('**UUID_TEMPERATUR**', $match[1]);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>            vz_add('**UUID_FEUCHTE**', $match[2]);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>        }<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>        echo '--'."\n";<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>        sleep(10);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    }<o:p></o:p></p><p> <o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>function vz_add($id, $val) {<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    $url='<a href="http://vzserver/middleware.php/data/'.$id.'.json?operation=add&value='.$val" target="_blank">http://vzserver/middleware.php/data/'.$id.'.json?operation=add&value='.$val</a>;<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    var_dump($url);<o:p></o:p></p><p> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    $cmd = 'wget -O - '.escapeshellarg($url).' > /dev/null 2>/dev/null &';<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    exec($cmd);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>}<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>?><o:p></o:p></p></div></div></div></div></div></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>