"; IPS_SetScriptContent($ObjectID_Script, $Inhalt); $ObjectID_ScriptEvt = IPS_CreateEvent(1); IPS_SetParent($ObjectID_ScriptEvt, $ObjectID_Script); IPS_SetEventCyclic($ObjectID_ScriptEvt,2,1,0,0,0,0); IPS_SetEventCyclicTimeFrom($ObjectID_ScriptEvt,0,7,($ObjectID_ScriptEvt%60)); IPS_SetEventActive($ObjectID_ScriptEvt,TRUE); } // EVENT 1A prüfen $ObjectID_Event_1a = @IPS_GetObjectIDByName($NameEvent_1ab.$Name_1a, $ParentID); if ($NameEvent_1ab.$Name_1a != "" AND $ObjectID_Event_1a == FALSE) { echo "Ereignis '".$NameEvent_1ab.$Name_1a."' nicht gefunden!"; return; } // EVENT 1B prüfen $ObjectID_Event_1b = @IPS_GetObjectIDByName($NameEvent_1ab.$Name_1b, $ParentID); if ($NameEvent_1ab.$Name_1b != "" AND $ObjectID_Event_1b == FALSE) { echo "Ereignis '".$NameEvent_1ab.$Name_1b."' nicht gefunden!"; return; } // EVENT 2A prüfen $ObjectID_Event_2a = @IPS_GetObjectIDByName($NameEvent_2ab.$Name_2a, $ParentID); if ($NameEvent_2ab.$Name_2a != "" AND $ObjectID_Event_2a == FALSE) { echo "Ereignis '".$NameEvent_2ab.$Name_2a."' nicht gefunden!"; return; } // EVENT 2B prüfen $ObjectID_Event_2b = @IPS_GetObjectIDByName($NameEvent_2ab.$Name_2b, $ParentID); if ($NameEvent_2ab.$Name_2b != "" AND $ObjectID_Event_2b == FALSE) { echo "Ereignis '".$NameEvent_2ab.$Name_2b."' nicht gefunden!"; return; } // PROFIL "Einstellungen" erzeugen $ProfilName1 = "Einstellungen"; $Profile = IPS_GetVariableProfile($ProfilName1); if ($Profile === false) { IPS_CreateVariableProfile($ProfilName1,0); IPS_SetVariableProfileText($ProfilName1,"",""); IPS_SetVariableProfileValues($ProfilName1,0,1,0); IPS_SetVariableProfileDigits($ProfilName1,0); IPS_SetVariableProfileIcon($ProfilName1,""); IPS_SetVariableProfileAssociation($ProfilName1, 0, "ausblenden", "", 0x999999); IPS_SetVariableProfileAssociation($ProfilName1, 1, "anzeigen", "", 0x00FF00); } // PROFIL "DaemmerungAbend" erzeugen $ProfilName2 = "DaemmerungAbend"; $Profile = IPS_GetVariableProfile($ProfilName2); if ($Profile === false) { IPS_CreateVariableProfile($ProfilName2,1); IPS_SetVariableProfileText($ProfilName2,"",""); IPS_SetVariableProfileValues($ProfilName2,0,5,0); IPS_SetVariableProfileDigits($ProfilName2,0); IPS_SetVariableProfileIcon($ProfilName2,""); IPS_SetVariableProfileAssociation($ProfilName2, 0, "AUS", "Cross", 0x999999); IPS_SetVariableProfileAssociation($ProfilName2, 1, "Manuell", "Repeat", 0xFF0000); IPS_SetVariableProfileAssociation($ProfilName2, 2, "Sonnenuntergang", "Sun", 0x00FF00); IPS_SetVariableProfileAssociation($ProfilName2, 3, "Dämmerung", "Moon", 0x800080); } // PROFIL "DaemmerungMorgen" erzeugen $ProfilName3 = "DaemmerungMorgen"; $Profile = IPS_GetVariableProfile($ProfilName3); if ($Profile === false) { IPS_CreateVariableProfile($ProfilName3,1); IPS_SetVariableProfileText($ProfilName3,"",""); IPS_SetVariableProfileValues($ProfilName3,0,5,0); IPS_SetVariableProfileDigits($ProfilName3,0); IPS_SetVariableProfileIcon($ProfilName3,""); IPS_SetVariableProfileAssociation($ProfilName3, 0, "AUS", "Cross", 0x999999); IPS_SetVariableProfileAssociation($ProfilName3, 1, "Manuell", "Repeat", 0xFF0000); IPS_SetVariableProfileAssociation($ProfilName3, 2, "Sonnenaufgang", "Sun", 0x00FF00); IPS_SetVariableProfileAssociation($ProfilName3, 3, "Dämmerung", "Moon", 0x800080); } // VARIABLE "Einstellungen" erzeugen $VarName = "Einstellungen"; $ObjectID_Einst = @IPS_GetObjectIDByName($VarName, $ParentID); if ($ObjectID_Einst == FALSE) { $ObjectID_Einst = IPS_CreateVariable(0); IPS_SetName($ObjectID_Einst, $VarName); IPS_SetParent($ObjectID_Einst, $ParentID); IPS_SetPosition($ObjectID_Einst, 5); IPS_SetIcon($ObjectID_Einst, "Gear"); SetValueBoolean($ObjectID_Einst,FALSE); IPS_SetVariableCustomProfile($ObjectID_Einst, $ProfilName1); IPS_SetVariableCustomAction($ObjectID_Einst, $ObjectID_Script); } // MODUL "Parameter" erzeugen $VarName = "Parameter"; $ObjectID_Param = @IPS_GetObjectIDByName("Parameter", $ParentID); if ($ObjectID_Param == FALSE) { $ObjectID_Param = IPS_CreateInstance("{485D0419-BE97-4548-AA9C-C083EB82E61E}"); IPS_SetName($ObjectID_Param, $VarName); IPS_SetParent($ObjectID_Param, $ParentID); IPS_SetPosition($ObjectID_Param, 6); } // VARIABLE "Einschaltzeit" erzeugen $VarName = $NameMode_1; $ObjectID_Mode_1 = @IPS_GetObjectIDByName($VarName, $ObjectID_Param); if ($ObjectID_Mode_1 == FALSE) { $ObjectID_Mode_1 = IPS_CreateVariable(1); IPS_SetName($ObjectID_Mode_1, $VarName); IPS_SetParent($ObjectID_Mode_1, $ObjectID_Param); IPS_SetPosition($ObjectID_Mode_1, 1); SetValueInteger($ObjectID_Mode_1,1); IPS_SetVariableCustomProfile($ObjectID_Mode_1, $ProfilName2); IPS_SetVariableCustomAction($ObjectID_Mode_1, $ObjectID_Script); } // VARIABLE "Ausschaltzeit" erzeugen $VarName = $NameMode_2; $ObjectID_Mode_2 = @IPS_GetObjectIDByName($VarName, $ObjectID_Param); if ($ObjectID_Mode_2 == FALSE) { $ObjectID_Mode_2 = IPS_CreateVariable(1); IPS_SetName($ObjectID_Mode_2, $VarName); IPS_SetParent($ObjectID_Mode_2, $ObjectID_Param); IPS_SetPosition($ObjectID_Mode_2, 2); SetValueInteger($ObjectID_Mode_2,1); IPS_SetVariableCustomProfile($ObjectID_Mode_2, $ProfilName3); IPS_SetVariableCustomAction($ObjectID_Mode_2, $ObjectID_Script); } // LINKS "Zeit" erzeugen $LinkName = "Zeit".$Name_1a; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_1); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_1); IPS_SetPosition($ObjectID_Link, 0); IPS_SetLinkTargetID($ObjectID_Link,$ObjectID_Event_1a); } $LinkName = "Zeit".$Name_1b; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_1); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_1); IPS_SetPosition($ObjectID_Link, 0); IPS_SetLinkTargetID($ObjectID_Link,$ObjectID_Event_1b); } $LinkName = "Zeit".$Name_2a; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_2); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_2); IPS_SetPosition($ObjectID_Link, 0); IPS_SetLinkTargetID($ObjectID_Link,$ObjectID_Event_2a); } $LinkName = "Zeit".$Name_2b; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_2); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_2); IPS_SetPosition($ObjectID_Link, 0); IPS_SetLinkTargetID($ObjectID_Link,$ObjectID_Event_2b); } // LINKS "Astro" erzeugen $LinkName = "Sonnenuntergang"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_1); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_1); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "zivile Abenddämmerung"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_1); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_1); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "nautische Abenddämmerung"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_1); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_1); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "astronomische Abenddämmerung"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_1); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_1); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "Sonnenaufgang"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_2); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_2); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "zivile Morgendämmerung"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_2); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_2); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "nautische Morgendämmerung"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_2); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_2); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } $LinkName = "astronomische Morgendämmerung"; $ObjectID_Link = @IPS_GetObjectIDByName($LinkName, $ObjectID_Mode_2); if ($ObjectID_Link == FALSE) { $ObjectID_Link = IPS_CreateLink(); IPS_SetName($ObjectID_Link, $LinkName); IPS_SetParent($ObjectID_Link, $ObjectID_Mode_2); IPS_SetPosition($ObjectID_Link, 1); IPS_SetLinkTargetID($ObjectID_Link,IPS_GetObjectIDByName($LinkName, $AstroID)); } // VARIABLE Grenzen erzeugen $VarName = $NameLimit_1ab.$Name_1a; $ObjectID = @IPS_GetObjectIDByName($VarName, $ObjectID_Mode_1); if ($ObjectID == FALSE) { $ObjectID = IPS_CreateVariable(3); IPS_SetName($ObjectID, $VarName); IPS_SetParent($ObjectID, $ObjectID_Mode_1); IPS_SetPosition($ObjectID, 2); SetValueString($ObjectID,"19:00-22:00"); IPS_SetVariableCustomProfile($ObjectID, "~String"); IPS_SetVariableCustomAction($ObjectID, $ObjectID_Script); } $VarName = $NameLimit_1ab.$Name_1b; $ObjectID = @IPS_GetObjectIDByName($VarName, $ObjectID_Mode_1); if ($ObjectID == FALSE) { $ObjectID = IPS_CreateVariable(3); IPS_SetName($ObjectID, $VarName); IPS_SetParent($ObjectID, $ObjectID_Mode_1); IPS_SetPosition($ObjectID, 2); SetValueString($ObjectID,"20:30-22:00"); IPS_SetVariableCustomProfile($ObjectID, "~String"); IPS_SetVariableCustomAction($ObjectID, $ObjectID_Script); } $VarName = $NameLimit_2ab.$Name_2a; $ObjectID = @IPS_GetObjectIDByName($VarName, $ObjectID_Mode_2); if ($ObjectID == FALSE) { $ObjectID = IPS_CreateVariable(3); IPS_SetName($ObjectID, $VarName); IPS_SetParent($ObjectID, $ObjectID_Mode_2); IPS_SetPosition($ObjectID, 2); SetValueString($ObjectID,"08:30-09:30"); IPS_SetVariableCustomProfile($ObjectID, "~String"); IPS_SetVariableCustomAction($ObjectID, $ObjectID_Script); } $VarName = $NameLimit_2ab.$Name_2b; $ObjectID = @IPS_GetObjectIDByName($VarName, $ObjectID_Mode_2); if ($ObjectID == FALSE) { $ObjectID = IPS_CreateVariable(3); IPS_SetName($ObjectID, $VarName); IPS_SetParent($ObjectID, $ObjectID_Mode_2); IPS_SetPosition($ObjectID, 2); SetValueString($ObjectID,"09:00-10:00"); IPS_SetVariableCustomProfile($ObjectID, "~String"); IPS_SetVariableCustomAction($ObjectID, $ObjectID_Script); } IPS_RunScript($ObjectID_Script); ?>