Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
40 changes: 25 additions & 15 deletions IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Constants.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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);

Expand All @@ -141,29 +145,35 @@
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);
define ("c_ProgramId_OpenedOrShadowing", 3);
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");
Expand Down
58 changes: 53 additions & 5 deletions IPSLibrary/app/modules/IPSShadowing/IPSShadowing_Device.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -217,20 +223,58 @@ public function MoveByProgram($ProgramId, $logMessage, $DimoutOption=null, $Trig
$DoBeMoved = c_MovementId_Shadowing;
}
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) {
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();
IPSShadowing_LogMoveByProgram($this->deviceId, $ProgramId, $logMessage, $TriggeredByTemp);
}
}

// ----------------------------------------------------------------------------------------------------------------------------
private function GetMovementIdByPosition() {
$shadowingType = $this->GetPropertyValue(c_Property_ShadowingType);
$currentMovementId = $this->GetVariableValue(c_Control_Movement);
$currentPosition = $this->GetVariableValue(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) {
Expand Down Expand Up @@ -479,9 +523,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);
Expand Down Expand Up @@ -545,9 +588,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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading