Hallo zusammen,
ich wollte nach diesem Beispiel in der Doku (http://www.ip-symcon.de/service/dokumentation/vorgehensweisen/skripte-wiederverwenden/) ein Teil des Skripts auslagern, aber irgendwie bekomme ich das nicht hin.
Rollo Ankleide auf 50% (SkriptID: 53208):
<?
$homepilotIp = 'homepilot.local';
$deviceID='10015';
$cmd = '9';
$pos='50';
includeScript(16905 /*[HomePilot\HomePilot Schnittstelle]*/);
function includeScript($scriptID) {
$s = IPS_GetScript($scriptID);
include($s['ScriptFile']);
}
?>
HomePilot Schnittstelle (SkriptID: 1695):
<?
$ch = curl_init('http://'.homepilotIp.'/deviceajax.do');
curl_setopt($ch, CURLOPT_POSTFIELDS, "cid={$cmd}&did={$deviceID}&goto={$pos}&command=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
print_r (json_decode($result));
curl_Close($ch);
?>
Fehlerausgabe:
Notice: Use of undefined constant homepilotIp - assumed ‚homepilotIp‘ in C:\IP-Symcon\scripts\16905.ips.php on line 25
Notice: Undefined variable: cmd in C:\IP-Symcon\scripts\16905.ips.php on line 26
Notice: Undefined variable: deviceID in C:\IP-Symcon\scripts\16905.ips.php on line 26
Normalerweise müsste er doch jetzt die Variablendeklarationen aus SkriptID: 53208 nehmen, oder nicht?
Gruß Basti