Frage zum Shuttermodul

Hi also mal zu den Gegebenheiten, steuere meine Rollos (LCN) über das Shutter Modul klappt soweit ganz gut, da ich nicht auf die einzelne Visualisierung verzichten möchte und LCN ned so wirklich im Shadowing realisiert bekommen habe möchte ich, die Shuttermodul Instanzen in das Shadowing Script einbauen…
Nutze diesen Code:

<?

//Variables provided by ShutterControl Module
//IPS_LogMessage("InstanceID", $SC_INSTANCE); /* InstanceID */
//IPS_LogMessage("Direction", $SC_DIRECTION); /* {0..2} Stop, Up, Down */
//IPS_LogMessage("Duration", $SC_DURATION); /* ms */

switch($IPS_SENDER)
{

case "ShutterControl": //Script wurde vom Shuttermodul aufgerufen

define("SC_DIRECTION_STOP", 0);
define("SC_DIRECTION_UP", 1);
define("SC_DIRECTION_DOWN", 2);

$instance = IPS_GetInstance($SC_INSTANCE);
switch($instance['ModuleInfo']['ModuleID'])
{
  case "{48FCFDC1-11A5-4309-BB0B-A0DB8042A969}": //FS20
      $running = CreateVariableByName($SC_INSTANCE, "Moving", 0);
      $value = GetValue(IPS_GetStatusVariableID($SC_INSTANCE, "StatusVariable"));
      switch($SC_DIRECTION)
      {
         case SC_DIRECTION_STOP:
          if(GetValue($running))
          {
              FS20_SwitchMode($SC_INSTANCE, $value);
              SetValue($running, false);
          }
          break;
         case SC_DIRECTION_UP:
          if(!GetValue($running))
          {
              FS20_SwitchMode($SC_INSTANCE, true);
              SetValue($running, true);
          }
          if($SC_DURATION > 999)
          {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "FS20U");
          }
          if($SC_DURATION > 0 and $SC_DURATION <=999)
          {
              IPS_Sleep($SC_DURATION);
              FS20_SwitchMode($SC_INSTANCE, true);
              SetValue($running, false);
          }
          break;
         case SC_DIRECTION_DOWN:
          if(!GetValue($running))
          {
              FS20_SwitchMode($SC_INSTANCE, false);
              SetValue($running, true);
          }
          if($SC_DURATION > 999)
          {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "FS20D");
          }
          if($SC_DURATION > 0 and $SC_DURATION <=999)
          {
              IPS_Sleep($SC_DURATION);
              FS20_SwitchMode($SC_INSTANCE, false);
              SetValue($running, false);
          }
          break;
      }
      break;
  case "{1B7B5B7D-CAA9-4AB5-B9D8-EC805EC955AD}": //xComfort
      switch($SC_DIRECTION)
      {
         case SC_DIRECTION_STOP:
          MXC_ShutterStop($SC_INSTANCE);
          break;
         case SC_DIRECTION_UP:
          MXC_ShutterMoveUp($SC_INSTANCE);
          if($SC_DURATION > 999)
          {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "XCOM");
          }
          if($SC_DURATION > 0 and $SC_DURATION <= 999)
          {
              IPS_Sleep($SC_DURATION);
              MXC_ShutterStop($SC_INSTANCE);
          }
          break;
         case SC_DIRECTION_DOWN:
          MXC_ShutterMoveDown($SC_INSTANCE);
          if($SC_DURATION > 999)
          {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "XCOM");
          }
          if($SC_DURATION > 0 and $SC_DURATION <= 999)
          {
              IPS_Sleep($SC_DURATION);
              MXC_ShutterStop($SC_INSTANCE);
          }
          break;
      }
      break;
      case "{2D871359-14D8-493F-9B01-26432E3A710F}": //LCN
      $type=LCN_GetUnit($SC_INSTANCE);
        switch($type)
        {
            case 0: //Ausgänge

                switch($SC_DIRECTION)
              {
             case SC_DIRECTION_STOP:
             LCN_SetIntensity($SC_INSTANCE,0,0);
              LCN_SetIntensity($SC_INSTANCE2,0,0);
              break;
             case SC_DIRECTION_UP:
              LCN_SetIntensity($SC_INSTANCE,100,4);
              if($SC_DURATION > 999)
              {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "LCNA");
              }
              if($SC_DURATION > 0 and $SC_DURATION <= 999)
              {
              IPS_Sleep($SC_DURATION);
              LCN_SetIntensity($SC_INSTANCE,0,0);
              }
              break;
             case SC_DIRECTION_DOWN:
              LCN_SetIntensity($SC_INSTANCE2,100,4);
              if($SC_DURATION > 999)
              {
              TimerDelay($SC_INSTANCE2, $SC_DURATION, "LCNA");
              }
              if($SC_DURATION > 0 and $SC_DURATION <= 999)
              {
              IPS_Sleep($SC_DURATION);
              LCN_SetIntensity($SC_INSTANCE2,0,0);
              }
              break;
              }
          break;

          case 2: //Relais
          switch($SC_DIRECTION)
              {
             case SC_DIRECTION_STOP:
             LCN_SwitchRelay($SC_INSTANCE,false);
              break;
             case SC_DIRECTION_UP:
              LCN_SwitchRelay($SC_INSTANCE,true);
              LCN_SwitchRelay($SC_INSTANCE2,false); // Um Relaisrichtung zu ändern bitte auf true
              if($SC_DURATION > 999)
              {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "LCNR");
              }
              if($SC_DURATION > 0 and $SC_DURATION <= 999)
              {
              IPS_Sleep($SC_DURATION);
              LCN_SwitchRelay($SC_INSTANCE, false);
              }
              break;
             case SC_DIRECTION_DOWN:
              LCN_SwitchRelay($SC_INSTANCE,true);
              LCN_SwitchRelay($SC_INSTANCE2,true);// Um Relaisrichtung zu ändern bitte auf false
              if($SC_DURATION > 999)
              {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "LCNR");
              }
              if($SC_DURATION > 0 and $SC_DURATION <= 999)
              {
              IPS_Sleep($SC_DURATION);
              LCN_SwitchRelay($SC_INSTANCE, false);
              }
              break;
              }
          break;
            }
          break;
  case "{9317CC5B-4E1D-4440-AF3A-5CC7FB42CCAA}": //1-Wire Shutter
      switch($SC_DIRECTION)
      {
         case SC_DIRECTION_STOP:
           OneWireShutter($SC_INSTANCE, 0, $SC_DURATION);
          break;
         case SC_DIRECTION_UP:
           if($SC_DURATION == 0)
             $SC_DURATION = 120000;
           OneWireShutter($SC_INSTANCE, 0, $SC_DURATION);
          break;
         case SC_DIRECTION_DOWN:
           if($SC_DURATION == 0)
             $SC_DURATION = 120000;
           OneWireShutter($SC_INSTANCE, 1, $SC_DURATION);
          break;
      }
    break;
    case "{EE4A81C6-5C90-4DB7-AD2F-F6BBD521412E}": //Homematic Shutter
      switch($SC_DIRECTION)
      {
         case SC_DIRECTION_STOP:
              HM_WriteValueBoolean($SC_INSTANCE, "STOP", true);
          break;
         case SC_DIRECTION_UP:
              HM_WriteValueFloat($SC_INSTANCE, "LEVEL", 1.0);
          if($SC_DURATION > 999)
          {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "HOME");
          }
          if($SC_DURATION > 0 and $SC_DURATION <=999)
          {
              IPS_Sleep($SC_DURATION);
              HM_WriteValueBoolean($SC_INSTANCE, "STOP", true);
          }
           break;
         case SC_DIRECTION_DOWN:
              HM_WriteValueFloat($SC_INSTANCE, "LEVEL", 0.0);
          if($SC_DURATION > 999)
          {
              TimerDelay($SC_INSTANCE, $SC_DURATION, "HOME");
          }
          if($SC_DURATION > 0 and $SC_DURATION <=999)
          {
              IPS_Sleep($SC_DURATION);
              HM_WriteValueBoolean($SC_INSTANCE, "STOP", true);
          }
           break;
      }
    break;
  default:
    die("No Handler for Module ".$instance['ModuleInfo']['ModuleName']." found");
}
break;

