Hm, der einfachhalber könntest du das Skript nochmal hier einfügen um zu sehen ob es das richtige ist, wenn ja sollte (wenn Du alles Richtig gemacht hast) mit SC_Move funktionieren. Und am besten erzählst Du mal was Du alles gemacht hast. Weil wie sagen die meisten hier „Meine Glaskugel ist in der Reinigung“. Es ist schon einiges zu machen das der FSB12 läuft. Da muss unter anderem der Aktor und das Skript rein. Anbei noch mal das Skript das ich benutze damit geht es auf jeden Fall.
<?
//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;
case "{8492CEAF-ED62-4634-8A2F-B09A7CEDDE5B}": //enocean
$running = CreateVariableByName($SC_INSTANCE, "Moving", 0);
$value = GetValue(IPS_GetStatusVariableID($SC_INSTANCE, "StatusVariable"));
switch($SC_DIRECTION)
{
case SC_DIRECTION_STOP:
if(GetValue($running))
{
ENO_SwitchMode($SC_INSTANCE, $value);
SetValue($running, false);
}
break;
case SC_DIRECTION_UP:
if(!GetValue($running))
{
ENO_SwitchMode($SC_INSTANCE, true);
SetValue($running, true);
}
if($SC_DURATION > 999)
{
TimerDelay($SC_INSTANCE, $SC_DURATION, "ENOU");
}
if($SC_DURATION > 0 and $SC_DURATION <=999)
{
IPS_Sleep($SC_DURATION);
ENO_SwitchMode($SC_INSTANCE, true);
SetValue($running, false);
}
break;
case SC_DIRECTION_DOWN:
if(!GetValue($running))
{
ENO_SwitchMode($SC_INSTANCE, false);
SetValue($running, true);
}
if($SC_DURATION > 999)
{
TimerDelay($SC_INSTANCE, $SC_DURATION, "ENOD");
}
if($SC_DURATION > 0 and $SC_DURATION <=999)
{
IPS_Sleep($SC_DURATION);
ENO_SwitchMode($SC_INSTANCE, false);
SetValue($running, false);
}
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;
case "ENOU":
$running = CreateVariableByName($SCT_INSTANCE, "Moving", 0);
ENO_SwitchMode($SCT_INSTANCE, true);
SetValue($running, false);
break;
case "ENOD":
$running = CreateVariableByName($SCT_INSTANCE, "Moving", 0);
ENO_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); //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;
}
?>