<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hallo Zusammen,<br>
<br>
Ein Ausschnitt aus dem PHP-Script, mit dem z.B. die
Speichertemparatur in die VZ-Database geschrieben wird:<br>
<br>
<b>Quelltext Ausschnitt:</b><br>
<br>
<span class="html-tag" style="font-family: monospace; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"><tr></span><span
class="html-tag" style="font-family: monospace; font-size: medium;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"><td></span><span
class="html-tag" style="font-family: monospace; font-size: medium;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"><a <span
class="html-attribute-name">id</span>="<span
class="html-attribute-value">1</span>" <span
class="html-attribute-name">name</span>="<span
class="html-attribute-value">1</span>" <span
class="html-attribute-name">href</span>="<a
class="html-attribute-value html-external-link" target="_blank"
href="http://10.0.0.22/info.rsp?sessionid=FAF30325&branchnr=1&level=3">info.rsp?sessionid=xxxxxxxx&branchnr=1&level=3</a>"></span><span
style="color: rgb(0, 0, 0); font-family: monospace; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none;">Speicher 31.0 °C</span><span class="html-tag"
style="font-family: monospace; font-size: medium; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: pre-wrap;
widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></a></span><span
class="html-tag" style="font-family: monospace; font-size: medium;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"></td></span><span
style="color: rgb(0, 0, 0); font-family: monospace; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none;"><br>
<br>
</span><br>
<span style="color: rgb(0, 0, 0); font-family: monospace; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none;"><b><font face="Helvetica, Arial, sans-serif">PHP-Script:<br>
<br>
</font></b><font face="Helvetica, Arial, sans-serif"><?php<br>
<br>
// sessionid parsen:<br>
<br>
$_quelltext = file_get_contents(<a class="moz-txt-link-rfc2396E" href="http://10.1.0.22">"http://10.1.0.22"</a>);<br>
if(preg_match("/(sessionid)=([0-9A-Z]+)/",$_quelltext,
$_treffer_id1));<br>
//echo '<pre>'.print_r($_treffer_id1,
TRUE).'</pre>';<br>
$_id1 = $_treffer_id1[2];<br>
//echo $_id1;<br>
<br>
sleep(1);<br>
<br>
// URL Istwerte aufrufen<br>
<br>
$_url_istwert_1 = <a class="moz-txt-link-rfc2396E" href="http://10.1.0.22/menue.rsp?sessionid=">"http://10.1.0.22/menue.rsp?sessionid="</a>;<br>
$_url_istwert_2 = $_id1;<br>
$_url_istwert_3 = "&branchnr=1&level=3";<br>
$_url_istwert_komplett =
$_url_istwert_1.$_url_istwert_2.$_url_istwert_3;<br>
$_quelltext_istwert =
file_get_contents("$_url_istwert_komplett");<br>
//echo $_quelltext_istwert;<br>
<br>
// Temparatur Speicher oben Warmwasser </font></span><span
style="color: rgb(0, 0, 0); font-family: monospace; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none;"><font face="Helvetica, Arial, sans-serif"><span
style="color: rgb(0, 0, 0); font-family: monospace; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: pre-wrap; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important;
float: none;"><font face="Helvetica, Arial, sans-serif">parsen<br>
<br>
</font></span>if(preg_match("/(\bSpeicher\b).+
([0-9]+)\.([0-9])\ (°C)/", $_quelltext_istwert,
$_treffer_temp_speicher));<br>
//echo '<pre>'.print_r($_treffer_temp_speicher,
TRUE).'</pre>';<br>
$_temp_speicher_10er = $_treffer_temp_speicher[2];<br>
$_temp_speicher_1er = $_treffer_temp_speicher[3];<br>
$_temp_speicher_komplett =
"$_temp_speicher_10er.$_temp_speicher_1er";<br>
echo $_temp_speicher_komplett;<br>
<br>
// Daten mit dem vzclient in die VZ-Database schreiben<br>
<br>
$_vzclient_speicher_befehl_1 = "vzclient -u
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx add data value=";<br>
$_vzclient_speicher_befehl_2 = $_temp_speicher_komplett;<br>
$_vzclient_speicher_befehl_komplett =
$_vzclient_speicher_befehl_1.$_vzclient_speicher_befehl_2;<br>
<br>
$output = shell_exec($_vzclient_speicher_befehl_komplett);<br>
echo $output;<br>
?></font><b><font face="Helvetica, Arial, sans-serif"><br>
<br>
<br>
</font></b> </span>Gruss Reto<br>
<br>
<div class="moz-cite-prefix">Am 29.04.2015 um 17:59 schrieb
sollner11:<br>
</div>
<blockquote
cite="mid:5709DAA6-9735-41E1-9ADE-6D30DC7BCB50@macpat.de"
type="cite">
<pre wrap="">Könntest du das noch ein wenig ausführlicher beschreiben?
Danke!
</pre>
<blockquote type="cite">
<pre wrap="">Am 27.04.2015 um 21:53 schrieb Reto <a class="moz-txt-link-rfc2396E" href="mailto:reto.roelli@gmx.ch"><reto.roelli@gmx.ch></a>:
Hallo Andreas,
Habe es jetzt am laufen :) Die Geschichte ist mit PHP umgesetzt.
1. Quelltext einlesen
mittels file_get_contents(.......)
2. Die gewünschten Werte "herausschälen"
mittels if(preg_match.................))
3. mit dem vzclient die "herausgeschälten" Werte in die DB des volkszählers schreiben
Gruss Reto
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>