case "TimerEvent": //Script wurde von einem Ereignis aufgerufen

IPS_SetEventActive($IPS_EVENT, false);    //Ereignis deaktivieren
$timer=IPS_GetName($IPS_EVENT);
$SCT_INSTANCE = intval(substr($timer,-5,5));
$bus = substr($timer,0,-5);

    switch ($bus)
    {
    case "LCNA":
    LCN_SetIntensity($SCT_INSTANCE,0,0);
    break;

    case "LCNR":
    LCN_SwitchRelay($SCT_INSTANCE,false);
    break;

    case "XCOM":
    MXC_ShutterStop($SCT_INSTANCE);
    break;

    case "HOME":
    HM_WriteValueBoolean($SCT_INSTANCE, "STOP", true);
    break;

    case "FS20U":
    $running = CreateVariableByName($SCT_INSTANCE, "Moving", 0);
        FS20_SwitchMode($SCT_INSTANCE, true);
       SetValue($running, false);
    break;

    case "FS20D":
    $running = CreateVariableByName($SCT_INSTANCE, "Moving", 0);
       FS20_SwitchMode($SCT_INSTANCE, false);
      SetValue($running, false);
    break;

    }



break;
}


function OneWireShutter($ins, $dir, $sec) {
   @TMEX_F29_SetStrobe($ins, True);
   $res = ($dir * 128) + ($sec / 1000);
   @TMEX_F29_SetPort((integer)$ins, (integer)$res);
}

