diff --git a/fhem/CHANGED b/fhem/CHANGED index 5b976f486..86eeb6cbd 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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: 74_AutoShuttersControl: fix many bugs reported by users - bugfix: 70_BRAVIA: fix volume info from headphone - change: 70_BRAVIA: new package FHEM::BRAVIA, PBP changes - feature: 52_I2C_ADS1x1x: New module for TI AD Converters diff --git a/fhem/FHEM/73_AutoShuttersControl.pm b/fhem/FHEM/73_AutoShuttersControl.pm index 1a67e748d..6378d116d 100644 --- a/fhem/FHEM/73_AutoShuttersControl.pm +++ b/fhem/FHEM/73_AutoShuttersControl.pm @@ -41,17 +41,12 @@ # !!!!! - Innerhalb einer Shutterschleife kein CommandAttr verwenden. Bring Fehler!!! Kommen Raumnamen in die Shutterliste !!!!!! # -package main; - -use Meta; - - - package FHEM::AutoShuttersControl; use strict; use warnings; use utf8; +use FHEM::Meta; use FHEM::Automation::ShuttersControl; use GPUtils qw(GP_Import GP_Export); @@ -105,6 +100,7 @@ sub Initialize { . 'ASC_expert:1 ' . 'ASC_blockAscDrivesAfterManual:0,1 ' . 'ASC_debug:1 ' + . 'ASC_advDate:DeadSunday,FirstAdvent ' . $readingFnAttributes; $hash->{NotifyOrderPrefix} = '51-'; # Order Nummer für NotifyFn $hash->{FW_detailFn} = @@ -316,6 +312,9 @@ sub Initialize {
  • ASC_freezeTemp - Temperature threshold for the freeze protection. The freeze protection prevents the shutter to be operated by ASC. Last operating order will be kept.
  • + +
  • ASC_advDate - Advent Season, selected FirstAdvent or DeadSunday. +
  • ASC_rainSensor DEVICENAME[:READINGNAME] MAXTRIGGER[:HYSTERESE] [CLOSEDPOS] - Contains settings for the rain protection. DEVICNAME specifies a rain sensor, the optional @@ -890,6 +889,8 @@ sub Initialize {
  • ASC_expert - ist der Wert 1, so werden erweiterte Informationen bezüglich des NotifyDevs unter set und get angezeigt
  • ASC_freezeTemp - Temperatur, ab welcher der Frostschutz greifen soll und der Rollladen nicht mehr fährt. Der letzte Fahrbefehl wird gespeichert.
  • + +
  • ASC_advDate - Adventszeit, Auswahl ab wann die Adventszeit beginnen soll.
  • ASC_rainSensor - DEVICENAME[:READINGNAME] MAXTRIGGER[:HYSTERESE] [CLOSEDPOS:[WAITINGTIME]] - der Inhalt ist eine Kombination aus Devicename, Readingname, Wert ab dem getriggert werden soll, Hysterese Wert ab dem der Status Regenschutz aufgehoben werden soll und der "wegen Regen geschlossen Position", sowie der Wartezeit bis dann tatsächlich die aktion ausgeführt wird.
  • @@ -1264,7 +1265,7 @@ sub Initialize { ], "release_status": "testing", "license": "GPL_2", - "version": "v0.10.10", + "version": "v0.10.11", "author": [ "Marko Oldenburg " ], diff --git a/fhem/lib/FHEM/Automation/ShuttersControl.pm b/fhem/lib/FHEM/Automation/ShuttersControl.pm index 2908d958f..313b753c2 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl.pm @@ -1052,13 +1052,15 @@ sub ShuttersCommandSet { ## Sub welche die InternalTimer nach entsprechenden Sunset oder Sunrise zusammen stellt sub CreateSunRiseSetShuttersTimer { - my $hash = shift; + my $hash = shift; my $shuttersDev = shift // return Log3( $hash->{NAME}, 1, "AutoShuttersControl ($hash->{NAME}) - Error in function CreateSunRiseSetShuttersTimer. No shuttersDev given" ); my $name = $hash->{NAME}; - my $shuttersDevHash = $defs{$shuttersDev}; + my $shuttersDevHash = $defs{$shuttersDev} // Log3( $hash->{NAME}, 1, +"AutoShuttersControl ($hash->{NAME}) - Error in function CreateSunRiseSetShuttersTimer. No shuttersDevHash given" + ); my %funcHash; $shutters->setShuttersDev($shuttersDev); diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm index 21e350b24..8aa1f0c39 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm @@ -87,7 +87,7 @@ sub getBrightnessMaxVal { $self->{ASC_brightness}->{LASTGETTIME} = int( gettimeofday() ); my ( $triggermax, $triggermin ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $name, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_brightnessDriveUpDown', '800:500' ); ## erwartetes Ergebnis @@ -189,7 +189,7 @@ sub _getTempSensor { && ( gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 ); $self->{ASC_tempSensor}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $name, 'ASC_tempSensor', + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_tempSensor', 'none' ); ## erwartetes Ergebnis @@ -223,7 +223,7 @@ sub _getResidentsDev { && ( gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) < 2 ); $self->{ASC_residentsDev}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $name, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_residentsDev', 'none' ); $self->{ASC_residentsDev}->{device} = $device; @@ -255,7 +255,7 @@ sub _getRainSensor { && ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 ); $self->{ASC_rainSensor}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading, $max, $hyst, $pos, $wait ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $name, 'ASC_rainSensor', + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_rainSensor', 'none' ); ## erwartetes Ergebnis @@ -357,7 +357,7 @@ sub _getWindSensor { && ( gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 ); $self->{ASC_windSensor}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $name, 'ASC_windSensor', + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_windSensor', 'none' ); return $device if ( $device eq 'none' ); @@ -392,6 +392,14 @@ sub getBlockAscDrivesAfterManual { return AttrVal( $name, 'ASC_blockAscDrivesAfterManual', 0 ); } +sub getAdvDate { + my $self = shift; + + my $name = $self->{name}; + + return AttrVal( $name, 'ASC_advDate', 'FirstAdvent' ); +} + diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm b/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm index 5a719ee3d..a518caada 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm @@ -786,6 +786,8 @@ sub EventProcessingRoommate { } elsif ( ( $event eq 'gotosleep' || $event eq 'asleep' ) + && $FHEM::Automation::ShuttersControl::shutters->getModeDown ne + 'absent' && ( $FHEM::Automation::ShuttersControl::ascDev ->getAutoShuttersControlEvening eq 'on' || $FHEM::Automation::ShuttersControl::shutters->getDown eq @@ -938,8 +940,8 @@ sub EventProcessingResidents { 'on' && $FHEM::Automation::ShuttersControl::shutters ->getSelfDefenseMode ne 'off' - || ( $getModeDown eq 'absent' - || $getModeDown eq 'always' ) + || $getModeDown eq 'absent' +# || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github || ( $FHEM::Automation::ShuttersControl::shutters ->getShadingMode eq 'absent' && $FHEM::Automation::ShuttersControl::shutters @@ -1013,7 +1015,7 @@ sub EventProcessingResidents { $FHEM::Automation::ShuttersControl::shutters ->getLastPos ); } - elsif (( $getModeDown eq 'absent' || $getModeDown eq 'always' ) + 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 @@ -2256,8 +2258,12 @@ sub EventProcessingPartyMode { $shuttersDev, ( CheckIfShuttersWindowRecOpen($shuttersDev) == 0 - ? $FHEM::Automation::ShuttersControl::shutters - ->getClosedPos + ? ($FHEM::Automation::ShuttersControl::shutters + ->getSleepPos > 0 + ? $FHEM::Automation::ShuttersControl::shutters + ->getSleepPos + : $FHEM::Automation::ShuttersControl::shutters + ->getClosedPos) : $FHEM::Automation::ShuttersControl::shutters ->getVentilatePos ) diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm index 5767ff561..6d0249671 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm @@ -1159,6 +1159,7 @@ sub PerlCodeCheck { } sub IsAdv { + use HTTP::Date; my ( undef, undef, undef, $monthday, $month, $year, undef, undef, undef ) = localtime( gettimeofday() ); my $adv = 0; @@ -1170,10 +1171,14 @@ sub IsAdv { } } else { - my $time = HTTP::Date::str2time( $year . '-12-25' ); + my $time = str2time( $year . '-12-25' ); my $wday = ( localtime($time) )[6]; $wday = $wday ? $wday : 7; - $time -= ( $wday + 21 ) * 86400; + $time -= ( $FHEM::Automation::ShuttersControl::ascDev + ->getAdvDate eq 'DeadSunday' + ? ($wday + 27) * 86400 + : ($wday + 21) * 86400 + ); $adv = 1 if ( $time < time ); } diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm index c7c626194..670962540 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Shading.pm @@ -286,6 +286,8 @@ sub ShadingProcessing { ->getShadingWaitingPeriod / 2 ) || $FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off' + || $FHEM::Automation::ShuttersControl::ascDev + ->getAutoShuttersControlShading eq 'off' ); Log3( $name, 4, diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm index 86952325b..d039debb9 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm @@ -120,7 +120,7 @@ sub _getPosition { } else { ( $position, $posAssignment ) = - FHEM::Automation::ShuttersControl::GetAttrValues( + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, $attr, $FHEM::Automation::ShuttersControl::userAttrList{$userAttrList} @@ -243,7 +243,7 @@ sub getSlatPosCmd { $self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}->{LASTGETTIME} = int( gettimeofday() ); my ( $slatPosCmd, $slatDevice ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_SlatPosCmd_SlatDevice', 'none:none' ); ## Erwartetes Ergebnis @@ -306,7 +306,7 @@ sub getPrivacyUpTime { $self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen} ->{LASTGETTIME} = int( gettimeofday() ); my ( $upTime, $upBrightnessVal ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_PrivacyUpValue_beforeDayOpen', '-1:-1' ); ## Erwartetes Ergebnis @@ -385,7 +385,7 @@ sub getPrivacyDownTime { $self->{ $self->{shuttersDev} }->{ASC_PrivacyDownValue_beforeNightClose} ->{LASTGETTIME} = int( gettimeofday() ); my ( $downTime, $downBrightnessVal ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_PrivacyDownValue_beforeNightClose', '-1:-1' ); ## Erwartetes Ergebnis @@ -605,7 +605,7 @@ sub _getTempSensor { $self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_TempSensor', 'none' ); ### erwartetes Ergebnis @@ -665,7 +665,7 @@ sub _getIdleDetectionReading { $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME} = int( gettimeofday() ); my ( $reading, $value ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_Shutter_IdleDetection', 'none' ); ### erwartetes Ergebnis @@ -729,7 +729,7 @@ sub _getBrightnessSensor { $self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading, $max, $min ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_BrightnessSensor', 'none' ); ### erwartetes Ergebnis @@ -815,7 +815,7 @@ sub getShadingAzimuthRight { $self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}->{LASTGETTIME} = int( gettimeofday() ); my ( $left, $right ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_Shading_InOutAzimuth', '95:265' ); ### erwartetes Ergebnis @@ -874,7 +874,7 @@ sub getShadingMinElevation { $self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation} ->{LASTGETTIME} = int( gettimeofday() ); my ( $min, $max ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_Shading_MinMax_Elevation', '25.0:100.0' ); ### erwartetes Ergebnis @@ -944,7 +944,7 @@ sub getShadingStateChangeSunny { $self->{ $self->{shuttersDev} }->{ASC_Shading_StateChange_SunnyCloudy} ->{LASTGETTIME} = int( gettimeofday() ); my ( $sunny, $cloudy, $maxBrightnessAverageArrayObjects ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_Shading_StateChange_SunnyCloudy', '35000:20000' ); @@ -1048,7 +1048,7 @@ sub getExternalTriggerDevice { int( gettimeofday() ); my ( $device, $reading, $valueActive, $valueInactive, $posActive, $posInactive, $valueActive2, $posActive2 ) - = FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + = FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_ExternalTrigger', 'none' ); ### erwartetes Ergebnis @@ -1545,7 +1545,7 @@ sub getWindMax { $self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME} = int( gettimeofday() ); my ( $max, $hyst, $pos ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_WindParameters', '50:20' ); ## Erwartetes Ergebnis diff --git a/fhem/lib/FHEM/Automation/ShuttersControl/Window/Attr.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Window/Attr.pm index 739a3c0ad..75e677367 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Window/Attr.pm +++ b/fhem/lib/FHEM/Automation/ShuttersControl/Window/Attr.pm @@ -94,7 +94,7 @@ sub _getWinDev { $self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} = int( gettimeofday() ); my ( $device, $reading ) = - FHEM::Automation::ShuttersControl::GetAttrValues( $self->{shuttersDev}, + FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev}, 'ASC_WindowRec', 'none' ); ### erwartetes Ergebnis