From 8c17eb5f6a6bddfc2a4bb49ad918fb5f2f1c1d74 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 4 Dec 2021 09:55:46 +0100 Subject: [PATCH 1/8] change condition of Window events if the place is terrace --- controls_AutoShuttersControl.txt | 6 +++--- .../ShuttersControl/EventProcessingFunctions.pm | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index c26c0aa..8e2bbbb 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,10 +1,10 @@ -UPD 2021-11-29_15:18:18 115678 FHEM/73_AutoShuttersControl.pm +UPD 2021-12-04_08:08:23 115678 FHEM/73_AutoShuttersControl.pm UPD 2021-11-29_15:01:56 75264 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm -UPD 2021-10-09_07:12:54 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-11-25_11:58:42 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-04_09:50:00 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm +UPD 2021-12-04_09:55:27 110814 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 1050927..d8b7103 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -243,9 +243,14 @@ sub EventProcessingWindowRec { $FHEM::Automation::ShuttersControl::shutters->getWinDevReading; if ( $events =~ - m{.*$reading:.*?([Oo]pen(?>ed)?|[Cc]losed?|tilt(?>ed)?|true|false)}xms - && IsAfterShuttersManualBlocking($shuttersDev) ) + m{.*$reading:.*?([Oo]pen(?>ed)?|[Cc]losed?|tilt(?>ed)?|true|false)}xms ) { + + return + if ( IsAfterShuttersManualBlocking($shuttersDev) + && $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace + ne 'terrace' ); + my $match = $1; FHEM::Automation::ShuttersControl::ASC_Debug( From a61458cfc2d6d6af11686fd9a8b1d72172d3ab01 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 4 Dec 2021 10:22:22 +0100 Subject: [PATCH 2/8] fix logical issues --- controls_AutoShuttersControl.txt | 2 +- .../ShuttersControl/EventProcessingFunctions.pm | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 8e2bbbb..76ecbb7 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -4,7 +4,7 @@ UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-12-04_09:50:00 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-04_09:55:27 110814 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-04_10:22:07 110801 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index d8b7103..ab85d02 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -245,11 +245,11 @@ sub EventProcessingWindowRec { if ( $events =~ m{.*$reading:.*?([Oo]pen(?>ed)?|[Cc]losed?|tilt(?>ed)?|true|false)}xms ) { - return - if ( IsAfterShuttersManualBlocking($shuttersDev) - && $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace - ne 'terrace' ); + if ( !IsAfterShuttersManualBlocking($shuttersDev) + && $FHEM::Automation::ShuttersControl::shutters->getLockOut + eq 'off' ); + my $match = $1; From 89431a2af3e7d0d29ceb3f37dc31d7bbc51e84b2 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 4 Dec 2021 20:48:53 +0100 Subject: [PATCH 3/8] change hardBlock action if shutters pos close --- controls_AutoShuttersControl.txt | 4 +- .../EventProcessingFunctions.pm | 271 ++++++++++-------- 2 files changed, 159 insertions(+), 116 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index f125295..ef5e145 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -3,8 +3,8 @@ UPD 2021-11-29_15:01:56 75264 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm -UPD 2021-12-04_09:50:00 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-04_10:54:53 111003 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-04_10:58:06 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm +UPD 2021-12-04_20:47:39 112341 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index c93d5e0..63dbcb2 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -54,18 +54,18 @@ use FHEM::Automation::ShuttersControl::Rainprotection qw (:ALL); require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw( - EventProcessingPartyMode - EventProcessingGeneral - EventProcessingShutters - EventProcessingAdvShuttersClose + EventProcessingPartyMode + EventProcessingGeneral + EventProcessingShutters + EventProcessingAdvShuttersClose ); our %EXPORT_TAGS = ( ALL => [ qw( - EventProcessingPartyMode - EventProcessingGeneral - EventProcessingShutters - EventProcessingAdvShuttersClose + EventProcessingPartyMode + EventProcessingGeneral + EventProcessingShutters + EventProcessingAdvShuttersClose ) ], ); @@ -75,12 +75,12 @@ use GPUtils qw(GP_Import); BEGIN { GP_Import( qw( - Log3 - gettimeofday - computeAlignTime - CommandSet - ReadingsVal - RemoveInternalTimer + Log3 + gettimeofday + computeAlignTime + CommandSet + ReadingsVal + RemoveInternalTimer ) ); } @@ -94,8 +94,12 @@ sub EventProcessingGeneral { if ( defined($devname) && ($devname) ) { # es wird lediglich der Devicename der Funktion mitgegeben wenn es sich nicht um global handelt daher hier die Unterscheidung - my $windReading = $FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading // 'none'; - my $rainReading = $FHEM::Automation::ShuttersControl::ascDev->getRainSensorReading // 'none'; + my $windReading = + $FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading + // 'none'; + my $rainReading = + $FHEM::Automation::ShuttersControl::ascDev->getRainSensorReading + // 'none'; while ( my ( $device, $deviceAttr ) = each %{ $hash->{monitoredDevs}{$devname} } ) @@ -122,13 +126,16 @@ sub EventProcessingGeneral { EventProcessingExternalTriggerDevice( $hash, $device, $events ) if ( $deviceAttr eq 'ASC_ExternalTrigger' ); - $FHEM::Automation::ShuttersControl::shutters->setShuttersDev($device) + $FHEM::Automation::ShuttersControl::shutters->setShuttersDev( + $device) if ( $deviceAttr eq 'ASC_BrightnessSensor' ); if ( $deviceAttr eq 'ASC_BrightnessSensor' - && ( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'brightness' - || $FHEM::Automation::ShuttersControl::shutters->getUp eq 'brightness' ) + && ( $FHEM::Automation::ShuttersControl::shutters->getDown eq + 'brightness' + || $FHEM::Automation::ShuttersControl::shutters->getUp eq + 'brightness' ) ) { EventProcessingBrightness( $hash, $device, $events ); @@ -147,7 +154,8 @@ sub EventProcessingGeneral { \s(.*)$}xms ) { # wurde den Attributen unserer Rolläden ein Wert zugewiesen ? - FHEM::Automation::ShuttersControl::AddNotifyDev( $hash, $3, $1, $2 ) if ( $3 ne 'none' ); + FHEM::Automation::ShuttersControl::AddNotifyDev( $hash, $3, $1, $2 ) + if ( $3 ne 'none' ); Log3( $name, 4, "AutoShuttersControl ($name) - EventProcessing: ATTR" ); } @@ -175,11 +183,13 @@ sub EventProcessingGeneral { (.*)?}xms ) { - FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer( $hash, $2 ) + FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer( + $hash, $2 ) if ( $3 ne 'ASC_Time_Up_WE_Holiday' || ( $3 eq 'ASC_Time_Up_WE_Holiday' - && $FHEM::Automation::ShuttersControl::ascDev->getSunriseTimeWeHoliday eq 'on' ) + && $FHEM::Automation::ShuttersControl::ascDev + ->getSunriseTimeWeHoliday eq 'on' ) ); } elsif ( @@ -189,7 +199,8 @@ sub EventProcessingGeneral { (.*)?}xms ) { - FHEM::Automation::ShuttersControl::RenewSunRiseSetShuttersTimer($hash); + FHEM::Automation::ShuttersControl::RenewSunRiseSetShuttersTimer( + $hash); } elsif ( $events =~ m{^(DELETEATTR|ATTR) @@ -197,7 +208,8 @@ sub EventProcessingGeneral { (.*)?}xms ) { - $FHEM::Automation::ShuttersControl::shutters->deleteShadingStateChangeSunny; + $FHEM::Automation::ShuttersControl::shutters + ->deleteShadingStateChangeSunny; } if ( @@ -210,20 +222,21 @@ m{^(DELETEATTR|ATTR) #global ATTR myASC ASC_tempSensor Cellar (.*)?}xms ) { -# ATTR RolloKinZimSteven_F1 ASC_Shading_Mode off + # ATTR RolloKinZimSteven_F1 ASC_Shading_Mode off if ( $events =~ m{^ATTR\s(.*)\sASC_Shading_Mode\s(off)}xms ) { my %funcHash = ( - hash => $hash, - shuttersdevice => $1, - value => $2, - attrEvent => 1, + hash => $hash, + shuttersdevice => $1, + value => $2, + attrEvent => 1, ); - FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn(\%funcHash); + FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn( + \%funcHash ); } else { CommandSet( undef, $name . ' controlShading on' ) - if ( ReadingsVal( $name, 'controlShading', 'off' ) ne 'off' ); + if ( ReadingsVal( $name, 'controlShading', 'off' ) ne 'off' ); } } } @@ -247,9 +260,8 @@ sub EventProcessingWindowRec { { return if ( !IsAfterShuttersManualBlocking($shuttersDev) - && $FHEM::Automation::ShuttersControl::shutters->getLockOut - eq 'off' ); - + && $FHEM::Automation::ShuttersControl::shutters->getLockOut eq + 'off' ); my $match = $1; @@ -279,7 +291,11 @@ sub EventProcessingWindowRec { $FHEM::Automation::ShuttersControl::shutters->setHardLockOut('on') if ( $match =~ m{[Oo]pen|false}xms && $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace - eq 'terrace' ); + eq 'terrace' + && $FHEM::Automation::ShuttersControl::shutters->getStatus != + $FHEM::Automation::ShuttersControl::shutters->getOpenPos + && $FHEM::Automation::ShuttersControl::shutters->getStatus != + $FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos ); FHEM::Automation::ShuttersControl::ASC_Debug( 'EventProcessingWindowRec: ' @@ -288,12 +304,12 @@ sub EventProcessingWindowRec { . $homemode . ' QueryShuttersPosWinRecTilted:' . $FHEM::Automation::ShuttersControl::shutters - ->getQueryShuttersPos( + ->getQueryShuttersPos( $FHEM::Automation::ShuttersControl::shutters->getVentilatePos ) . ' QueryShuttersPosWinRecComfort: ' . $FHEM::Automation::ShuttersControl::shutters - ->getQueryShuttersPos( + ->getQueryShuttersPos( $FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos ) ); @@ -306,41 +322,40 @@ sub EventProcessingWindowRec { $FHEM::Automation::ShuttersControl::shutters->getVentilatePos || $FHEM::Automation::ShuttersControl::shutters->getStatus == $FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos - || ( $FHEM::Automation::ShuttersControl::shutters->getStatus == + || ( $FHEM::Automation::ShuttersControl::shutters->getStatus == $FHEM::Automation::ShuttersControl::shutters->getOpenPos - && $FHEM::Automation::ShuttersControl::shutters->getLastDrive - eq 'ventilate - window open' + && $FHEM::Automation::ShuttersControl::shutters + ->getLastDrive eq 'ventilate - window open' && $FHEM::Automation::ShuttersControl::shutters->getSubTyp - eq 'twostate' - && $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen - eq 'on' ) + eq 'twostate' + && $FHEM::Automation::ShuttersControl::shutters + ->getVentilateOpen eq 'on' ) || ( $FHEM::Automation::ShuttersControl::shutters->getStatus == $FHEM::Automation::ShuttersControl::shutters - ->getPrivacyDownPos + ->getPrivacyDownPos && $FHEM::Automation::ShuttersControl::shutters - ->getPrivacyDownStatus != 2 + ->getPrivacyDownStatus != 2 && !$FHEM::Automation::ShuttersControl::shutters->getIsDay ) - || ( $FHEM::Automation::ShuttersControl::shutters->getStatus == - $FHEM::Automation::ShuttersControl::shutters - ->getOpenPos - && ( $FHEM::Automation::ShuttersControl::shutters - ->getLockOut ne 'off' + || ( + $FHEM::Automation::ShuttersControl::shutters->getStatus == + $FHEM::Automation::ShuttersControl::shutters->getOpenPos + && ( $FHEM::Automation::ShuttersControl::shutters + ->getLockOut ne 'off' || $FHEM::Automation::ShuttersControl::shutters - ->getShuttersPlace eq 'terrace' - ) - && !$FHEM::Automation::ShuttersControl::shutters->getIsDay ) + ->getShuttersPlace eq 'terrace' ) + && !$FHEM::Automation::ShuttersControl::shutters->getIsDay + ) || ( $FHEM::Automation::ShuttersControl::shutters->getStatus == - $FHEM::Automation::ShuttersControl::shutters - ->getOpenPos + $FHEM::Automation::ShuttersControl::shutters->getOpenPos && $FHEM::Automation::ShuttersControl::shutters - ->getDelayCmd ne 'none' + ->getDelayCmd ne 'none' && $FHEM::Automation::ShuttersControl::shutters - ->getShuttersPlace eq 'terrace' ) + ->getShuttersPlace eq 'terrace' ) ) && ( $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen eq 'on' || $FHEM::Automation::ShuttersControl::ascDev - ->getAutoShuttersControlComfort eq 'on' ) + ->getAutoShuttersControlComfort eq 'on' ) ) { FHEM::Automation::ShuttersControl::ASC_Debug( @@ -376,18 +391,19 @@ sub EventProcessingWindowRec { elsif ( !$FHEM::Automation::ShuttersControl::shutters ->getIfInShading - && ( $FHEM::Automation::ShuttersControl::shutters->getStatus + && ( + $FHEM::Automation::ShuttersControl::shutters->getStatus != $FHEM::Automation::ShuttersControl::shutters ->getOpenPos || $FHEM::Automation::ShuttersControl::shutters ->getStatus != $FHEM::Automation::ShuttersControl::shutters ->getLastManPos - || ( $FHEM::Automation::ShuttersControl::shutters - ->getDelayCmd ne 'none' + || ( $FHEM::Automation::ShuttersControl::shutters + ->getDelayCmd ne 'none' && $FHEM::Automation::ShuttersControl::shutters - ->getShuttersPlace eq 'terrace' ) - ) + ->getShuttersPlace eq 'terrace' ) + ) ) { if ( $FHEM::Automation::ShuttersControl::shutters @@ -412,40 +428,44 @@ sub EventProcessingWindowRec { ->setDriveCmd( ( $FHEM::Automation::ShuttersControl::shutters - ->getDelayCmd ne 'none' + ->getDelayCmd ne 'none' && $FHEM::Automation::ShuttersControl::shutters - ->getShuttersPlace eq 'terrace' + ->getShuttersPlace eq 'terrace' ? $FHEM::Automation::ShuttersControl::shutters - ->getDelayCmd - : ( $FHEM::Automation::ShuttersControl::shutters + ->getDelayCmd + : ( + $FHEM::Automation::ShuttersControl::shutters ->getVentilatePosAfterDayClosed eq 'open' - ? $FHEM::Automation::ShuttersControl::shutters - ->getOpenPos - : $FHEM::Automation::ShuttersControl::shutters - ->getLastManPos ) + ? $FHEM::Automation::ShuttersControl::shutters + ->getOpenPos + : $FHEM::Automation::ShuttersControl::shutters + ->getLastManPos + ) ) ); } } } elsif ( - !$FHEM::Automation::ShuttersControl::shutters->getIsDay - && $FHEM::Automation::ShuttersControl::shutters->getModeDown eq 'roommate' - && ( $FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus eq 'home' - || $FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus eq 'awoken' ) + !$FHEM::Automation::ShuttersControl::shutters->getIsDay + && $FHEM::Automation::ShuttersControl::shutters->getModeDown eq + 'roommate' + && ( $FHEM::Automation::ShuttersControl::shutters + ->getRoommatesStatus eq 'home' + || $FHEM::Automation::ShuttersControl::shutters + ->getRoommatesStatus eq 'awoken' ) ) { - $FHEM::Automation::ShuttersControl::shutters - ->setDriveCmd( - ( - $FHEM::Automation::ShuttersControl::shutters - ->getVentilatePosAfterDayClosed eq 'open' - ? $FHEM::Automation::ShuttersControl::shutters - ->getOpenPos - : $FHEM::Automation::ShuttersControl::shutters - ->getLastManPos - ) - ); + $FHEM::Automation::ShuttersControl::shutters->setDriveCmd( + ( + $FHEM::Automation::ShuttersControl::shutters + ->getVentilatePosAfterDayClosed eq 'open' + ? $FHEM::Automation::ShuttersControl::shutters + ->getOpenPos + : $FHEM::Automation::ShuttersControl::shutters + ->getLastManPos + ) + ); } elsif ( $FHEM::Automation::ShuttersControl::shutters->getModeDown ne @@ -826,7 +846,7 @@ sub EventProcessingRoommate { elsif ( ( $event eq 'gotosleep' || $event eq 'asleep' ) && $FHEM::Automation::ShuttersControl::shutters->getModeDown ne - 'absent' + 'absent' && ( $FHEM::Automation::ShuttersControl::ascDev ->getAutoShuttersControlEvening eq 'on' || $FHEM::Automation::ShuttersControl::shutters->getDown eq @@ -980,6 +1000,7 @@ sub EventProcessingResidents { && $FHEM::Automation::ShuttersControl::shutters ->getSelfDefenseMode ne 'off' || $getModeDown eq 'absent' + # || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github || ( $FHEM::Automation::ShuttersControl::shutters ->getShadingMode eq 'absent' @@ -997,15 +1018,17 @@ sub EventProcessingResidents { && ( $FHEM::Automation::ShuttersControl::shutters ->getSelfDefenseMode eq 'absent' - || ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + || ( + CheckIfShuttersWindowRecOpen($shuttersDev) == 2 && $FHEM::Automation::ShuttersControl::shutters ->getSelfDefenseMode eq 'gone' && ( $FHEM::Automation::ShuttersControl::shutters ->getShuttersPlace eq 'terrace' - || $FHEM::Automation::ShuttersControl::shutters + || $FHEM::Automation::ShuttersControl::shutters ->getShuttersPlace eq 'EG_window' ) && $FHEM::Automation::ShuttersControl::shutters - ->getSelfDefenseMode ne 'off' ) + ->getSelfDefenseMode ne 'off' + ) ) ) { @@ -1056,11 +1079,14 @@ sub EventProcessingResidents { $FHEM::Automation::ShuttersControl::shutters ->getLastPos ); } - elsif ( $getModeDown eq 'absent' # || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github + elsif ( + $getModeDown eq + 'absent' # || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github && !$FHEM::Automation::ShuttersControl::shutters->getIsDay && IsAfterShuttersTimeBlocking($shuttersDev) && $FHEM::Automation::ShuttersControl::shutters - ->getRoommatesStatus eq 'none' ) + ->getRoommatesStatus eq 'none' + ) { $FHEM::Automation::ShuttersControl::shutters->setLastDrive( 'residents absent'); @@ -1120,7 +1146,8 @@ sub EventProcessingResidents { ->getRoommatesStatus eq 'none' && ( $getModeDown eq 'home' || $getModeDown eq 'always' ) - && $FHEM::Automation::ShuttersControl::ascDev->getAutoShuttersControlEvening eq 'on' + && $FHEM::Automation::ShuttersControl::ascDev + ->getAutoShuttersControlEvening eq 'on' && $getResidentsLastStatus ne 'asleep' && $getResidentsLastStatus ne 'awoken' && IsAfterShuttersTimeBlocking($shuttersDev) @@ -1268,7 +1295,8 @@ sub EventProcessingResidents { ->getRoommatesStatus eq 'none' && ( $getModeUp eq 'home' || $getModeUp eq 'always' ) - && $FHEM::Automation::ShuttersControl::ascDev->getAutoShuttersControlMorning eq 'on' + && $FHEM::Automation::ShuttersControl::ascDev + ->getAutoShuttersControlMorning eq 'on' && IsAfterShuttersTimeBlocking($shuttersDev) && !$FHEM::Automation::ShuttersControl::shutters->getIfInShading && !$FHEM::Automation::ShuttersControl::shutters @@ -1387,8 +1415,9 @@ sub EventProcessingWind { $FHEM::Automation::ShuttersControl::shutters->getIsDay ? $FHEM::Automation::ShuttersControl::shutters ->getLastPos - : ( $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace - eq 'awning' + : ( + $FHEM::Automation::ShuttersControl::shutters + ->getShuttersPlace eq 'awning' ? $FHEM::Automation::ShuttersControl::shutters ->getOpenPos : ( @@ -1799,7 +1828,8 @@ sub EventProcessingBrightness { . $FHEM::Automation::ShuttersControl::shutters ->getLastDrive ); - FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer( $hash, $shuttersDev ); + FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer( + $hash, $shuttersDev ); } else { $FHEM::Automation::ShuttersControl::shutters @@ -1976,10 +2006,8 @@ sub EventProcessingBrightness { $FHEM::Automation::ShuttersControl::shutters->setLastDrive( $lastDrive); - if ( - $FHEM::Automation::ShuttersControl::shutters - ->getPrivacyDownStatus != 2 - ) + if ( $FHEM::Automation::ShuttersControl::shutters + ->getPrivacyDownStatus != 2 ) { $FHEM::Automation::ShuttersControl::shutters->setSunrise(0); $FHEM::Automation::ShuttersControl::shutters->setSunset(1); @@ -2169,17 +2197,17 @@ sub EventProcessingTwilightDevice { . $FHEM::Automation::ShuttersControl::shutters->getShuttersDev . ' RainProtection: ' . $FHEM::Automation::ShuttersControl::shutters - ->getRainProtectionStatus + ->getRainProtectionStatus . ' WindProtection: ' . $FHEM::Automation::ShuttersControl::shutters - ->getWindProtectionStatus ); + ->getWindProtectionStatus ); - if ( $FHEM::Automation::ShuttersControl::ascDev - ->getAutoShuttersControlShading eq 'on' + if ( $FHEM::Automation::ShuttersControl::ascDev + ->getAutoShuttersControlShading eq 'on' && $FHEM::Automation::ShuttersControl::shutters - ->getRainProtectionStatus eq 'unprotected' + ->getRainProtectionStatus eq 'unprotected' && $FHEM::Automation::ShuttersControl::shutters - ->getWindProtectionStatus eq 'unprotected' ) + ->getWindProtectionStatus eq 'unprotected' ) { ShadingProcessing( $hash, @@ -2248,12 +2276,14 @@ sub EventProcessingPartyMode { $shuttersDev, ( CheckIfShuttersWindowRecOpen($shuttersDev) == 0 - ? ($FHEM::Automation::ShuttersControl::shutters + ? ( + $FHEM::Automation::ShuttersControl::shutters ->getSleepPos > 0 ? $FHEM::Automation::ShuttersControl::shutters - ->getSleepPos + ->getSleepPos : $FHEM::Automation::ShuttersControl::shutters - ->getClosedPos) + ->getClosedPos + ) : $FHEM::Automation::ShuttersControl::shutters ->getVentilatePos ) @@ -2261,7 +2291,7 @@ sub EventProcessingPartyMode { } } elsif ( - $FHEM::Automation::ShuttersControl::shutters->getDelayCmd ne 'none' + $FHEM::Automation::ShuttersControl::shutters->getDelayCmd ne 'none' && $FHEM::Automation::ShuttersControl::shutters->getIsDay && IsAfterShuttersManualBlocking($shuttersDev) ) { @@ -2373,6 +2403,22 @@ sub EventProcessingShutters { $FHEM::Automation::ShuttersControl::shutters->setLastDriveReading; $FHEM::Automation::ShuttersControl::ascDev->setStateReading; + $FHEM::Automation::ShuttersControl::shutters->setHardLockOut('on') + if ( + ( + $FHEM::Automation::ShuttersControl::shutters->getStatus == + $FHEM::Automation::ShuttersControl::shutters + ->getComfortOpenPos + || ( $FHEM::Automation::ShuttersControl::shutters->getStatus + == $FHEM::Automation::ShuttersControl::shutters + ->getOpenPos + && $FHEM::Automation::ShuttersControl::shutters + ->getLastDrive eq 'ventilate - window open' ) + ) + && $FHEM::Automation::ShuttersControl::shutters + ->getShuttersPlace eq 'terrace' + ); + FHEM::Automation::ShuttersControl::ASC_Debug( 'EventProcessingShutters: eine automatisierte Fahrt durch ASC wurde erkannt! Es werden nun die LastDriveReading und StateReading Werte gesetzt!' ); @@ -2485,7 +2531,4 @@ sub EventProcessingExternalTriggerDevice { return; } - - - 1; From 427018ab463d087c3e6b9c54c6b7fd48ce76f16f Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sun, 5 Dec 2021 07:44:51 +0100 Subject: [PATCH 4/8] bugfix --- controls_AutoShuttersControl.txt | 2 +- .../Automation/ShuttersControl/EventProcessingFunctions.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index ef5e145..961f625 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -4,7 +4,7 @@ UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-12-04_10:58:06 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-04_20:47:39 112341 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-05_07:44:21 112341 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 63dbcb2..4b8b6cd 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -292,9 +292,9 @@ sub EventProcessingWindowRec { if ( $match =~ m{[Oo]pen|false}xms && $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace eq 'terrace' - && $FHEM::Automation::ShuttersControl::shutters->getStatus != + && $FHEM::Automation::ShuttersControl::shutters->getStatus == $FHEM::Automation::ShuttersControl::shutters->getOpenPos - && $FHEM::Automation::ShuttersControl::shutters->getStatus != + && $FHEM::Automation::ShuttersControl::shutters->getStatus == $FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos ); FHEM::Automation::ShuttersControl::ASC_Debug( From ef590e002edbaca1dccf2a0f65d7f200e3737444 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sun, 5 Dec 2021 11:01:19 +0100 Subject: [PATCH 5/8] change logical in condition --- controls_AutoShuttersControl.txt | 2 +- .../ShuttersControl/EventProcessingFunctions.pm | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 961f625..a9ce10b 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -4,7 +4,7 @@ UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-12-04_10:58:06 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-05_07:44:21 112341 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-05_11:01:06 112397 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 4b8b6cd..632b90c 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -289,13 +289,16 @@ sub EventProcessingWindowRec { && $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace eq 'terrace' ); $FHEM::Automation::ShuttersControl::shutters->setHardLockOut('on') - if ( $match =~ m{[Oo]pen|false}xms + if ( + $match =~ m{[Oo]pen|false}xms && $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace eq 'terrace' - && $FHEM::Automation::ShuttersControl::shutters->getStatus == - $FHEM::Automation::ShuttersControl::shutters->getOpenPos - && $FHEM::Automation::ShuttersControl::shutters->getStatus == - $FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos ); + && ( $FHEM::Automation::ShuttersControl::shutters->getStatus == + $FHEM::Automation::ShuttersControl::shutters->getOpenPos + || $FHEM::Automation::ShuttersControl::shutters->getStatus == + $FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos + ) + ); FHEM::Automation::ShuttersControl::ASC_Debug( 'EventProcessingWindowRec: ' From 32a3ac9d13e14c73e0c034af33da60d6efb47d8a Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 8 Dec 2021 11:14:46 +0100 Subject: [PATCH 6/8] change condition for BlockingAfterManualDrive in WendowRec Section --- controls_AutoShuttersControl.txt | 6 ++--- .../EventProcessingFunctions.pm | 26 ++++++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index a9ce10b..fa2cf23 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,10 +1,10 @@ -UPD 2021-12-04_08:08:23 115678 FHEM/73_AutoShuttersControl.pm +UPD 2021-12-06_06:34:51 115678 FHEM/73_AutoShuttersControl.pm UPD 2021-11-29_15:01:56 75264 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-12-04_10:58:06 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-05_11:01:06 112397 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-08_11:14:32 112619 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm @@ -13,4 +13,4 @@ UPD 2021-10-27_08:50:46 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr. UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-11-25_08:28:33 6965 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-12-06_06:34:51 6965 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 632b90c..0545130 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -260,8 +260,11 @@ sub EventProcessingWindowRec { { return if ( !IsAfterShuttersManualBlocking($shuttersDev) - && $FHEM::Automation::ShuttersControl::shutters->getLockOut eq - 'off' ); + && ( $FHEM::Automation::ShuttersControl::shutters->getLockOut eq + 'off' + || $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace + ne 'terrace' ) + ); my $match = $1; @@ -277,11 +280,7 @@ sub EventProcessingWindowRec { $FHEM::Automation::ShuttersControl::shutters->setShuttersDev( $shuttersDev); - my $homemode = - $FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus; - $homemode = - $FHEM::Automation::ShuttersControl::ascDev->getResidentsStatus - if ( $homemode eq 'none' ); + #### Hardware Lock der Rollläden $FHEM::Automation::ShuttersControl::shutters->setHardLockOut('off') @@ -300,6 +299,19 @@ sub EventProcessingWindowRec { ) ); + + return + if ( !IsAfterShuttersManualBlocking($shuttersDev); + + + + + my $homemode = + $FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus; + $homemode = + $FHEM::Automation::ShuttersControl::ascDev->getResidentsStatus + if ( $homemode eq 'none' ); + FHEM::Automation::ShuttersControl::ASC_Debug( 'EventProcessingWindowRec: ' . $FHEM::Automation::ShuttersControl::shutters->getShuttersDev From 5928276b743c72ed5ba8402c55009e48f6cc3f95 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 8 Dec 2021 11:35:55 +0100 Subject: [PATCH 7/8] fix little bug is shutter position above the window tilted position and shutters place is terrace and sybType is twoState and event is window open --- controls_AutoShuttersControl.txt | 2 +- .../Automation/ShuttersControl/EventProcessingFunctions.pm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index fa2cf23..d1afc87 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -4,7 +4,7 @@ UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-12-04_10:58:06 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-08_11:14:32 112619 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-08_11:35:42 112808 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 0545130..eb9dfc6 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -535,9 +535,11 @@ sub EventProcessingWindowRec { ) && $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen eq 'on' - && $FHEM::Automation::ShuttersControl::shutters + && ( $FHEM::Automation::ShuttersControl::shutters ->getQueryShuttersPos( - $FHEM::Automation::ShuttersControl::shutters->getVentilatePos + $FHEM::Automation::ShuttersControl::shutters->getVentilatePos) + || ( $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace eq 'terrace' + && $FHEM::Automation::ShuttersControl::shutters->getSubTyp eq 'twostate' ) ) ) { From f0f5cbde4b93949ae463f461ca61032e354cc2ab Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 8 Dec 2021 11:45:22 +0100 Subject: [PATCH 8/8] fix syntax error --- controls_AutoShuttersControl.txt | 2 +- lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index d1afc87..265dbee 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -4,7 +4,7 @@ UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-12-04_10:58:06 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-12-08_11:35:42 112808 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-12-08_11:45:16 112810 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm diff --git a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index eb9dfc6..c9f4e5a 100644 --- a/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -301,7 +301,7 @@ sub EventProcessingWindowRec { return - if ( !IsAfterShuttersManualBlocking($shuttersDev); + if ( !IsAfterShuttersManualBlocking($shuttersDev) );