Code: Alles auswählen
<?php
$request1 = file_get_contents("http://192.168.0.4:91/weather.json?user=********&pass=********");
$request2 = file_get_contents("http://192.168.0.4:91/params.json?user=********&pass=********");
$json1 = json_decode($request1, true);
$json2 = json_decode($request2, true);
echo 'Werte eines Oregon Scientific Sensors auf Kanal 2:<br>';
echo $json1['channel2']['temperature'] . '°C';
echo " | ";
echo $json1['channel2']['humidity'] . '%<br><br>';
echo 'Markerzustände aus der params.json:<br>';
echo $json2['marker state'];
$markerzeile = $json2['marker state'];
$marker1 = substr($markerzeile, 0, -31); // 1. Marker
$marker2 = substr($markerzeile, 1, -30); // 2. Marker
echo $marker1;
echo $marker2;
$url = 'http://192.168.0.4:91/control?cmd=typ,it,did,974500,aid,2,acmd,0,seq,6,smk,45,0&user=********&pass=********';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
?>
<form method="post" action="javascript:light_on()" >
<input type="submit" name="licht_an_js" value="Light On JS">
</form>
<form method="post" action="http://192.168.0.4:91/control?user=********&pass=********&cmd=typ,mka,did,5,acmd,1">
<input type="submit" name="marker006_on" value="Marker 6 ein">
</form>
<form method="post" action="http://192.168.0.4:91/control?cmd=typ,mka,did,5,acmd,2&user=********&pass=********">
<input type="submit" name="marker006_off" value="Marker 6 aus">
</form>
<form method="post" action="http://192.168.0.4:91/control?cmd=typ,mka,did,5,acmd,3&user=********&pass=********">
<input type="submit" name="marker006_toggle" value="Marker 6 toggle">
</form>
<form method="post" action="http://192.168.0.4:91/control?cmd=typ,it,did,974500,aid,2,acmd,1,seq,6,smk,45,1&user=********&pass=********">
<input type="submit" name="licht_an" value="Licht an">
</form>
<form method="post" action="http://192.168.0.4:91/control?cmd=typ,it,did,974500,aid,2,acmd,0,seq,6,smk,45,0&user=********&pass=********">
<input type="submit" name="licht_aus" value="Licht aus">
</form>
<form method="post" onSubmit="window.open('http://192.168.0.4:91/control?cmd=typ,it,did,974500,aid,2,acmd,1,seq,6,smk,45,1&user=********&pass=********')">
<input type="submit" name="licht_an_nw" value="Licht an (new window)">
</form>
<form method="post" onSubmit="window.open('http://192.168.0.4:91/control?cmd=typ,it,did,974500,aid,2,acmd,0,seq,6,smk,45,0&user=********&pass=********')">
<input type="submit" name="licht_aus_nw" value="Licht aus (new window)">
</form>
<form method="post" action="http://192.168.0.4:91/control?user=********&pass=********&scene=26">
<input type="submit" name="scene_026" value="Licht an (Scene 26)">
</form>
<form method="post" action="http://192.168.0.4:91/control?user=********&pass=********&scene=27">
<input type="submit" name="scene_027" value="Licht aus (Scene 27)">
</form>
<?php
?>
-->Lightmanager über Portweiterleitung, da dieses sich einen eine Sub-Netzwerk befindet
Marker setzen funktioniert bei mir leider nicht. Weder über Light Manager Studio noch per HTTP Request