function TimerDelay($id, $time, $bus) {
    global $IPS_SELF;
    $sekunden=intval(substr($time, 0,-3));
   $msekunden=substr($time, -3, 3);
   $timerid = IPS_GetObjectIDByName($bus.$id, $IPS_SELF);
    if ($timerid ==0)
    {
    $newtimer = IPS_CreateEvent(1);
//   IPS_SetEventScript($newtimer, $IPS_SELF); //alt Aktuelles Skript aufrufen
   IPS_SetParent($newtimer, $IPS_SELF); //ab V2_1 Aktuelles Skript aufrufen
   IPS_SetName($newtimer, $bus.$id);
   IPS_Sleep(intval($msekunden));
   IPS_SetEventCyclic($newtimer, 0, 0, 0, 0, 1, $sekunden);
    IPS_SetEventCyclicDateBounds($newtimer, 0, 0);
    IPS_SetEventCyclicTimeBounds($newtimer, time(), 0);
    IPS_SetEventActive($newtimer, true);    //Ereignis aktivieren
   }
   else
   {
   IPS_Sleep(intval($msekunden));
   IPS_SetEventCyclic($timerid, 0, 0, 0, 0, 1, $sekunden);
    IPS_SetEventCyclicDateBounds($timerid, 0, 0);
    IPS_SetEventCyclicTimeBounds($timerid, time(), 0);
    IPS_SetEventActive($timerid, true);    //Ereignis aktivieren
   }
}

function CreateVariableByName($id, $name, $type)
{
   global $IPS_SELF;
   $vid = @IPS_GetVariableIDByName($name, $id);
   if($vid===false) {
     $vid = IPS_CreateVariable($type);
     IPS_SetParent($vid, $id);
     IPS_SetName($vid, $name);
     IPS_SetInfo($vid, "This Variable was created by Script #$IPS_SELF");
   }
   return $vid;
}

?>

Da der aus der Doku bei mir nicht funzt sondern immer nur ausgibt das er nur mit dem Modul Ausführbar ist was ich jedoch versuche naja…

Aber nun zu meinem Problem:
Habe ein Velux Dachfenster mit elektrischen Rollo, welches ich über das VeluxInterface steuere. Wer das Velux Interface kennt weiß es handelt sich um eine One Touch Bedienung, d.h.
einmal Relais betätigen z.B für 0,3 s Runter
nochmal Relais betätigen STOP
nochmal Relais betätigen Rauf
u.s.w
Als Relais nutze ich eins von LCN. Hat jemand ne Idee wie ich da das Script ändern muß das eine Vernünftige Positionssteuerung herrauskommt??
MfG,
Martin

scheint mir so recht unhandlich - Velux Motoren sind sehr handzahm, wenn sie einen Entstörkondensator bekommen. Der hindert sie daran, sich mit anderen Veluxmotoren „auszuquatschen“. Der einfachste (und auch noch billigste) Weg zur Ansteuerung: Zwei Schaltausgänge eines beliebigen Bussystems - Ausgang 1 schaltet die Stuerspannung +24V (beliebiger Hutschienentrafo mit 0,5-1A Leistung, bei mehreren Elementen lieber 2 davon parallel) ein/aus. Ausgang 2 schaltet ein Relais (2xWechsler) als Polwenderelais. Luke dicht: Instanz 1 -> true, Instanz 2 -> false; Luke auf: Instanz 1 true, Instanz 2 true; stop: Instanz 1 -> false
Bei mir laufen damit 8 Motoren (4 Shutter und 4 Fensterantriebe) problemlos.

Falls die Motoren bereits an irgendeiner Velux-Steuerung angelernt waren, brauchen sie ein Reset in den Auslieferungszustand.

nette Grüße
Sven

Hallo,
muss das Thema leider nochmal hochziehen. Stelle gerade auf Version 4.0 auf eine Raspberry um. Versuche jetzt das Script aus der Dokumentation zu nuten da meine anderen Varianten auch nicht funktionieren unter der neuen Version.

//Variables provided by ShutterControl Module
//IPS_LogMessage("InstanceID", $_IPS['INSTANCE']); /* InstanceID */
//IPS_LogMessage("Direction", $_IPS['DIRECTION']); /* {0..2} Stop, Up, Down */
//IPS_LogMessage("Duration", $_IPS['DURATION']); /* ms */
*
if($_IPS['SENDER'] != "ShutterControl")
    die("This script can only be started by the ShutterControl Module");
