dev #85
@@ -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-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 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
 | 
				
			||||||
UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.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-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-12-04_09:28:11 25126 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:16:16 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
 | 
				
			||||||
UPD 2021-11-14_14:03:06 40094 lib/FHEM/Automation/ShuttersControl/Helper.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 2173 lib/FHEM/Automation/ShuttersControl/Window.pm
 | 
				
			||||||
UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
 | 
					UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,23 +64,6 @@ our %EXPORT_TAGS = (
 | 
				
			|||||||
    ],
 | 
					    ],
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use GPUtils qw(GP_Import);
 | 
					 | 
				
			||||||
## Import der FHEM Funktionen
 | 
					 | 
				
			||||||
BEGIN {
 | 
					 | 
				
			||||||
    GP_Import(
 | 
					 | 
				
			||||||
        qw(
 | 
					 | 
				
			||||||
          Log3
 | 
					 | 
				
			||||||
          gettimeofday
 | 
					 | 
				
			||||||
          InternalTimer
 | 
					 | 
				
			||||||
          ReadingsVal
 | 
					 | 
				
			||||||
          readingsBeginUpdate
 | 
					 | 
				
			||||||
          readingsBulkUpdate
 | 
					 | 
				
			||||||
          readingsBulkUpdateIfChanged
 | 
					 | 
				
			||||||
          readingsEndUpdate
 | 
					 | 
				
			||||||
          defs
 | 
					 | 
				
			||||||
          )
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub CheckASC_ConditionsForShadingFn {
 | 
					sub CheckASC_ConditionsForShadingFn {
 | 
				
			||||||
    my $hash    = shift;
 | 
					    my $hash    = shift;
 | 
				
			||||||
@@ -104,8 +87,8 @@ sub CheckASC_ConditionsForShadingFn {
 | 
				
			|||||||
            attrEvent       => 0,
 | 
					            attrEvent       => 0,
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        InternalTimer(
 | 
					        ::InternalTimer(
 | 
				
			||||||
            gettimeofday() + $count,
 | 
					            ::gettimeofday() + $count,
 | 
				
			||||||
'FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn',
 | 
					'FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn',
 | 
				
			||||||
            \%funcHash
 | 
					            \%funcHash
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
@@ -128,7 +111,7 @@ sub _CheckShuttersConditionsForShadingFn {
 | 
				
			|||||||
    my $value       = $funcHash->{value};
 | 
					    my $value       = $funcHash->{value};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
 | 
					    $FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
 | 
				
			||||||
    my $shuttersDevHash = $defs{$shuttersDev};
 | 
					    my $shuttersDevHash = $::defs{$shuttersDev};
 | 
				
			||||||
    my $message         = '';
 | 
					    my $message         = '';
 | 
				
			||||||
    my $errorMessage;
 | 
					    my $errorMessage;
 | 
				
			||||||
    my $warnMessage;
 | 
					    my $warnMessage;
 | 
				
			||||||
@@ -167,9 +150,9 @@ sub _CheckShuttersConditionsForShadingFn {
 | 
				
			|||||||
            ? ' ASC_Shading_Mode attribut is set but global shading has errors, look at ASC device '
 | 
					            ? ' ASC_Shading_Mode attribut is set but global shading has errors, look at ASC device '
 | 
				
			||||||
            . '<a href="'
 | 
					            . '<a href="'
 | 
				
			||||||
            . '/fhem?detail='
 | 
					            . '/fhem?detail='
 | 
				
			||||||
            . ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
 | 
					            . ::ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
 | 
				
			||||||
            . $::FW_CSRF . '">'
 | 
					            . $::FW_CSRF . '">'
 | 
				
			||||||
            . ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
 | 
					            . ::ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
 | 
				
			||||||
            . '</a>'
 | 
					            . '</a>'
 | 
				
			||||||
            : ''
 | 
					            : ''
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
@@ -197,10 +180,10 @@ sub _CheckShuttersConditionsForShadingFn {
 | 
				
			|||||||
        && $infoMessage ne ''
 | 
					        && $infoMessage ne ''
 | 
				
			||||||
        && $errorMessage eq '' );
 | 
					        && $errorMessage eq '' );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    readingsBeginUpdate($shuttersDevHash);
 | 
					    ::readingsBeginUpdate($shuttersDevHash);
 | 
				
			||||||
    readingsBulkUpdateIfChanged( $shuttersDevHash, 'ASC_ShadingMessage',
 | 
					    ::readingsBulkUpdateIfChanged( $shuttersDevHash, 'ASC_ShadingMessage',
 | 
				
			||||||
        '<html>' . $message . ' </html>' );
 | 
					        '<html>' . $message . ' </html>' );
 | 
				
			||||||
    readingsEndUpdate( $shuttersDevHash, 1 );
 | 
					    ::readingsEndUpdate( $shuttersDevHash, 1 );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub ShadingProcessing {
 | 
					sub ShadingProcessing {
 | 
				
			||||||
@@ -250,7 +233,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
          . ', Ist es nach der Hälfte der Beschattungswartezeit: '
 | 
					          . ', Ist es nach der Hälfte der Beschattungswartezeit: '
 | 
				
			||||||
          . (
 | 
					          . (
 | 
				
			||||||
            (
 | 
					            (
 | 
				
			||||||
                int( gettimeofday() ) -
 | 
					                int( ::gettimeofday() ) -
 | 
				
			||||||
                  $FHEM::Automation::ShuttersControl::shutters
 | 
					                  $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
                  ->getShadingStatusTimestamp
 | 
					                  ->getShadingStatusTimestamp
 | 
				
			||||||
            ) < (
 | 
					            ) < (
 | 
				
			||||||
@@ -260,7 +243,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
          )
 | 
					          )
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Log3( $name, 4,
 | 
					    ::Log3( $name, 4,
 | 
				
			||||||
            "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
					            "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
				
			||||||
          . $shuttersDev
 | 
					          . $shuttersDev
 | 
				
			||||||
          . " Azimuth: "
 | 
					          . " Azimuth: "
 | 
				
			||||||
@@ -279,18 +262,19 @@ sub ShadingProcessing {
 | 
				
			|||||||
        || $brightness == -1
 | 
					        || $brightness == -1
 | 
				
			||||||
        || $outTemp == -100
 | 
					        || $outTemp == -100
 | 
				
			||||||
        || (
 | 
					        || (
 | 
				
			||||||
            int( gettimeofday() ) -
 | 
					            int( ::gettimeofday() ) -
 | 
				
			||||||
            $FHEM::Automation::ShuttersControl::shutters
 | 
					            $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
            ->getShadingStatusTimestamp ) < (
 | 
					            ->getShadingStatusTimestamp ) < (
 | 
				
			||||||
            $FHEM::Automation::ShuttersControl::shutters
 | 
					            $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
              ->getShadingWaitingPeriod / 2
 | 
					              ->getShadingWaitingPeriod / 2
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					        || $FHEM::Automation::ShuttersControl::shutters->getExternalTriggerStatus
 | 
				
			||||||
        || $FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
 | 
					        || $FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
 | 
				
			||||||
        || $FHEM::Automation::ShuttersControl::ascDev
 | 
					        || $FHEM::Automation::ShuttersControl::ascDev
 | 
				
			||||||
              ->getAutoShuttersControlShading eq 'off'
 | 
					              ->getAutoShuttersControlShading eq 'off'
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Log3( $name, 4,
 | 
					    ::Log3( $name, 4,
 | 
				
			||||||
            "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
					            "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
				
			||||||
          . $shuttersDev
 | 
					          . $shuttersDev
 | 
				
			||||||
          . " Nach dem return" );
 | 
					          . " Nach dem return" );
 | 
				
			||||||
@@ -300,7 +284,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
    my $getStatus = $FHEM::Automation::ShuttersControl::shutters->getStatus;
 | 
					    my $getStatus = $FHEM::Automation::ShuttersControl::shutters->getStatus;
 | 
				
			||||||
    my $oldShadingStatus =
 | 
					    my $oldShadingStatus =
 | 
				
			||||||
      $FHEM::Automation::ShuttersControl::shutters->getShadingStatus;
 | 
					      $FHEM::Automation::ShuttersControl::shutters->getShadingStatus;
 | 
				
			||||||
    my $shuttersDevHash = $defs{$shuttersDev};
 | 
					    my $shuttersDevHash = $::defs{$shuttersDev};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
 | 
					    my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
 | 
				
			||||||
    my $homemode  = $FHEM::Automation::ShuttersControl::shutters->getHomemode;
 | 
					    my $homemode  = $FHEM::Automation::ShuttersControl::shutters->getHomemode;
 | 
				
			||||||
@@ -318,7 +302,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
            || $azimuth > $azimuthRight
 | 
					            || $azimuth > $azimuthRight
 | 
				
			||||||
            || (   !$FHEM::Automation::ShuttersControl::shutters->getIsDay
 | 
					            || (   !$FHEM::Automation::ShuttersControl::shutters->getIsDay
 | 
				
			||||||
                && $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
 | 
					                && $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
 | 
				
			||||||
                  - ( int( gettimeofday() ) ) > 7200 )
 | 
					                  - ( int( ::gettimeofday() ) ) > 7200 )
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        && $FHEM::Automation::ShuttersControl::shutters->getShadingStatus ne
 | 
					        && $FHEM::Automation::ShuttersControl::shutters->getShadingStatus ne
 | 
				
			||||||
        'out'
 | 
					        'out'
 | 
				
			||||||
@@ -331,7 +315,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
              . ' - Es ist Nacht oder die Aussentemperatur unterhalb der Shading Temperatur. Die Beschattung wird Zwangsbeendet'
 | 
					              . ' - Es ist Nacht oder die Aussentemperatur unterhalb der Shading Temperatur. Die Beschattung wird Zwangsbeendet'
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Log3( $name, 4,
 | 
					        ::Log3( $name, 4,
 | 
				
			||||||
"AutoShuttersControl ($name) - Shading Processing - Der Sonnenstand ist ausserhalb der Winkelangaben oder die Aussentemperatur unterhalb der Shading Temperatur "
 | 
					"AutoShuttersControl ($name) - Shading Processing - Der Sonnenstand ist ausserhalb der Winkelangaben oder die Aussentemperatur unterhalb der Shading Temperatur "
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -358,7 +342,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
                $FHEM::Automation::ShuttersControl::shutters->getShadingStatus
 | 
					                $FHEM::Automation::ShuttersControl::shutters->getShadingStatus
 | 
				
			||||||
                eq 'out reserved'
 | 
					                eq 'out reserved'
 | 
				
			||||||
                and (
 | 
					                and (
 | 
				
			||||||
                    int( gettimeofday() ) -
 | 
					                    int( ::gettimeofday() ) -
 | 
				
			||||||
                    $FHEM::Automation::ShuttersControl::shutters
 | 
					                    $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
                    ->getShadingStatusTimestamp )
 | 
					                    ->getShadingStatusTimestamp )
 | 
				
			||||||
            ) > $FHEM::Automation::ShuttersControl::shutters
 | 
					            ) > $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
@@ -369,7 +353,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
                'out');
 | 
					                'out');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Log3( $name, 4,
 | 
					        ::Log3( $name, 4,
 | 
				
			||||||
                "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
					                "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
				
			||||||
              . $shuttersDev
 | 
					              . $shuttersDev
 | 
				
			||||||
              . " In der Out Abfrage, Shadingwert: "
 | 
					              . " In der Out Abfrage, Shadingwert: "
 | 
				
			||||||
@@ -411,7 +395,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
            $FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
 | 
					            $FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
 | 
				
			||||||
            'in reserved'
 | 
					            'in reserved'
 | 
				
			||||||
            and (
 | 
					            and (
 | 
				
			||||||
                int( gettimeofday() ) -
 | 
					                int( ::gettimeofday() ) -
 | 
				
			||||||
                $FHEM::Automation::ShuttersControl::shutters
 | 
					                $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
                ->getShadingStatusTimestamp ) > (
 | 
					                ->getShadingStatusTimestamp ) > (
 | 
				
			||||||
                $FHEM::Automation::ShuttersControl::shutters
 | 
					                $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
@@ -423,7 +407,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
                'in');
 | 
					                'in');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Log3( $name, 4,
 | 
					        ::Log3( $name, 4,
 | 
				
			||||||
                "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
					                "AutoShuttersControl ($name) - Shading Processing, Rollladen: "
 | 
				
			||||||
              . $shuttersDev
 | 
					              . $shuttersDev
 | 
				
			||||||
              . " In der In Abfrage, Shadingwert: "
 | 
					              . " In der In Abfrage, Shadingwert: "
 | 
				
			||||||
@@ -483,7 +467,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
        && (
 | 
					        && (
 | 
				
			||||||
            (
 | 
					            (
 | 
				
			||||||
                (
 | 
					                (
 | 
				
			||||||
                    int( gettimeofday() ) -
 | 
					                    int( ::gettimeofday() ) -
 | 
				
			||||||
                    $FHEM::Automation::ShuttersControl::shutters
 | 
					                    $FHEM::Automation::ShuttersControl::shutters
 | 
				
			||||||
                    ->getShadingStatusTimestamp
 | 
					                    ->getShadingStatusTimestamp
 | 
				
			||||||
                ) < 2
 | 
					                ) < 2
 | 
				
			||||||
@@ -507,8 +491,8 @@ sub ShadingProcessing {
 | 
				
			|||||||
        )
 | 
					        )
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    readingsBeginUpdate($shuttersDevHash);
 | 
					    ::readingsBeginUpdate($shuttersDevHash);
 | 
				
			||||||
    readingsBulkUpdate(
 | 
					    ::readingsBulkUpdate(
 | 
				
			||||||
        $shuttersDevHash,
 | 
					        $shuttersDevHash,
 | 
				
			||||||
        'ASC_ShadingMessage',
 | 
					        'ASC_ShadingMessage',
 | 
				
			||||||
        'INFO: current shading status is \''
 | 
					        'INFO: current shading status is \''
 | 
				
			||||||
@@ -531,7 +515,7 @@ sub ShadingProcessing {
 | 
				
			|||||||
          ) / 60
 | 
					          ) / 60
 | 
				
			||||||
          . 'm'
 | 
					          . 'm'
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    readingsEndUpdate( $shuttersDevHash, 1 );
 | 
					    ::readingsEndUpdate( $shuttersDevHash, 1 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -639,7 +623,7 @@ sub ShadingProcessingDriveCommand {
 | 
				
			|||||||
              . ' zum beenden der Beschattung gefahren' );
 | 
					              . ' zum beenden der Beschattung gefahren' );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Log3( $name, 4,
 | 
					    ::Log3( $name, 4,
 | 
				
			||||||
"AutoShuttersControl ($name) - Shading Processing - In der Routine zum fahren der Rollläden, Shading Wert: "
 | 
					"AutoShuttersControl ($name) - Shading Processing - In der Routine zum fahren der Rollläden, Shading Wert: "
 | 
				
			||||||
          . $FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
 | 
					          . $FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user