2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

73_AutoShuttersControl: fix shading absent and coming home, fix Reading ASC_Time_PrivacyDriveDown, fix blocking shutter then shading drive and terrace door open

git-svn-id: https://svn.fhem.de/fhem/trunk@19304 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2019-05-01 13:22:15 +00:00
parent 4356b83da3
commit 2c92d6f866
2 changed files with 39 additions and 14 deletions

View File

@ -1,5 +1,8 @@
# 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: fix shading absent and coming home, fix
Reading ASC_Time_PrivacyDriveDown, fix blocking shutter then
shading drive and terrace door open
- change: Newly introduced bank holiday for Thuringia: Weltkindertag (20.09.)
- bugfix: 74_AutoShuttersControl: fix window closed after sunset and ModeUp
absent, fix other bugs

View File

@ -44,7 +44,7 @@ use strict;
use warnings;
use FHEM::Meta;
my $version = '0.6.4';
my $version = '0.6.5';
sub AutoShuttersControl_Initialize($) {
my ($hash) = @_;
@ -584,6 +584,9 @@ sub ShuttersDeviceScan($) {
; # temporär muss später gelöscht werden ab Version 0.4.11beta6
delFromDevAttrList( $_, 'ASC_Wind_Pos' )
; # temporär muss später gelöscht werden ab Version 0.4.11beta6
CommandDeleteReading( undef, $_ . ' ASC_Time_PrivacyDriveUp' )
if ( ReadingsVal( $_, 'ASC_Time_PrivacyDriveUp', 'none' ) ne 'none' )
; # temporär muss später gelöscht werden ab Version 0.6.3
$shuttersList = $shuttersList . ',' . $_;
$shutters->setShuttersDev($_);
@ -862,24 +865,37 @@ sub EventProcessingWindowRec($@) {
or $shutters->getStatus == $shutters->getOpenPos )
)
{
ASC_Debug( 'EventProcessingWindowRec: '
. $shutters->getShuttersDev
. ' Event Closed' );
if (
IsDay($shuttersDev)
and $shutters->getStatus != $shutters->getOpenPos
IsDay($shuttersDev)
and ( ( $homemode ne 'asleep' and $homemode ne 'gotosleep' )
or $homemode eq 'none' )
and $shutters->getModeUp ne 'absent'
and $shutters->getModeUp ne 'off'
)
{
$shutters->setLastDrive('window closed at day');
$shutters->setNoOffset(1);
$shutters->setDriveCmd(
(
$shutters->getLastPos != $shutters->getClosedPos
? $shutters->getLastPos
: $shutters->getOpenPos
)
);
if ( $shutters->getShadingStatus eq 'in'
and $shutters->getShuttersPlace eq 'terrace'
and $shutters->getShadingPos != $shutters->getStatus )
{
$shutters->setLastDrive('shading in');
$shutters->setNoOffset(1);
$shutters->setDriveCmd( $shutters->getShadingPos );
}
elsif ( $shutters->getStatus != $shutters->getOpenPos ) {
$shutters->setLastDrive('window closed at day');
$shutters->setNoOffset(1);
$shutters->setDriveCmd(
(
$shutters->getLastPos != $shutters->getClosedPos
? $shutters->getLastPos
: $shutters->getOpenPos
)
);
}
}
elsif (
@ -1519,6 +1535,7 @@ sub EventProcessingBrightness($@) {
}
}
else {
EventProcessingShadingBrightness( $hash, $shuttersDev, $events );
ASC_Debug( 'EventProcessingBrightness: '
. $shutters->getShuttersDev
. ' - Brightness Event kam nicht innerhalb der Verarbeitungszeit für Sunset oder Sunris oder aber für beide wurden die entsprechendne Verarbeitungsschwellen nicht erreicht.'
@ -1856,7 +1873,12 @@ sub ShadingProcessing($@) {
: $getStatus < $getShadingPos
);
if ( not $queryShuttersShadingPos ) {
if (
not $queryShuttersShadingPos
and not( CheckIfShuttersWindowRecOpen($shuttersDev) == 2
and $shutters->getShuttersPlace eq 'terrace' )
)
{
$shutters->setLastDrive('shading in');
ShuttersCommandSet( $hash, $shuttersDev, $getShadingPos );
@ -2115,7 +2137,7 @@ sub CreateSunRiseSetShuttersTimer($$) {
$shuttersSunsetUnixtime - $shutters->getPrivacyDownTime;
readingsSingleUpdate(
$shuttersDevHash,
'ASC_Time_PrivacyDriveUp',
'ASC_Time_PrivacyDriveDown',
strftime(
"%e.%m.%Y - %H:%M",
localtime($shuttersSunsetUnixtime)