Im Anhang ist ein kleines Skript, womit man den Winkel einer Jealousie direkt verändern kann. Wie gesagt, dS empfiehlt es nicht zu verwenden, weil zwei Geräte Befehle stattfinden.
Zur Vorbereitung muss man zwingend diese neue dS Expert Instanz erstellen. Was Programm fragt zuerst die Position der Klemme dsid ab. Dann wird die Scene mit sceneID mit der aktuellen Position und dem gewünschten Winkel (angle) auf die Geräte Klemme definiert. Im letzten Schritt wird dann die Scene mit SceneID aufgerufen.
Ich gehe davon aus, dass Ihr untiges Skript auch mit einer Variable aus dem WebFront verbinden könnt und diese dann dem Skript übergeben.
PHP-Code:
$Expert_id=59672 /*[dS Apartment\dS Expert]*/;//symcon ID for Expert instance;
$dsid="303505d7f8000f0000088295";
$debug=false;
$sceneID=4; //Irgend eine Nummer wird benötigt;
$angle=40;
$zone=25581 /*[1. OG\Büro Martin\1. OG - Büro Martin - Rolladen]*/;//symcon id for zone instance;
//*************************************************************************************************;
//1. Step Find out the current position of the blind;
$Call1=DS_MakeRequest($Expert_id, "device/getOutputValue", "dsid=".$dsid."&offset=0");
$a=json_decode($Call1,true);
$value=$a['value'];
if ($debug) echo $Call1;
if ($debug) echo $value;
$position=257*$value;
//2. Step Define the scene for a dS Device with the desired angle at the current position;
DS_MakeRequest($Expert_id, "device/setSceneValue", "dsid=".$dsid."&sceneID=".$sceneID."&value=".$position."&angle=".$angle);
//3. Step Call the Scene. As an option you can only call the scene for the device dsid. It is better to avoid an additional device order.
DS_CallScene($zone ,$sceneID);
Geändert von msiegw (12.10.19 um 07:38 Uhr)
dS, Revox voxnet, Feller, 2n Helios, worx, IP-Symcon unlimited