From ed0f62d90a003e912b687881f0b376f6f131a26f Mon Sep 17 00:00:00 2001 From: brownson Date: Sat, 30 Jun 2012 10:51:42 +0200 Subject: [PATCH 1/4] IPSShadowing - Adapted Temp Profiles --- .../IPSShadowing_ChangeSettings.ips.php | 9 +- .../IPSShadowing_Constants.inc.php | 40 +++-- .../IPSShadowing_Device.class.php | 49 +++++- .../IPSShadowing/IPSShadowing_Logging.inc.php | 9 +- .../IPSShadowing_ProfileManager.class.php | 4 +- .../IPSShadowing_ProfileTemp.class.php | 144 +++++++++++------- .../IPSShadowing_FileList.ini | 2 +- .../IPSShadowing_Installation.ips.php | 63 ++++++-- 8 files changed, 227 insertions(+), 93 deletions(-) diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ChangeSettings.ips.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ChangeSettings.ips.php index f928b0c..7ffed83 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ChangeSettings.ips.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ChangeSettings.ips.php @@ -109,9 +109,12 @@ $profileManager->Rename($controlId, $value); break; - case c_Control_TempDiffShadowing: - case c_Control_TempDiffClosing: - case c_Control_TempDiffOpening: + case c_Control_TempLevelOutShadow: + case c_Control_TempLevelOutClose: + case c_Control_TempLevelOutOpen: + case c_Control_TempLevelInShadow: + case c_Control_TempLevelInClose: + case c_Control_TempLevelInOpen: case c_Control_Brightness: case c_Control_AzimuthBgn: case c_Control_AzimuthEnd: diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Constants.inc.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Constants.inc.php index 2c9c58c..5845020 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Constants.inc.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Constants.inc.php @@ -80,6 +80,7 @@ define ("c_Control_Automatic", "Automatic"); define ("c_Control_ManualChange", "ManualChange"); define ("c_Control_TempChange", "TemperatureChange"); + define ("c_Control_TempLastPos", "TemperatureLastPos"); define ("c_Control_ProfileTemp", "ProfileTemp"); define ("c_Control_ProfileSun", "ProfileSun"); define ("c_Control_ProfileWeather", "ProfileWeather"); @@ -88,9 +89,12 @@ define ("c_Control_ProfileInfo", "ProfileInfo"); define ("c_Control_ProfileName", "ProfileName"); - define ("c_Control_TempDiffShadowing", "TempDiffShadowing"); - define ("c_Control_TempDiffClosing", "TempDiffClosing"); - define ("c_Control_TempDiffOpening", "TempDiffOpening"); + define ("c_Control_TempLevelOutShadow", "TempLevelOutShadow"); + define ("c_Control_TempLevelOutClose", "TempLevelOutClose"); + define ("c_Control_TempLevelOutOpen", "TempLevelOutOpen"); + define ("c_Control_TempLevelInShadow", "TempLevelInShadow"); + define ("c_Control_TempLevelInClose", "TempLevelInClose"); + define ("c_Control_TempLevelInOpen", "TempLevelInOpen"); define ("c_Control_Brightness", "Brightness"); define ("c_Control_AzimuthBgn", "AzimuthBgn"); define ("c_Control_AzimuthEnd", "AzimuthEnd"); @@ -127,7 +131,7 @@ define ("c_Control_MsgPrioTemp", "MsgPrioTemp"); define ("c_Control_MsgPrioProg", "MsgPrioProg"); - define ("c_TempDiff_NoAction", 4); + define ("c_TempLevel_Ignore", 100); define ("c_Color_ProfileActive", 0x880000); @@ -141,13 +145,16 @@ define ("c_Program_OpenedDay", "Geöffnet Tag"); define ("c_Program_OpenedNight", "Geöffnet Nacht"); define ("c_Program_Closed", "Geschlossen"); - define ("c_Program_75", "75"); - define ("c_Program_90", "90"); + define ("c_Program_25", "25%"); + define ("c_Program_50", "50%"); + define ("c_Program_75", "75%"); + define ("c_Program_90", "90%"); define ("c_Program_Dimout", "Geschlossen"); define ("c_Program_MovedOut", "Ausgefahren"); define ("c_Program_MovedOutTemp", "Ausgefahren Temperatur"); define ("c_Program_DimoutOrShadowing", "Schatten oder Geschl"); define ("c_Program_DimoutAndShadowing", "Schatten und Geschl."); + define ("c_Program_LastPosition", "LastPosition"); define ("c_ProgramId_Opened", 1); define ("c_ProgramId_MovedIn", 2); @@ -155,15 +162,18 @@ define ("c_ProgramId_OpenedAndShadowing", 4); define ("c_ProgramId_OpenedDay", 5); define ("c_ProgramId_OpenedNight", 6); - define ("c_ProgramId_75", 7); - define ("c_ProgramId_90", 8); - define ("c_ProgramId_Closed", 9); - define ("c_ProgramId_Dimout", 10); - define ("c_ProgramId_DimoutOrShadowing", 11); - define ("c_ProgramId_DimoutAndShadowing", 12); - define ("c_ProgramId_MovedOut", 13); - define ("c_ProgramId_MovedOutTemp", 14); - define ("c_ProgramId_Manual", 15); + define ("c_ProgramId_25", 7); + define ("c_ProgramId_50", 8); + define ("c_ProgramId_75", 9); + define ("c_ProgramId_90", 10); + define ("c_ProgramId_Closed", 11); + define ("c_ProgramId_Dimout", 12); + define ("c_ProgramId_DimoutOrShadowing", 13); + define ("c_ProgramId_DimoutAndShadowing", 14); + define ("c_ProgramId_MovedOut", 15); + define ("c_ProgramId_MovedOutTemp", 16); + define ("c_ProgramId_Manual", 17); + define ("c_ProgramId_LastPosition", 18); define ("c_ShadowingType_Shutter", "Shutter"); define ("c_ShadowingType_Jalousie", "Jolousie"); diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php index bf85fc8..ab4501c 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php @@ -217,6 +217,8 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig $DoBeMoved = c_MovementId_Shadowing; } break; + case c_ProgramId_LastPosition: + $DoBeMoved = $this->GetVariableValue(c_Control_TempLastPos); default: IPSLogger_Err(__file__, "Unknown Program $Program, DeviceId=".$this->DeviceId); exit; @@ -224,6 +226,7 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig if ($DoBeMoved<>$MovementStatus) { if ($TriggeredByTemp and !$this->GetVariableValue(c_Control_TempChange)) { $this->SetVariableValue(c_Control_TempChange, true); + $this->SetVariableValue(c_Control_TempLastPos, $this->GetMovementIdByPosition()); } $this->SetVariableValue(c_Control_Movement, $DoBeMoved); $this->MoveByStatus(); @@ -231,6 +234,40 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig } } + // ---------------------------------------------------------------------------------------------------------------------------- + private function GetMovementIdByPosition() { + $shadowingType = $this->GetPropertyValue(c_Property_ShadowingType); + $currentMovementId = $this->GetVariableValue(c_Control_Movement); + $currentPosition = $this->GetVariableValue(c_Control_TempChange, c_Control_Position); + + if ($currentMovementId<>c_MovementId_Stop) { + $lastPosition = $currentMovementId; + } elseif ($currentPosition<10) { + if ($shadowingType==c_ShadowingType_Marquees) { + $lastPosition = c_MovementId_MovedIn; + } else { + $lastPosition = c_MovementId_Opened; + } + } elseif ($currentPosition<30) { + $lastPosition = c_MovementId_25; + } elseif ($currentPosition<55) { + $lastPosition = c_MovementId_50; + } elseif ($currentPosition<80) { + $lastPosition = c_MovementId_75; + } elseif ($currentPosition<92) { + $lastPosition = c_MovementId_90; + } else { + if ($shadowingType==c_ShadowingType_Marquees) { + $lastPosition = c_MovementId_MovedOut; + } elseif ($shadowingType==c_ShadowingType_Shutter) { + $lastPosition = c_MovementId_Closed; + } else { + $lastPosition = c_MovementId_Shadowing; + } + } + return $lastPosition; + } + // ---------------------------------------------------------------------------------------------------------------------------- public function MoveByControl($Value) { if ($Value==c_MovementId_Space) { @@ -479,9 +516,8 @@ public function CheckPrograms($profileManager) { $changeByTemp = GetValue(IPS_GetObjectIDByIdent(c_Control_TempChange, $this->deviceId)); $changeByUser = GetValue(IPS_GetObjectIDByIdent(c_Control_ManualChange, $this->deviceId)); $automaticActive = GetValue(IPS_GetObjectIDByIdent(c_Control_Automatic, $this->deviceId)); - $tempIndoorPath = $this->GetPropertyValue(c_Property_TempSensorIndoor); - + $controlId = @IPS_GetObjectIDByIdent(c_Control_ProfileWeather, $this->deviceId); if ($controlId!==false) { $profileIdWeather = GetValue($controlId); @@ -545,9 +581,14 @@ public function CheckPrograms($profileManager) { if (!$openByTemp and $changeByTemp) { $programInfo = 'Tag (Warte Öffnen)'; } elseif ($openByTemp and $changeByTemp) { - $programInfo = 'Tag (Reset)'; SetValue(IPS_GetObjectIDByIdent(c_Control_TempChange, $this->deviceId), false); - $this->MoveByProgram($programDay, 'Tagesprogramm (Temperatur Reset)'); + if ($programDay<>c_ProgramId_Manual) { + $programInfo = 'Temperatur Reset (Tag)'; + $this->MoveByProgram($programDay, 'Temperatur Reset (Tag)'); + } else { + $programInfo = 'Temperatur Reset (LastPosition)'; + $this->MoveByProgram(c_ProgramId_LastPosition, 'Temperatur Reset (LastPosition)'); + } } else { $programInfo = 'Tagesprogramm'; $this->MoveByProgram($programDay, 'Tagesprogramm'); diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Logging.inc.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Logging.inc.php index b47cbb0..0cd4341 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Logging.inc.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Logging.inc.php @@ -37,6 +37,10 @@ function IPSShadowing_GetMessageByMovement($deviceId) { $Message = "Abdunkelung"; } elseif ($ToBeMoved==c_MovementId_Closed) { $Message = "Geschlossen"; + } elseif ($ToBeMoved==c_MovementId_25) { + $Message = "25%"; + } elseif ($ToBeMoved==c_MovementId_50) { + $Message = "50%"; } elseif ($ToBeMoved==c_MovementId_75) { $Message = "75%"; } elseif ($ToBeMoved==c_MovementId_90) { @@ -74,11 +78,14 @@ function IPSShadowing_GetProgramName($ProgramId) { c_ProgramId_Closed => c_Program_Closed, c_ProgramId_90 => c_Program_90, c_ProgramId_75 => c_Program_75, + c_ProgramId_50 => c_Program_50, + c_ProgramId_25 => c_Program_25, c_ProgramId_MovedOut => c_Program_MovedOut, c_ProgramId_MovedOutTemp => c_Program_MovedOutTemp, c_ProgramId_Dimout => c_Program_Dimout, c_ProgramId_DimoutOrShadowing => c_Program_DimoutOrShadowing, - c_ProgramId_DimoutAndShadowing => c_Program_DimoutAndShadowing + c_ProgramId_DimoutAndShadowing => c_Program_DimoutAndShadowing, + c_ProgramId_LastPosition => c_Program_LastPosition ); return $ProgramList[$ProgramId]; diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileManager.class.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileManager.class.php index 929e557..98f9aaa 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileManager.class.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileManager.class.php @@ -264,8 +264,8 @@ public function SelectEndOfDay($profileId) { SetValue(IPS_GetObjectIDByIdent(c_Control_ProfileEndOfDaySelect, $this->instanceId), $profileId); } - public function CreateTemp($profileName='Neues Profile', $tempDiffShadowing=0, $tempDiffClose=1, $tempDiffOpening=1, $brightness=6000) { - $profileId = IPSShadowing_ProfileTemp::Create($profileName, $tempDiffShadowing, $tempDiffClose, $tempDiffOpening, $brightness); + public function CreateTemp($profileName='Neues Profile') { + $profileId = IPSShadowing_ProfileTemp::Create($profileName); $this->SelectTemp($profileId); } public function CreateSun($profileName='Neues Profile', $anzimutBgn=120, $anzimutEnd=240, $elevation=25) { diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileTemp.class.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileTemp.class.php index fb034bd..4936498 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileTemp.class.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_ProfileTemp.class.php @@ -43,17 +43,19 @@ class IPSShadowing_ProfileTemp { /** * @private - * Aktivierung bei Sonnenstand und Helligkeit + * Aktivierung durch Helligkeit aktiv */ - private $activationByTemp; - + private $activationByBrigthness; private $brightnessLevel; private $brightnessValue; private $tempOutdoor; private $tempIndoor; - private $tempDiffShadowing; - private $tempDiffClosing; - private $tempDiffOpening; + private $tempLevelOutShadow; + private $tempLevelOutClose; + private $tempLevelOutOpen; + private $tempLevelInShadow; + private $tempLevelInClose; + private $tempLevelInOpen; /** * @public @@ -74,14 +76,17 @@ public function __construct($instanceId) { * */ private function Init() { - $this->brightnessLevel = GetValue(IPS_GetObjectIDByIdent(c_Control_Brightness, $this->instanceId)); - $this->tempDiffShadowing = GetValue(IPS_GetObjectIDByIdent(c_Control_TempDiffShadowing, $this->instanceId)); - $this->tempDiffClosing = GetValue(IPS_GetObjectIDByIdent(c_Control_TempDiffClosing, $this->instanceId)); - $this->tempDiffOpening = GetValue(IPS_GetObjectIDByIdent(c_Control_TempDiffOpening, $this->instanceId)); - $this->tempIndoor = null; - $this->tempOutdoor = null; - $this->brightnessValue = null; - $this->activationByTemp = true; + $this->brightnessLevel = GetValue(IPS_GetObjectIDByIdent(c_Control_Brightness, $this->instanceId)); + $this->brightnessValue = null; + $this->tempLevelOutShadow = GetValue(IPS_GetObjectIDByIdent(c_Control_TempLevelOutShadow, $this->instanceId)); + $this->tempLevelOutClose = GetValue(IPS_GetObjectIDByIdent(c_Control_TempLevelOutClose, $this->instanceId)); + $this->tempLevelOutOpen = GetValue(IPS_GetObjectIDByIdent(c_Control_TempLevelOutOpen, $this->instanceId)); + $this->tempLevelInShadow = GetValue(IPS_GetObjectIDByIdent(c_Control_TempLevelInShadow, $this->instanceId)); + $this->tempLevelInClose = GetValue(IPS_GetObjectIDByIdent(c_Control_TempLevelInClose, $this->instanceId)); + $this->tempLevelInOpen = GetValue(IPS_GetObjectIDByIdent(c_Control_TempLevelInOpen, $this->instanceId)); + $this->tempIndoor = null; + $this->tempOutdoor = null; + $this->activationByBrigthness = true; if (IPSSHADOWING_TEMPSENSORINDOOR <> '') { $this->tempIndoor = round(GetValue(IPSUtil_ObjectIDByPath(IPSSHADOWING_TEMPSENSORINDOOR)),1); } @@ -90,38 +95,15 @@ private function Init() { } if (IPSSHADOWING_BRIGHTNESSSENSOR <> '') { $this->brightnessValue = round(GetValue(IPSUtil_ObjectIDByPath(IPSSHADOWING_BRIGHTNESSSENSOR)),1); - $this->activationByTemp = ($this->activationByTemp and $this->brightnessValue>=$this->brightnessLevel); - } - } - - private function GetActivationByTemp($tempIndoorPath, $tempDiff, $reverse=false) { - //Example: - // Aussen >= Innen+Diff - // Outdoor=16,Indoor=22, --> -6 >= 2 -> false - // Outdoor=20,Indoor=22, --> -2 >= 2 -> false - // Outdoor=26,Indoor=22, --> 4 >= 2 -> true - $activationByTemp = $this->activationByTemp; - $tempIndoor = $this->tempIndoor; - if ($tempDiff<>c_TempDiff_NoAction) { - if ($tempIndoorPath <> '') { - $tempIndoor = round(GetValue(IPSUtil_ObjectIDByPath($tempIndoorPath)),1); - } - if ((IPSSHADOWING_TEMPSENSORINDOOR<>'' or $tempIndoorPath<>'') and IPSSHADOWING_TEMPSENSOROUTDOOR <> '') { - if ($reverse) { - $activationByTemp = ($activationByTemp and (($tempIndoor-$this->tempOutdoor) >= $tempDiff)); - } else { - $activationByTemp = ($activationByTemp and (($this->tempOutdoor-$tempIndoor) >= $tempDiff)); - } - } + $this->activationByBrigthness = ($this->brightnessValue>=$this->brightnessLevel); } - return $activationByTemp; } public function UpdateProfileInfo() { $tempIndoor = (IPSSHADOWING_TEMPSENSORINDOOR<>'' ? $this->tempIndoor.'°C' :'"nicht vorhanden"'); $tempOutdoor = (IPSSHADOWING_TEMPSENSOROUTDOOR<>''? $this->tempOutdoor.'°C' :'"nicht vorhanden"'); $brightness = (IPSSHADOWING_BRIGHTNESSSENSOR<>'' ? $this->brightnessValue.' Lux':'"nicht vorhanden"'); - $activationByTemp = $this->GetActivationByTemp('', $this->tempDiffShadowing); + $activationByTemp = $this->CloseByTemp(''); $info = ''.($activationByTemp?'Profil aktiv':'Profil inaktiv').' (Innen='.$tempIndoor.', Aussen='.$tempOutdoor.', Helligkeit='.$brightness.')'; if (GetValue(IPS_GetObjectIDByIdent(c_Control_ProfileInfo, $this->instanceId)) <> $info) { SetValue(IPS_GetObjectIDByIdent(c_Control_ProfileInfo, $this->instanceId), $info); @@ -147,20 +129,57 @@ public function GetProfileInfo($tempIndoorPath) { return $info; } + private function GetActivationByIndoorTemp($tempIndoorPath, $tempLevel, $reverse=false) { + $activationByTemp = true; + if ($tempLevel<>c_TempLevel_Ignore) { + if (IPSSHADOWING_TEMPSENSORINDOOR<>'' or $tempIndoorPath<>'') { + $tempIndoor = $this->tempIndoor; + if ($tempIndoorPath <> '') { + $tempIndoor = round(GetValue(IPSUtil_ObjectIDByPath($tempIndoorPath)),1); + } + if ($reverse) { + $activationByTemp = ($tempIndoor <= $tempLevel); + } else { + $activationByTemp = ($tempIndoor >= $tempLevel); + } + } + } + return $activationByTemp; + } + + private function GetActivationByOutdoorTemp($tempLevel, $reverse=false) { + $activationByTemp = true; + if ($tempLevel<>c_TempLevel_Ignore) { + if (IPSSHADOWING_TEMPSENSOROUTDOOR) { + if ($reverse) { + $activationByTemp = ($this->tempOutdoor <= $tempLevel); + } else { + $activationByTemp = ($this->tempOutdoor >= $tempLevel); + } + } + } + return $activationByTemp; + } + public function ShadowingByTemp($tempIndoorPath) { - if ($this->tempDiffShadowing==c_TempDiff_NoAction) { - return $this->GetActivationByTemp($tempIndoorPath, $this->tempDiffClosing); + if ($this->tempLevelOutShadow==c_TempLevel_Ignore and $this->tempLevelInShadow==c_TempLevel_Ignore) { + return false; } else { - return $this->GetActivationByTemp($tempIndoorPath, $this->tempDiffShadowing); + return ($this->activationByBrigthness and + $this->GetActivationByOutdoorTemp($this->tempLevelOutShadow) and + $this->GetActivationByIndoorTemp($tempIndoorPath, $this->tempLevelInShadow)); } } public function CloseByTemp($tempIndoorPath) { - return $this->GetActivationByTemp($tempIndoorPath, $this->tempDiffClosing); + return ($this->activationByBrigthness and + $this->GetActivationByOutdoorTemp($this->tempLevelOutClose) and + $this->GetActivationByIndoorTemp($tempIndoorPath, $this->tempLevelInClose)); } public function OpenByTemp($tempIndoorPath) { - return $this->GetActivationByTemp($tempIndoorPath, $this->tempDiffOpening, true); + return ($this->GetActivationByOutdoorTemp($this->tempLevelOutOpen, true) and + $this->GetActivationByIndoorTemp($tempIndoorPath, $this->tempLevelInOpen, true)); } /** @@ -169,12 +188,17 @@ public function OpenByTemp($tempIndoorPath) { * Neues Profile generieren * * @param string $profileName Name des Profiles - * @param integer $tempDiffShadowing Temperatur Differenz für Beschattung - * @param integer $tempDiffClose Temperatur Differenz für Abdunkelung - * @param integer $tempDiffOpening Temperatur Differenz für Öffnen + * @param integer $tempLevelOutShadow Temperatur Grenze Aussen für Beschattung + * @param integer $tempLevelInShadow Temperatur Grenze Innen für Beschattung + * @param integer $tempLevelOutClose Temperatur Grenze Aussen für Abdunkelung + * @param integer $tempLevelInClose Temperatur Grenze Innen für Abdunkelung + * @param integer $tempLevelOutOpen Temperatur Grenze Aussen für Öffnen + * @param integer $tempLevelInOpen Temperatur Grenze Innen für Öffnen * @param integer $brightness Helligkeit */ - public static function Create($profileName, $tempDiffShadowing=0, $tempDiffClose=1, $tempDiffOpening=1, $brightness=0) { + public static function Create($profileName, $tempLevelOutShadow=c_TempLevel_Ignore, $tempLevelOutClose=c_TempLevel_Ignore, + $tempLevelOutOpen=c_TempLevel_Ignore, $tempLevelInShadow=c_TempLevel_Ignore, $tempLevelInClose=c_TempLevel_Ignore, + $tempLevelInOpen=c_TempLevel_Ignore, $brightness=0) { IPSUtils_Include ('IPSInstaller.inc.php', 'IPSLibrary::install::IPSInstaller'); $ScriptIdChangeSettings = IPSUtil_ObjectIDByPath('Program.IPSLibrary.app.modules.IPSShadowing.IPSShadowing_ChangeSettings'); @@ -182,12 +206,15 @@ public static function Create($profileName, $tempDiffShadowing=0, $tempDiffClose $profileIdx = count(IPS_GetChildrenIds($categoryIdprofiles)) + 10; $profileId = CreateCategory ($profileName, $categoryIdprofiles, $profileIdx); IPS_SetIdent($profileId, (string)$profileId); - CreateVariable(c_Control_ProfileName, 3 /*String*/, $profileId, 0, '~String', $ScriptIdChangeSettings, $profileName, 'Title'); - CreateVariable(c_Control_TempDiffShadowing, 1 /*Integer*/, $profileId, 10, 'IPSShadowing_TempDiffShadowing', $ScriptIdChangeSettings, $tempDiffShadowing, 'Temperature'); - CreateVariable(c_Control_TempDiffClosing, 1 /*Integer*/, $profileId, 20, 'IPSShadowing_TempDiffClosing', $ScriptIdChangeSettings, $tempDiffClose, 'Temperature'); - CreateVariable(c_Control_TempDiffOpening, 1 /*Integer*/, $profileId, 20, 'IPSShadowing_TempDiffOpening', $ScriptIdChangeSettings, $tempDiffOpening, 'Temperature'); - CreateVariable(c_Control_Brightness, 1 /*Integer*/, $profileId, 30, 'IPSShadowing_Brightness', $ScriptIdChangeSettings, $brightness, 'Sun'); - CreateVariable(c_Control_ProfileInfo, 3 /*String*/, $profileId, 40, '~String', null, '', 'Information'); + CreateVariable(c_Control_ProfileName, 3 /*String*/, $profileId, 0, '~String', $ScriptIdChangeSettings, $profileName, 'Title'); + CreateVariable(c_Control_TempLevelOutShadow, 1 /*Integer*/, $profileId, 10, 'IPSShadowing_TempLevelOutShadow', $ScriptIdChangeSettings, $tempLevelOutShadow, 'Temperature'); + CreateVariable(c_Control_TempLevelInShadow, 1 /*Integer*/, $profileId, 20, 'IPSShadowing_TempLevelInShadow', $ScriptIdChangeSettings, $tempLevelInShadow, 'Temperature'); + CreateVariable(c_Control_TempLevelOutClose, 1 /*Integer*/, $profileId, 30, 'IPSShadowing_TempLevelOutClose', $ScriptIdChangeSettings, $tempLevelOutClose, 'Temperature'); + CreateVariable(c_Control_TempLevelInClose, 1 /*Integer*/, $profileId, 40, 'IPSShadowing_TempLevelInClose', $ScriptIdChangeSettings, $tempLevelInClose, 'Temperature'); + CreateVariable(c_Control_TempLevelOutOpen, 1 /*Integer*/, $profileId, 50, 'IPSShadowing_TempLevelOutOpen', $ScriptIdChangeSettings, $tempLevelOutOpen, 'Temperature'); + CreateVariable(c_Control_TempLevelInOpen, 1 /*Integer*/, $profileId, 60, 'IPSShadowing_TempLevelInOpen', $ScriptIdChangeSettings, $tempLevelInOpen, 'Temperature'); + CreateVariable(c_Control_Brightness, 1 /*Integer*/, $profileId, 70, 'IPSShadowing_Brightness', $ScriptIdChangeSettings, $brightness, 'Sun'); + CreateVariable(c_Control_ProfileInfo, 3 /*String*/, $profileId, 80, '~String', null, '', 'Information'); IPS_SetVariableProfileAssociation('IPSShadowing_ProfileTemp', $profileId, $profileName, "", -1); @@ -205,9 +232,12 @@ public function Display($categoryId) { IPSUtils_Include ('IPSInstaller.inc.php', 'IPSLibrary::install::IPSInstaller'); CreateLink('Profil Name', IPS_GetObjectIDByIdent(c_Control_ProfileName, $this->instanceId), $categoryId, 10); $instanceId = CreateDummyInstance("Temperatur Grenzen", $categoryId, 20); - CreateLink('Differenz Beschattung', IPS_GetObjectIDByIdent(c_Control_TempDiffShadowing, $this->instanceId), $instanceId, 10); - CreateLink('Differenz Abdunkelung', IPS_GetObjectIDByIdent(c_Control_TempDiffClosing, $this->instanceId), $instanceId, 20); - CreateLink('Differenz Öffnen', IPS_GetObjectIDByIdent(c_Control_TempDiffOpening, $this->instanceId), $instanceId, 30); + CreateLink('Beschattung Aussen', IPS_GetObjectIDByIdent(c_Control_TempLevelOutShadow, $this->instanceId), $instanceId, 10); + CreateLink('Beschattung Innen', IPS_GetObjectIDByIdent(c_Control_TempLevelInShadow, $this->instanceId), $instanceId, 20); + CreateLink('Schliessen Aussen', IPS_GetObjectIDByIdent(c_Control_TempLevelOutClose, $this->instanceId), $instanceId, 30); + CreateLink('Schliessen Innen', IPS_GetObjectIDByIdent(c_Control_TempLevelInClose, $this->instanceId), $instanceId, 40); + CreateLink('Öffnen Aussen', IPS_GetObjectIDByIdent(c_Control_TempLevelOutOpen, $this->instanceId), $instanceId, 50); + CreateLink('Öffnen Innen', IPS_GetObjectIDByIdent(c_Control_TempLevelInOpen, $this->instanceId), $instanceId, 60); $id = @IPS_GetObjectIdByName("Hellingkeits Grenze", $categoryId); if ($id!==false) { EmptyCategory($id); diff --git a/IPSLibrary/install/DownloadListFiles/IPSShadowing_FileList.ini b/IPSLibrary/install/DownloadListFiles/IPSShadowing_FileList.ini index 9a50d02..4a448ad 100644 --- a/IPSLibrary/install/DownloadListFiles/IPSShadowing_FileList.ini +++ b/IPSLibrary/install/DownloadListFiles/IPSShadowing_FileList.ini @@ -1,4 +1,4 @@ -Version=2.50.2 +Version=2.50.3 ModuleNamespace=IPSLibrary::app::modules::IPSShadowing [App] diff --git a/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php b/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php index 2112094..491aab2 100644 --- a/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php +++ b/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php @@ -151,17 +151,23 @@ $IPSShadowing_ProgNigSht = array( c_ProgramId_Manual => c_Program_Manual, c_ProgramId_Opened => c_Program_Opened, + c_ProgramId_25 => c_Program_25, + c_ProgramId_50 => c_Program_50, c_ProgramId_75 => c_Program_75, c_ProgramId_90 => c_Program_90, c_ProgramId_Closed => c_Program_Closed); $IPSShadowing_ProgDaySht = array( c_ProgramId_Manual => c_Program_Manual, c_ProgramId_Opened => c_Program_Opened, + c_ProgramId_25 => c_Program_25, + c_ProgramId_50 => c_Program_50, c_ProgramId_75 => c_Program_75, c_ProgramId_90 => c_Program_90, c_ProgramId_Closed => c_Program_Closed); $IPSShadowing_ProgTmpSht = array( c_ProgramId_Manual => c_Program_Manual, + c_ProgramId_25 => c_Program_25, + c_ProgramId_50 => c_Program_50, c_ProgramId_75 => c_Program_75, c_ProgramId_90 => c_Program_90, c_ProgramId_Closed => c_Program_Closed); @@ -178,12 +184,19 @@ $IPSShadowing_ProgDayMar = array( c_ProgramId_Manual => c_Program_Manual, c_ProgramId_MovedIn => c_Program_MovedIn, + c_ProgramId_50 => c_Program_50, + c_ProgramId_75 => c_Program_75, c_ProgramId_MovedOut => c_Program_MovedOut); $IPSShadowing_ProgTmpMar = array( c_ProgramId_Manual => c_Program_Manual, + c_ProgramId_50 => c_Program_50, + c_ProgramId_75 => c_Program_75, c_ProgramId_MovedOut => c_Program_MovedOut); $IPSShadowing_ProgPreMar = array( c_ProgramId_Manual => c_Program_Manual, + c_ProgramId_50 => c_Program_50, + c_ProgramId_75 => c_Program_75, + c_ProgramId_MovedOut => c_Program_MovedOut, c_ProgramId_MovedOutTemp => c_Program_MovedOutTemp); $IPSShadowing_ProgWeaMar = array( c_ProgramId_Manual => c_Program_Manual, @@ -261,10 +274,13 @@ CreateProfile_Count ('IPSShadowing_TempDelta', 1, 1, 5, null, " °C", null); CreateProfile_Count ('IPSShadowing_Position', 0, 1, 100, null, "%", null); - CreateProfile_Associations ('IPSShadowing_TempDiffShadowing', array('Aussen >= Innen', '> 1°C', '> 2°C', '> 3°C', 'keine Aktion')); - CreateProfile_Associations ('IPSShadowing_TempDiffClosing', array('Aussen >= Innen', '> 1°C', '> 2°C', '> 3°C', 'keine Aktion')); - CreateProfile_Associations ('IPSShadowing_TempDiffOpening', array('Innen >= Aussen', '> 1°C', '> 2°C', '> 3°C', 'keine Aktion')); - CreateProfile_Count ('IPSShadowing_Brightness', 0, 100, 10000, null, " Lux", null); + CreateProfile_Associations ('IPSShadowing_TempLevelOutShadow', array(22=>'Aussen >= 22°C', 23=>'>= 23°C', 24=>'>= 24°C', 25=>'>= 25°C', 26=>'>= 26°C', c_TempLevel_Ignore=>'Ignorieren')); + CreateProfile_Associations ('IPSShadowing_TempLevelInShadow', array(22=>'Innen >= 22°C', 23=>'>= 23°C', 24=>'>= 24°C', 25=>'>= 25°C', 26=>'>= 26°C', c_TempLevel_Ignore=>'Ignorieren')); + CreateProfile_Associations ('IPSShadowing_TempLevelOutClose', array(22=>'Aussen >= 22°C', 23=>'>= 23°C', 24=>'>= 24°C', 25=>'>= 25°C', 26=>'>= 26°C', c_TempLevel_Ignore=>'Ignorieren')); + CreateProfile_Associations ('IPSShadowing_TempLevelInClose', array(22=>'Innen >= 22°C', 23=>'>= 23°C', 24=>'>= 24°C', 25=>'>= 25°C', 26=>'>= 26°C', c_TempLevel_Ignore=>'Ignorieren')); + CreateProfile_Associations ('IPSShadowing_TempLevelOutOpen', array(22=>'Aussen <= 22°C', 23=>'<= 23°C', 24=>'<= 24°C', 25=>'<= 25°C', 26=>'<= 26°C', c_TempLevel_Ignore=>'Ignorieren')); + CreateProfile_Associations ('IPSShadowing_TempLevelInOpen', array(22=>'Innen <= 22°C', 23=>'<= 23°C', 24=>'<= 24°C', 25=>'<= 25°C', 26=>'<= 26°C', c_TempLevel_Ignore=>'Ignorieren')); + CreateProfile_Count ('IPSShadowing_Brightness', 0, 500, 50000, null, " Lux", null); CreateProfile_Count ('IPSShadowing_AzimuthBgn', 0, 5, 360, null, " °", null); CreateProfile_Count ('IPSShadowing_AzimuthEnd', 0, 5, 360, null, " °", null); @@ -308,6 +324,8 @@ $CategoryIdDevices = CreateCategory('Devices', $CategoryIdData, 20); + + // Profile Manager // ==================================================================================================================================== $CategoryIdProfiles = CreateCategory('Profiles', $CategoryIdData, 30); @@ -354,6 +372,30 @@ if (count($Profiles)==0) { $profileManager->CreateEndOfDay('Dämmerung'); } + //++Migration v2.50.2 --> 2.50.3 + $categoryIdTempProfiles = IPSUtil_ObjectIDByPath('Program.IPSLibrary.data.modules.IPSShadowing.Profiles.Temp'); + $categoryIdListTempProfiles = IPS_GetChildrenIDs($categoryIdTempProfiles); + foreach ($categoryIdListTempProfiles as $categoryIdTempProfile) { + CreateVariable(c_Control_TempLevelOutShadow, 1 /*Integer*/, $categoryIdTempProfile, 10, 'IPSShadowing_TempLevelOutShadow', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelInShadow, 1 /*Integer*/, $categoryIdTempProfile, 20, 'IPSShadowing_TempLevelInShadow', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelOutClose, 1 /*Integer*/, $categoryIdTempProfile, 30, 'IPSShadowing_TempLevelOutClose', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelInClose, 1 /*Integer*/, $categoryIdTempProfile, 40, 'IPSShadowing_TempLevelInClose', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelOutOpen, 1 /*Integer*/, $categoryIdTempProfile, 50, 'IPSShadowing_TempLevelOutOpen', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelInOpen, 1 /*Integer*/, $categoryIdTempProfile, 60, 'IPSShadowing_TempLevelInOpen', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + $variableId = @IPS_GetObjectIDByName('TempDiffClosing', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } + $variableId = @IPS_GetObjectIDByName('TempDiffShadowing', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } + $variableId = @IPS_GetObjectIDByName('TempDiffOpening', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } + } + $profileId = GetValue($ControlIdProfileTempSelect); + $profile = new IPSShadowing_ProfileTemp($profileId); + $profile->Display($CategoryIdProfileTempDisplay); + $linkId = @IPS_GetObjectIDByName('Differenz Beschattung', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } + $linkId = @IPS_GetObjectIDByName('Differenz Abdunkelung', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } + $linkId = @IPS_GetObjectIDByName('Differenz Öffnen', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } + @IPS_DeleteVariableProfile('IPSShadowing_TempDiffShadowing'); + @IPS_DeleteVariableProfile('IPSShadowing_TempDiffClosing'); + @IPS_DeleteVariableProfile('IPSShadowing_TempDiffOpening'); + //--Migration v2.50.2 --> 2.50.3 // Scenario Manager // ==================================================================================================================================== @@ -407,6 +449,7 @@ $ControlIdPosition = CreateVariable(c_Control_Position, 1 /*Integer*/, $DeviceId, 90, 'IPSShadowing_Position', null, 0, 'Intensity'); $ControlIdManualChange = CreateVariable(c_Control_ManualChange, 0 /*Boolean*/, $DeviceId, 110, '~Switch', $ScriptIdChangeSettings, false, 'Warning'); $ControlIdTempChange = CreateVariable(c_Control_TempChange, 0 /*Boolean*/, $DeviceId, 120, '~Switch', null , false, 'Warning'); + $ControlIdTempLastPos = CreateVariable(c_Control_TempLastPos, 1 /*Integer*/, $DeviceId, 125, '', null , false, 'Information'); $ControlIdAutomatic = CreateVariable(c_Control_Automatic , 0 /*Boolean*/, $DeviceId, 130, '~Switch', $ScriptIdChangeSettings, false, 'Power'); $ControlIdTempProfile = CreateVariable(c_Control_ProfileTemp, 1 /*Integer*/, $DeviceId, 330, 'IPSShadowing_ProfileTemp', $ScriptIdChangeSettings, 0, 'Temperature'); @@ -555,7 +598,7 @@ $WebFrontScenariosIdTopL = CreateCategory( 'TopLeft', $WebFrontScenariosId, 10); $WebFrontScenariosIdTopR = CreateCategory( 'TopRight', $WebFrontScenariosId, 20); $WebFrontScenariosIdBot = CreateCategory( 'Bottom', $WebFrontScenariosId, 30); - CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Scenarios", $WFC10_TabPaneItem, 30, 'Szenarien', 'Script', 0 /*Horizontal*/, 120 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); + CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Scenarios", $WFC10_TabPaneItem, 30, 'Szenarien', 'Script', 0 /*Horizontal*/, 106 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_ScenariosTop", $WFC10_TabPaneItem."_Scenarios", 10, '', '', 1 /*Vertical*/, 300/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_ScenariosBot", $WFC10_TabPaneItem."_Scenarios", 20, '', '', $CategoryIdScenarioDisplay /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_ScenariosTopL",$WFC10_TabPaneItem."_ScenariosTop", 10, '', '', $WebFrontScenariosIdTopL /*BaseId*/, 'false' /*BarBottomVisible*/); @@ -588,29 +631,29 @@ $WebFrontProfilesId5BotR = CreateCategory( 'BottomRight', $WebFrontProfilesId5, 30); CreateWFCItemTabPane ($WFC10_ConfigId, $WFC10_TabPaneItem.'_Profiles', $WFC10_TabPaneItem, 40, 'Profile', 'Clock'); - CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles1", $WFC10_TabPaneItem.'_Profiles', 10, 'Temperatur', 'Temperature', 0 /*Horizontal*/, 120 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); + CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles1", $WFC10_TabPaneItem.'_Profiles', 10, 'Temperatur', 'Temperature', 0 /*Horizontal*/, 106 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles1Top", $WFC10_TabPaneItem."_Profiles1", 10, '', '', 1 /*Vertical*/, 300/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles1Bot", $WFC10_TabPaneItem."_Profiles1", 20, '', '', $CategoryIdProfileTempDisplay /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles1TopL",$WFC10_TabPaneItem."_Profiles1Top", 10, '', '', $WebFrontProfilesId1TopL /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles1TopR",$WFC10_TabPaneItem."_Profiles1Top", 20, '', '', $WebFrontProfilesId1TopR /*BaseId*/, 'false' /*BarBottomVisible*/); - CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2", $WFC10_TabPaneItem.'_Profiles', 20, 'Sonnenstand', 'Sun', 0 /*Horizontal*/, 120 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); + CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2", $WFC10_TabPaneItem.'_Profiles', 20, 'Sonnenstand', 'Sun', 0 /*Horizontal*/, 106 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2Top", $WFC10_TabPaneItem."_Profiles2", 10, '', '', 1 /*Vertical*/, 300/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2Bot", $WFC10_TabPaneItem."_Profiles2", 20, '', '', 1 /*Vertical*/, 420/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2BotL",$WFC10_TabPaneItem."_Profiles2Bot", 10, '', '', $CategoryIdProfileSunDisplay /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2BotR",$WFC10_TabPaneItem."_Profiles2Bot", 20, '', '', $CategoryIdProfileSunGraphs /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2TopL",$WFC10_TabPaneItem."_Profiles2Top", 10, '', '', $WebFrontProfilesId2TopL /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles2TopR",$WFC10_TabPaneItem."_Profiles2Top", 20, '', '', $WebFrontProfilesId2TopR /*BaseId*/, 'false' /*BarBottomVisible*/); - CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles3", $WFC10_TabPaneItem.'_Profiles', 20, 'Wetter', 'Drops', 0 /*Horizontal*/, 120 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); + CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles3", $WFC10_TabPaneItem.'_Profiles', 20, 'Wetter', 'Drops', 0 /*Horizontal*/, 106 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles3Top", $WFC10_TabPaneItem."_Profiles3", 10, '', '', 1 /*Vertical*/, 300/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles3Bot", $WFC10_TabPaneItem."_Profiles3", 20, '', '', $CategoryIdProfileWeatherDisplay /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles3TopL",$WFC10_TabPaneItem."_Profiles3Top", 10, '', '', $WebFrontProfilesId3TopL /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles3TopR",$WFC10_TabPaneItem."_Profiles3Top", 20, '', '', $WebFrontProfilesId3TopR /*BaseId*/, 'false' /*BarBottomVisible*/); - CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles4", $WFC10_TabPaneItem.'_Profiles', 20, 'Tagesbeginn', 'Clock', 0 /*Horizontal*/, 120 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); + CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles4", $WFC10_TabPaneItem.'_Profiles', 20, 'Tagesbeginn', 'Clock', 0 /*Horizontal*/, 106 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles4Top", $WFC10_TabPaneItem."_Profiles4", 10, '', '', 1 /*Vertical*/, 300/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles4Bot", $WFC10_TabPaneItem."_Profiles4", 20, '', '', $CategoryIdProfileBgnOfDayDisplay /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles4TopL",$WFC10_TabPaneItem."_Profiles4Top", 10, '', '', $WebFrontProfilesId4TopL /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles4TopR",$WFC10_TabPaneItem."_Profiles4Top", 20, '', '', $WebFrontProfilesId4TopR /*BaseId*/, 'false' /*BarBottomVisible*/); - CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles5", $WFC10_TabPaneItem.'_Profiles', 30, 'Tagesende', 'Clock', 0 /*Horizontal*/, 120 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); + CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles5", $WFC10_TabPaneItem.'_Profiles', 30, 'Tagesende', 'Clock', 0 /*Horizontal*/, 106 /*Hight*/, 0 /*Target=Pane1*/, 1/*UsePixel*/, 'true'); CreateWFCItemSplitPane ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles5Top", $WFC10_TabPaneItem."_Profiles5", 10, '', '', 1 /*Vertical*/, 300/*Width*/, 1 /*Target=Pane2*/, 1/*UsePixel*/, 'true'); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles5Bot", $WFC10_TabPaneItem."_Profiles5", 20, '', '', $CategoryIdProfileEndOfDayDisplay /*BaseId*/, 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $WFC10_TabPaneItem."_Profiles5TopL",$WFC10_TabPaneItem."_Profiles5Top", 10, '', '', $WebFrontProfilesId5TopL /*BaseId*/, 'false' /*BarBottomVisible*/); From f89a4fc6d1874cb4b54bbfdf612452a584aa62a4 Mon Sep 17 00:00:00 2001 From: brownson Date: Sun, 1 Jul 2012 12:21:07 +0200 Subject: [PATCH 2/4] IPSShadowing - Corrected LastPos --- .../app/modules/IPSShadowing/IPSShadowing_Device.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php index ab4501c..e68acd5 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php @@ -238,7 +238,7 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig private function GetMovementIdByPosition() { $shadowingType = $this->GetPropertyValue(c_Property_ShadowingType); $currentMovementId = $this->GetVariableValue(c_Control_Movement); - $currentPosition = $this->GetVariableValue(c_Control_TempChange, c_Control_Position); + $currentPosition = $this->GetVariableValue(c_Control_Position); if ($currentMovementId<>c_MovementId_Stop) { $lastPosition = $currentMovementId; From 1f68bf91f7038f98de2fb8585c6a58e23f445462 Mon Sep 17 00:00:00 2001 From: brownson Date: Sun, 1 Jul 2012 22:19:56 +0200 Subject: [PATCH 3/4] IPSShadowing - Corrected LastPos --- .../modules/IPSShadowing/IPSShadowing_Device.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php index e68acd5..159454d 100644 --- a/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php +++ b/IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php @@ -204,6 +204,12 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig case c_ProgramId_75: $DoBeMoved = c_MovementId_75; break; + case c_ProgramId_50: + $DoBeMoved = c_MovementId_50; + break; + case c_ProgramId_25: + $DoBeMoved = c_MovementId_25; + break; case c_ProgramId_Dimout: $DoBeMoved = c_MovementId_Dimout; break; @@ -219,8 +225,9 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig break; case c_ProgramId_LastPosition: $DoBeMoved = $this->GetVariableValue(c_Control_TempLastPos); + break; default: - IPSLogger_Err(__file__, "Unknown Program $Program, DeviceId=".$this->DeviceId); + IPSLogger_Err(__file__, "Unknown ProgramId $ProgramId, DeviceId=".$this->DeviceId); exit; } if ($DoBeMoved<>$MovementStatus) { From 284fd83f791a8626668e98bcff4fa296856c148e Mon Sep 17 00:00:00 2001 From: brownson Date: Tue, 3 Jul 2012 19:58:13 +0200 Subject: [PATCH 4/4] IPSShadowing - Fixed Installation --- .../IPSShadowing_Installation.ips.php | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php b/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php index 491aab2..7ccae15 100644 --- a/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php +++ b/IPSLibrary/install/InstallationScripts/IPSShadowing_Installation.ips.php @@ -122,10 +122,6 @@ $ScriptIdProfileEndOfDayCreate = IPS_GetScriptIDByName('IPSShadowing_ProfileEndOfDayCreate', $CategoryIdApp); $ScriptIdProfileEndOfDayDelete = IPS_GetScriptIDByName('IPSShadowing_ProfileEndOfDayDelete', $CategoryIdApp); - CreateTimer_OnceADay ('Reset', $ScriptIdResetTimer, 0, 5); - CreateTimer_CyclicBySeconds ('Refresh', $ScriptIdRefreshTimer, 1, false); - CreateTimer_CyclicByMinutes ('Program', $ScriptIdProgramTimer, 5); - // Create Circles and Controls // ---------------------------------------------------------------------------------------------------------------------------- $IPSShadowing_ProgNigJal = array( @@ -349,6 +345,33 @@ $CategoryIdProfileSunGraphs = CreateCategory('GraphsSun', $CategoryIdProfileManager, 200); $MediaIdAzimuth = CreateMedia ('Sonnenstand', $CategoryIdProfileSunGraphs, IPS_GetKernelDir().'media\\IPSShadowing_Azimuth.gif', false, 1, 'Sun'); + //++Migration v2.50.2 --> 2.50.3 + $categoryIdTempProfiles = IPSUtil_ObjectIDByPath('Program.IPSLibrary.data.modules.IPSShadowing.Profiles.Temp'); + $categoryIdListTempProfiles = IPS_GetChildrenIDs($categoryIdTempProfiles); + foreach ($categoryIdListTempProfiles as $categoryIdTempProfile) { + CreateVariable(c_Control_TempLevelOutShadow, 1 /*Integer*/, $categoryIdTempProfile, 10, 'IPSShadowing_TempLevelOutShadow', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelInShadow, 1 /*Integer*/, $categoryIdTempProfile, 20, 'IPSShadowing_TempLevelInShadow', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelOutClose, 1 /*Integer*/, $categoryIdTempProfile, 30, 'IPSShadowing_TempLevelOutClose', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelInClose, 1 /*Integer*/, $categoryIdTempProfile, 40, 'IPSShadowing_TempLevelInClose', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelOutOpen, 1 /*Integer*/, $categoryIdTempProfile, 50, 'IPSShadowing_TempLevelOutOpen', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + CreateVariable(c_Control_TempLevelInOpen, 1 /*Integer*/, $categoryIdTempProfile, 60, 'IPSShadowing_TempLevelInOpen', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); + $variableId = @IPS_GetObjectIDByName('TempDiffClosing', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } + $variableId = @IPS_GetObjectIDByName('TempDiffShadowing', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } + $variableId = @IPS_GetObjectIDByName('TempDiffOpening', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } + } + $linkId = @IPS_GetObjectIDByName('Differenz Beschattung', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } + $linkId = @IPS_GetObjectIDByName('Differenz Abdunkelung', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } + $linkId = @IPS_GetObjectIDByName('Differenz Öffnen', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } + @IPS_DeleteVariableProfile('IPSShadowing_TempDiffShadowing'); + @IPS_DeleteVariableProfile('IPSShadowing_TempDiffClosing'); + @IPS_DeleteVariableProfile('IPSShadowing_TempDiffOpening'); + $profileId = GetValue($ControlIdProfileTempSelect); + if ($profileId<>0) { + $profile = new IPSShadowing_ProfileTemp($profileId); + $profile->Display($CategoryIdProfileTempDisplay); + } + //--Migration v2.50.2 --> 2.50.3 + $profileManager = new IPSShadowing_ProfileManager(); $profileManager->AssignAllProfileAssociations(); @@ -372,31 +395,6 @@ if (count($Profiles)==0) { $profileManager->CreateEndOfDay('Dämmerung'); } - //++Migration v2.50.2 --> 2.50.3 - $categoryIdTempProfiles = IPSUtil_ObjectIDByPath('Program.IPSLibrary.data.modules.IPSShadowing.Profiles.Temp'); - $categoryIdListTempProfiles = IPS_GetChildrenIDs($categoryIdTempProfiles); - foreach ($categoryIdListTempProfiles as $categoryIdTempProfile) { - CreateVariable(c_Control_TempLevelOutShadow, 1 /*Integer*/, $categoryIdTempProfile, 10, 'IPSShadowing_TempLevelOutShadow', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); - CreateVariable(c_Control_TempLevelInShadow, 1 /*Integer*/, $categoryIdTempProfile, 20, 'IPSShadowing_TempLevelInShadow', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); - CreateVariable(c_Control_TempLevelOutClose, 1 /*Integer*/, $categoryIdTempProfile, 30, 'IPSShadowing_TempLevelOutClose', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); - CreateVariable(c_Control_TempLevelInClose, 1 /*Integer*/, $categoryIdTempProfile, 40, 'IPSShadowing_TempLevelInClose', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); - CreateVariable(c_Control_TempLevelOutOpen, 1 /*Integer*/, $categoryIdTempProfile, 50, 'IPSShadowing_TempLevelOutOpen', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); - CreateVariable(c_Control_TempLevelInOpen, 1 /*Integer*/, $categoryIdTempProfile, 60, 'IPSShadowing_TempLevelInOpen', $ScriptIdChangeSettings, c_TempLevel_Ignore, 'Temperature'); - $variableId = @IPS_GetObjectIDByName('TempDiffClosing', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } - $variableId = @IPS_GetObjectIDByName('TempDiffShadowing', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } - $variableId = @IPS_GetObjectIDByName('TempDiffOpening', $categoryIdTempProfile); if ($variableId!==false) { IPS_DeleteVariable($variableId); } - } - $profileId = GetValue($ControlIdProfileTempSelect); - $profile = new IPSShadowing_ProfileTemp($profileId); - $profile->Display($CategoryIdProfileTempDisplay); - $linkId = @IPS_GetObjectIDByName('Differenz Beschattung', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } - $linkId = @IPS_GetObjectIDByName('Differenz Abdunkelung', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } - $linkId = @IPS_GetObjectIDByName('Differenz Öffnen', $CategoryIdProfileTempDisplay); if ($linkId!==false) { IPS_DeleteLink($linkId); } - @IPS_DeleteVariableProfile('IPSShadowing_TempDiffShadowing'); - @IPS_DeleteVariableProfile('IPSShadowing_TempDiffClosing'); - @IPS_DeleteVariableProfile('IPSShadowing_TempDiffOpening'); - //--Migration v2.50.2 --> 2.50.3 - // Scenario Manager // ==================================================================================================================================== $CategoryIdScenarios = CreateCategory('Scenarios', $CategoryIdData, 40); @@ -483,6 +481,8 @@ } $Idx = $Idx + 10; } + $profileManager = new IPSShadowing_ProfileManager(); + $profileManager->AssignAllProfileAssociations(); $profileManager->CorrectDeletedDeviceProfiles(); // Register Events for Device Synchronization @@ -509,6 +509,9 @@ } } + CreateTimer_OnceADay ('Reset', $ScriptIdResetTimer, 0, 5); + CreateTimer_CyclicBySeconds ('Refresh', $ScriptIdRefreshTimer, 1, false); + CreateTimer_CyclicByMinutes ('Program', $ScriptIdProgramTimer, 5); // ---------------------------------------------------------------------------------------------------------------------------- // Webfront Definition