*
define("SC_DIRECTION_STOP", 0);
define("SC_DIRECTION_UP", 1);
define("SC_DIRECTION_DOWN", 2);
*
$instance = IPS_GetInstance($_IPS['INSTANCE']);
switch($instance['ModuleInfo']['ModuleID'])
{
    case "{48FCFDC1-11A5-4309-BB0B-A0DB8042A969}": //FS20
        $running = CreateVariableByName($_IPS['INSTANCE'], "Moving", 0);
        $value = GetValue(IPS_GetObjectIDByIdent("StatusVariable", $_IPS['INSTANCE']));
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                if(GetValue($running))
                {
                    FS20_SwitchMode($_IPS['INSTANCE'], $value);
                    SetValue($running, false);
                }
                break;
            case SC_DIRECTION_UP:
                if(!GetValue($running))
                {
                    FS20_SwitchMode($_IPS['INSTANCE'], true);
                    SetValue($running, true);
                }
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    FS20_SwitchMode($_IPS['INSTANCE'], true);
                    SetValue($running, false);
                }
                break;
            case SC_DIRECTION_DOWN:
                if(!GetValue($running))
                {
                    FS20_SwitchMode($_IPS['INSTANCE'], false);
                    SetValue($running, true);
                }
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    FS20_SwitchMode($_IPS['INSTANCE'], false);
                    SetValue($running, false);
                }
                break;
        }
        break;
    case "{1463CAE7-C7D5-4623-8539-DD7ADA6E92A9}": //EnOcean
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                ENO_ShutterStop($_IPS['INSTANCE']);
                break;
            case SC_DIRECTION_UP:
                ENO_ShutterMoveUp($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    ENO_ShutterStop($_IPS['INSTANCE']);
                }
                break;
            case SC_DIRECTION_DOWN:
                ENO_ShutterMoveDown($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    ENO_ShutterStop($_IPS['INSTANCE']);
                }
                break;
        }
        break;            
    case "{3DDA1E2B-B807-4680-AB6D-E7E8FBD6093A}": //digitalStrom
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                DS_ShutterStop($_IPS['INSTANCE']);
                break;
            case SC_DIRECTION_UP:
                DS_ShutterMoveUp($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    DS_ShutterStop($_IPS['INSTANCE']);
                }
                break;
            case SC_DIRECTION_DOWN:
                DS_ShutterMoveDown($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    DS_ShutterStop($_IPS['INSTANCE']);
                }
                break;
        }
        break;             
    case "{1B7B5B7D-CAA9-4AB5-B9D8-EC805EC955AD}": //xComfort
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                MXC_ShutterStop($_IPS['INSTANCE']);
                break;
            case SC_DIRECTION_UP:
                MXC_ShutterMoveUp($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    MXC_ShutterStop($_IPS['INSTANCE']);
                }
                break;
            case SC_DIRECTION_DOWN:
                MXC_ShutterMoveDown($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    MXC_ShutterStop($_IPS['INSTANCE']);
                }
                break;
        }
        break;
    case "{2D871359-14D8-493F-9B01-26432E3A710F}": //LCN Unit
        $type=IPS_GetProperty($_IPS['INSTANCE'],'Unit');
        switch($type)
        {
            case 0: //Ausgänge
                switch($_IPS['DIRECTION'])
                {
                    case SC_DIRECTION_STOP:
                        LCN_SetIntensity($_IPS['INSTANCE'],0,0);
                        LCN_SetIntensity($_IPS['INSTANCE2'],0,0);
                        break;
                    case SC_DIRECTION_UP:
                        LCN_SetIntensity($_IPS['INSTANCE'],100,4);
                        if($_IPS['DURATION'] > 0)
                        {
                        IPS_Sleep($_IPS['DURATION']);
                        LCN_SetIntensity($_IPS['INSTANCE'],0,0);
                        }
                        break;
                    case SC_DIRECTION_DOWN:
                        LCN_SetIntensity($_IPS['INSTANCE2'],100,4);
                        if($_IPS['DURATION'] > 0)
                        {
                        IPS_Sleep($_IPS['DURATION']);
                        LCN_SetIntensity($_IPS['INSTANCE2'],0,0);
                        }
                        break;
                }
                break;
            case 2: //Reais
                switch($_IPS['DIRECTION'])
                {
                    case SC_DIRECTION_STOP:
                        LCN_SwitchRelay($_IPS['INSTANCE'],false);
                        break;
                    case SC_DIRECTION_UP:
                        LCN_SwitchRelay($_IPS['INSTANCE2'],false); // Um Relaisrichtung zu ändern bitte auf true
                        LCN_SwitchRelay($_IPS['INSTANCE'],true);
                        if($_IPS['DURATION'] > 0)
                        {
                            IPS_Sleep($_IPS['DURATION']);
                            LCN_SwitchRelay($_IPS['INSTANCE'],false);
                        }
                        break;
                    case SC_DIRECTION_DOWN:
                        LCN_SwitchRelay($_IPS['INSTANCE2'],true);// Um Relaisrichtung zu ändern bitte auf false
                        LCN_SwitchRelay($_IPS['INSTANCE'],true);
                        if($_IPS['DURATION'] > 0)
                        {
                            IPS_Sleep($_IPS['DURATION']);
                            LCN_SwitchRelay($_IPS['INSTANCE'],false);
                        }
                        break;
                }
                break;
        }
        break;
    case "{C81E019F-6341-4748-8644-1C29D99B813E}": //LCN Shutter
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                LCN_ShutterStop($_IPS['INSTANCE']);
                break;
            case SC_DIRECTION_UP:
                LCN_ShutterMoveUp($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    LCN_ShutterStop($_IPS['INSTANCE']);
                }
                break;
            case SC_DIRECTION_DOWN:
                LCN_ShutterMoveDown($_IPS['INSTANCE']);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    LCN_ShutterStop($_IPS['INSTANCE']);
                }
                break;
        }
        break;            
    case "{BD0F2622-F67C-4248-9A04-316DF13914C3}":  //1-Wire Shutter Modul (e-service Online)
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                OW_SetPin($_IPS['INSTANCE'], 0, true);
                OW_SetPin($_IPS['INSTANCE'], 1, true);
                IPS_Sleep(100);
                OW_SetPin($_IPS['INSTANCE'], 0, false);
                OW_SetPin($_IPS['INSTANCE'], 1, false);
                break;
            case SC_DIRECTION_UP:
                OW_SetPin($_IPS['INSTANCE'], 0, true);
                IPS_Sleep(100);
                OW_SetPin($_IPS['INSTANCE'], 0, false);
*
                if($_IPS['DURATION'] > 0)
                {
                    OW_SetPin($_IPS['INSTANCE'], 0, true);
                    OW_SetPin($_IPS['INSTANCE'], 1, true);
                    IPS_Sleep(100);
                    OW_SetPin($_IPS['INSTANCE'], 0, false);
                    OW_SetPin($_IPS['INSTANCE'], 1, false);
                }
                break;
            case SC_DIRECTION_DOWN:
                OW_SetPin($_IPS['INSTANCE'], 1, true);
                IPS_Sleep(100);
                OW_SetPin($_IPS['INSTANCE'], 1, false);
*
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    OW_SetPin($_IPS['INSTANCE'], 0, true);
                    OW_SetPin($_IPS['INSTANCE'], 1, true);
                    IPS_Sleep(100);
                    OW_SetPin($_IPS['INSTANCE'], 0, false);
                    OW_SetPin($_IPS['INSTANCE'], 1, false);
                }
                break;
        }
      break;
    case "{6A75828A-25CD-4CF3-83EA-DAAB914030A7}": //1-Wire Shutter (1-wire.de)
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                OneWireShutter($_IPS['INSTANCE'], 0, $_IPS['DURATION']);
                break;
            case SC_DIRECTION_UP:
                if($_IPS['DURATION'] == 0)
                    $_IPS['DURATION'] = 120000;
                OneWireShutter($_IPS['INSTANCE'], 0, $_IPS['DURATION']);
                break;
            case SC_DIRECTION_DOWN:
                if($_IPS['DURATION'] == 0)
                    $_IPS['DURATION'] = 120000;
                OneWireShutter($_IPS['INSTANCE'], 1, $_IPS['DURATION']);
                break;
        }
        break;
    case "{EE4A81C6-5C90-4DB7-AD2F-F6BBD521412E}": //Homematic Shutter
        switch($_IPS['DIRECTION'])
        {
            case SC_DIRECTION_STOP:
                HM_WriteValueBoolean($_IPS['INSTANCE'], "STOP", true);
                break;
            case SC_DIRECTION_UP:
                HM_WriteValueFloat($_IPS['INSTANCE'], "LEVEL", 1.0);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    HM_WriteValueBoolean($_IPS['INSTANCE'], "STOP", true);
                }
                break;
            case SC_DIRECTION_DOWN:
                HM_WriteValueFloat($_IPS['INSTANCE'], "LEVEL", 0.0);
                if($_IPS['DURATION'] > 0)
                {
                    IPS_Sleep($_IPS['DURATION']);
                    HM_WriteValueBoolean($_IPS['INSTANCE'], "STOP", true);
                }
                break;
        }
        break;
    default:
        die("No Handler for Module ".$instance['ModuleInfo']['ModuleName']." found");
}
*
function OneWireShutter($ins, $dir, $sec) {
    @OW_SetStrobe($ins, True);
    $res = ($dir * 128) + ($sec / 1000);
    @OW_SetPort((integer)$ins, (integer)$res);
}
*
function CreateVariableByName($id, $name, $type)
{
    $vid = @IPS_GetVariableIDByName($name, $id);
    if($vid===false) {
        $vid = IPS_CreateVariable($type);
        IPS_SetParent($vid, $id);
        IPS_SetName($vid, $name);
        IPS_SetInfo($vid, "This Variable was created by Script");
    }
    return $vid;
}

Leider kommt selbst im Testcenter unter Meldungen der Fehler:
23.11.2016 19:27:41*| Shutter Control*| <br />
<b>Parse error</b>: syntax error, unexpected ‚if‘ (T_IF) in <b>/var/lib/symcon/scripts/57497.ips.php</b> on line <b>7</b><br />
und es tut sich nichts.
Kann mir einer nen Tipp geben.
Desweiterne möchte ich auch nochmal wegen dem Veluxfenster fragen wie muss der Code abgeändert werden damit ein Rollo durch ein Relais in Ein Knopf bedienbar wird.
Danke vorab
Martin