From 381daee483c24bcbdff01612d9d1573c913a0746 Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Mon, 7 Sep 2020 07:32:13 +0000 Subject: [PATCH] 73_AutoShuttersControl: add feature isNotDay and all condition for shading is true. shutter drive in the morning from ClosedPos to Shading Pos, add new function to delete Brightness Average Array git-svn-id: https://svn.fhem.de/fhem/trunk@22743 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 5 +++++ fhem/FHEM/73_AutoShuttersControl.pm | 2 +- fhem/lib/FHEM/Automation/ShuttersControl.pm | 2 +- .../ShuttersControl/EventProcessingFunctions.pm | 8 ++++++++ fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm | 9 ++++++++- .../lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm | 8 ++++++++ 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 57eba1a4e..695296189 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,10 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 73_AutoShuttersControl: add feature isNotDay and all condition for + shading is true. shutter drive in the + morning from ClosedPos to Shading Pos, + add new function to delete Brightness + Average Array - bugfix: 59_Twilight: deactivate yahoo service dependend routines - change: 93_DbRep: the the blocking executed commands are monitored with an adjustable timeout, diff --git a/fhem/FHEM/73_AutoShuttersControl.pm b/fhem/FHEM/73_AutoShuttersControl.pm index d36f2e0bc..d7f3afde6 100644 --- a/fhem/FHEM/73_AutoShuttersControl.pm +++ b/fhem/FHEM/73_AutoShuttersControl.pm @@ -1258,7 +1258,7 @@ sub Initialize { ], "release_status": "testing", "license": "GPL_2", - "version": "v0.10.8", + "version": "v0.10.9", "author": [ "Marko Oldenburg " ], diff --git a/fhem/lib/FHEM/Automation/ShuttersControl.pm b/fhem/lib/FHEM/Automation/ShuttersControl.pm index 5cf0ce3ae..489525517 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl.pm @@ -506,7 +506,7 @@ sub Notify { { # Kommt ein globales Event und beinhaltet folgende Syntax wird die Funktion zur Verarbeitung aufgerufen if ( grep -m{^(ATTR|DELETEATTR)\s(.*ASC_Time_Up_WE_Holiday|.*ASC_Up|.*ASC_Down|.*ASC_AutoAstroModeMorning|.*ASC_AutoAstroModeMorningHorizon|.*ASC_AutoAstroModeEvening|.*ASC_AutoAstroModeEveningHorizon|.*ASC_Time_Up_Early|.*ASC_Time_Up_Late|.*ASC_Time_Down_Early|.*ASC_Time_Down_Late|.*ASC_autoAstroModeMorning|.*ASC_autoAstroModeMorningHorizon|.*ASC_PrivacyDownValue_beforeNightClose|.*ASC_PrivacyUpValue_beforeDayOpen|.*ASC_autoAstroModeEvening|.*ASC_autoAstroModeEveningHorizon|.*ASC_Roommate_Device|.*ASC_WindowRec|.*ASC_residentsDev|.*ASC_rainSensor|.*ASC_windSensor|.*ASC_tempSensor|.*ASC_BrightnessSensor|.*ASC_twilightDevice|.*ASC_ExternalTrigger)(\s.*|$)}xms, +m{^(ATTR|DELETEATTR)\s(.*ASC_Time_Up_WE_Holiday|.*ASC_Up|.*ASC_Down|.*ASC_AutoAstroModeMorning|.*ASC_AutoAstroModeMorningHorizon|.*ASC_AutoAstroModeEvening|.*ASC_AutoAstroModeEveningHorizon|.*ASC_Time_Up_Early|.*ASC_Time_Up_Late|.*ASC_Time_Down_Early|.*ASC_Time_Down_Late|.*ASC_autoAstroModeMorning|.*ASC_autoAstroModeMorningHorizon|.*ASC_PrivacyDownValue_beforeNightClose|.*ASC_PrivacyUpValue_beforeDayOpen|.*ASC_autoAstroModeEvening|.*ASC_autoAstroModeEveningHorizon|.*ASC_Roommate_Device|.*ASC_WindowRec|.*ASC_residentsDev|.*ASC_rainSensor|.*ASC_windSensor|.*ASC_tempSensor|.*ASC_BrightnessSensor|.*ASC_twilightDevice|.*ASC_ExternalTrigger|.*ASC_Shading_StateChange_SunnyCloudy)(\s.*|$)}xms, @{$events} ) { diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 60ce176bc..1f1538236 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -190,6 +190,14 @@ sub EventProcessingGeneral { { FHEM::Automation::ShuttersControl::RenewSunRiseSetShuttersTimer($hash); } + elsif ( + $events =~ m{^(DELETEATTR|ATTR) + \s(.*)\s(ASC_Shading_StateChange_SunnyCloudy) + (.*)?}xms + ) + { + $FHEM::Automation::ShuttersControl::shutters->deleteShadingStateChangeSunny; + } if ( $events =~ diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm index afba795f5..2da13966f 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm @@ -294,7 +294,9 @@ sub ShadingProcessing { ->getShadingMinOutsideTemperature - 4 || $azimuth < $azimuthLeft || $azimuth > $azimuthRight - || !$FHEM::Automation::ShuttersControl::shutters->getIsDay + || ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay + && $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime + - ( int( gettimeofday() ) ) > 7200 ) ) && $FHEM::Automation::ShuttersControl::shutters->getShadingStatus ne 'out' @@ -533,6 +535,11 @@ sub ShadingProcessingDriveCommand { && $marker ) ) + && ( $getStatus != $FHEM::Automation::ShuttersControl::shutters->getSleepPos + || ( $getStatus == $FHEM::Automation::ShuttersControl::shutters->getSleepPos + && $marker + ) + ) && ( FHEM::Automation::ShuttersControl::CheckIfShuttersWindowRecOpen( $shuttersDev) != 2 diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm index d6eea51a5..9128d3cac 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm @@ -919,6 +919,14 @@ sub setShadingStateChangeSunnyCloudy { return; } +sub deleteShadingStateChangeSunny { + my $self = shift; + + delete $self->{ $self->{shuttersDev} }->{BrightnessAverageArray}; + + return; +} + sub getShadingStateChangeSunny { my $self = shift;