Fixed bug when in the evening the blind is closed and the blind position is under the window open position
This commit is contained in:
@@ -48,22 +48,22 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use FHEM::Meta;
|
use FHEM::Meta;
|
||||||
|
|
||||||
my $version = '0.6.15';
|
my $version = '0.6.15.1';
|
||||||
|
|
||||||
sub AutoShuttersControl_Initialize($) {
|
sub AutoShuttersControl_Initialize($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
# ### alte Attribute welche entfernt werden
|
# ### alte Attribute welche entfernt werden
|
||||||
# my $oldAttr =
|
# my $oldAttr =
|
||||||
# 'ASC_temperatureSensor '
|
# 'ASC_temperatureSensor '
|
||||||
# . 'ASC_temperatureReading '
|
# . 'ASC_temperatureReading '
|
||||||
# . 'ASC_residentsDevice '
|
# . 'ASC_residentsDevice '
|
||||||
# . 'ASC_residentsDeviceReading '
|
# . 'ASC_residentsDeviceReading '
|
||||||
# . 'ASC_rainSensorDevice '
|
# . 'ASC_rainSensorDevice '
|
||||||
# . 'ASC_rainSensorReading '
|
# . 'ASC_rainSensorReading '
|
||||||
# . 'ASC_rainSensorShuttersClosedPos:0,10,20,30,40,50,60,70,80,90,100 '
|
# . 'ASC_rainSensorShuttersClosedPos:0,10,20,30,40,50,60,70,80,90,100 '
|
||||||
# . 'ASC_brightnessMinVal '
|
# . 'ASC_brightnessMinVal '
|
||||||
# . 'ASC_brightnessMaxVal ';
|
# . 'ASC_brightnessMaxVal ';
|
||||||
|
|
||||||
## Da ich mit package arbeite müssen in die Initialize für die jeweiligen hash Fn Funktionen der Funktionsname
|
## Da ich mit package arbeite müssen in die Initialize für die jeweiligen hash Fn Funktionen der Funktionsname
|
||||||
# und davor mit :: getrennt der eigentliche package Name des Modules
|
# und davor mit :: getrennt der eigentliche package Name des Modules
|
||||||
@@ -92,7 +92,8 @@ sub AutoShuttersControl_Initialize($) {
|
|||||||
. 'ASC_expert:1 '
|
. 'ASC_expert:1 '
|
||||||
. 'ASC_blockAscDrivesAfterManual:0,1 '
|
. 'ASC_blockAscDrivesAfterManual:0,1 '
|
||||||
. 'ASC_debug:1 '
|
. 'ASC_debug:1 '
|
||||||
# . $oldAttr
|
|
||||||
|
# . $oldAttr
|
||||||
. $readingFnAttributes;
|
. $readingFnAttributes;
|
||||||
$hash->{NotifyOrderPrefix} = '51-'; # Order Nummer für NotifyFn
|
$hash->{NotifyOrderPrefix} = '51-'; # Order Nummer für NotifyFn
|
||||||
|
|
||||||
@@ -916,25 +917,26 @@ sub EventProcessingWindowRec($@) {
|
|||||||
if ( $match =~ /open/
|
if ( $match =~ /open/
|
||||||
and $shutters->getShuttersPlace eq 'terrace' );
|
and $shutters->getShuttersPlace eq 'terrace' );
|
||||||
|
|
||||||
my $queryShuttersPosWinRecTilted = (
|
# my $queryShuttersPosWinRecTilted = (
|
||||||
$shutters->getShuttersPosCmdValueNegate
|
# $shutters->getShuttersPosCmdValueNegate
|
||||||
? $shutters->getStatus > $shutters->getVentilatePos
|
# ? $shutters->getStatus > $shutters->getVentilatePos
|
||||||
: $shutters->getStatus < $shutters->getVentilatePos
|
# : $shutters->getStatus < $shutters->getVentilatePos
|
||||||
);
|
# );
|
||||||
my $queryShuttersPosWinRecComfort = (
|
# my $queryShuttersPosWinRecComfort = (
|
||||||
$shutters->getShuttersPosCmdValueNegate
|
# $shutters->getShuttersPosCmdValueNegate
|
||||||
? $shutters->getStatus > $shutters->getComfortOpenPos
|
# ? $shutters->getStatus > $shutters->getComfortOpenPos
|
||||||
: $shutters->getStatus < $shutters->getComfortOpenPos
|
# : $shutters->getStatus < $shutters->getComfortOpenPos
|
||||||
);
|
# );
|
||||||
|
|
||||||
ASC_Debug( 'EventProcessingWindowRec: '
|
ASC_Debug( 'EventProcessingWindowRec: '
|
||||||
. $shutters->getShuttersDev
|
. $shutters->getShuttersDev
|
||||||
. ' - HOMEMODE: '
|
. ' - HOMEMODE: '
|
||||||
. $homemode
|
. $homemode
|
||||||
. ' QueryShuttersPosWinRecTilted:'
|
. ' QueryShuttersPosWinRecTilted:'
|
||||||
. $queryShuttersPosWinRecTilted
|
. $shutters->getQueryShuttersPos( $shutters->getVentilatePos )
|
||||||
. ' QueryShuttersPosWinRecComfort: '
|
. ' QueryShuttersPosWinRecComfort: '
|
||||||
. $queryShuttersPosWinRecComfort );
|
. $shutters->getQueryShuttersPos( $shutters->getComfortOpenPos )
|
||||||
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$match =~ /close/
|
$match =~ /close/
|
||||||
@@ -993,7 +995,7 @@ sub EventProcessingWindowRec($@) {
|
|||||||
and $shutters->getSubTyp eq 'twostate' )
|
and $shutters->getSubTyp eq 'twostate' )
|
||||||
)
|
)
|
||||||
and $shutters->getVentilateOpen eq 'on'
|
and $shutters->getVentilateOpen eq 'on'
|
||||||
and $queryShuttersPosWinRecTilted
|
and $shutters->getQueryShuttersPos( $shutters->getVentilatePos )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shutters->setLastDrive('ventilate - window open');
|
$shutters->setLastDrive('ventilate - window open');
|
||||||
@@ -1006,12 +1008,13 @@ sub EventProcessingWindowRec($@) {
|
|||||||
my $posValue;
|
my $posValue;
|
||||||
my $setLastDrive;
|
my $setLastDrive;
|
||||||
if ( $ascDev->getAutoShuttersControlComfort eq 'on'
|
if ( $ascDev->getAutoShuttersControlComfort eq 'on'
|
||||||
and $queryShuttersPosWinRecComfort )
|
and
|
||||||
|
$shutters->getQueryShuttersPos( $shutters->getComfortOpenPos ) )
|
||||||
{
|
{
|
||||||
$posValue = $shutters->getComfortOpenPos;
|
$posValue = $shutters->getComfortOpenPos;
|
||||||
$setLastDrive = 'comfort - window open';
|
$setLastDrive = 'comfort - window open';
|
||||||
}
|
}
|
||||||
elsif ( $queryShuttersPosWinRecTilted
|
elsif ( $shutters->getQueryShuttersPos( $shutters->getVentilatePos )
|
||||||
and $shutters->getVentilateOpen eq 'on' )
|
and $shutters->getVentilateOpen eq 'on' )
|
||||||
{
|
{
|
||||||
$posValue = $shutters->getVentilatePos;
|
$posValue = $shutters->getVentilatePos;
|
||||||
@@ -2197,11 +2200,11 @@ sub ShuttersCommandSet($$$) {
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
$shutters->setShuttersDev($shuttersDev);
|
$shutters->setShuttersDev($shuttersDev);
|
||||||
|
|
||||||
my $queryShuttersPosValue = (
|
# my $queryShuttersPosValue = (
|
||||||
$shutters->getShuttersPosCmdValueNegate
|
# $shutters->getShuttersPosCmdValueNegate
|
||||||
? $shutters->getStatus > $posValue
|
# ? $shutters->getStatus > $posValue
|
||||||
: $shutters->getStatus < $posValue
|
# : $shutters->getStatus < $posValue
|
||||||
);
|
# );
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$posValue != $shutters->getShadingPos
|
$posValue != $shutters->getShadingPos
|
||||||
@@ -2226,11 +2229,11 @@ sub ShuttersCommandSet($$$) {
|
|||||||
and ( $shutters->getLockOut eq 'soft'
|
and ( $shutters->getLockOut eq 'soft'
|
||||||
or $shutters->getLockOut eq 'hard' )
|
or $shutters->getLockOut eq 'hard' )
|
||||||
and $ascDev->getHardLockOut eq 'on'
|
and $ascDev->getHardLockOut eq 'on'
|
||||||
and not $queryShuttersPosValue
|
and not $shutters->getQueryShuttersPos($posValue)
|
||||||
)
|
)
|
||||||
or ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2
|
or ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2
|
||||||
and $shutters->getShuttersPlace eq 'terrace'
|
and $shutters->getShuttersPlace eq 'terrace'
|
||||||
and not $queryShuttersPosValue )
|
and not $shutters->getQueryShuttersPos($posValue) )
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -2462,11 +2465,15 @@ sub SunSetShuttersAfterTimerFn($) {
|
|||||||
$shutters->setSunrise(0);
|
$shutters->setSunrise(0);
|
||||||
|
|
||||||
my $posValue;
|
my $posValue;
|
||||||
|
|
||||||
if ( CheckIfShuttersWindowRecOpen($shuttersDev) == 0
|
if ( CheckIfShuttersWindowRecOpen($shuttersDev) == 0
|
||||||
or $shutters->getVentilateOpen eq 'off' )
|
or $shutters->getVentilateOpen eq 'off' )
|
||||||
{
|
{
|
||||||
$posValue = $shutters->getClosedPos;
|
$posValue = $shutters->getClosedPos;
|
||||||
}
|
}
|
||||||
|
elsif ( $shutters->getQueryShuttersPos( $shutters->getVentilatePos ) ) {
|
||||||
|
$posValue = $shutters->getStatus;
|
||||||
|
}
|
||||||
else { $posValue = $shutters->getVentilatePos; }
|
else { $posValue = $shutters->getVentilatePos; }
|
||||||
|
|
||||||
my $homemode = $shutters->getRoommatesStatus;
|
my $homemode = $shutters->getRoommatesStatus;
|
||||||
@@ -2482,14 +2489,15 @@ sub SunSetShuttersAfterTimerFn($) {
|
|||||||
and IsAfterShuttersManualBlocking($shuttersDev)
|
and IsAfterShuttersManualBlocking($shuttersDev)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
my $queryShuttersPosPrivacyDown = (
|
# my $queryShuttersPosPrivacyDown = (
|
||||||
$shutters->getShuttersPosCmdValueNegate
|
# $shutters->getShuttersPosCmdValueNegate
|
||||||
? $shutters->getStatus > $shutters->getPrivacyDownPos
|
# ? $shutters->getStatus > $shutters->getPrivacyDownPos
|
||||||
: $shutters->getStatus < $shutters->getPrivacyDownPos
|
# : $shutters->getStatus < $shutters->getPrivacyDownPos
|
||||||
);
|
# );
|
||||||
|
|
||||||
if ( $funcHash->{privacyMode} == 1
|
if ( $funcHash->{privacyMode} == 1
|
||||||
and not $queryShuttersPosPrivacyDown )
|
and
|
||||||
|
not $shutters->getQueryShuttersPos( $shutters->getPrivacyDownPos ) )
|
||||||
{
|
{
|
||||||
$shutters->setLastDrive('privacy position');
|
$shutters->setLastDrive('privacy position');
|
||||||
ShuttersCommandSet( $hash, $shuttersDev,
|
ShuttersCommandSet( $hash, $shuttersDev,
|
||||||
@@ -3733,6 +3741,18 @@ sub getShuttersPosCmdValueNegate {
|
|||||||
return ( $shutters->getOpenPos < $shutters->getClosedPos ? 1 : 0 );
|
return ( $shutters->getOpenPos < $shutters->getClosedPos ? 1 : 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub getQueryShuttersPos
|
||||||
|
{ # Es wird geschaut ob die aktuelle Position des Rollos unterhalb der Zielposition ist
|
||||||
|
my ( $self, $posValue ) =
|
||||||
|
@_; # wenn dem so ist wird 1 zurück gegeben ansonsten 0
|
||||||
|
|
||||||
|
return (
|
||||||
|
$shutters->getShuttersPosCmdValueNegate
|
||||||
|
? $shutters->getStatus > $posValue
|
||||||
|
: $shutters->getStatus < $posValue
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sub getPosSetCmd {
|
sub getPosSetCmd {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user