mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-09 20:57:11 +00:00
74_AutoShuttersControl: fix many bugs reported by users
git-svn-id: https://svn.fhem.de/fhem/trunk@23635 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c03eb292ed
commit
3c32b515a4
@ -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
|
||||
|
@ -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 {
|
||||
<li><strong>ASC_freezeTemp</strong> - Temperature threshold for the freeze protection. The freeze protection
|
||||
prevents the shutter to be operated by <abbr>ASC</abbr>. Last operating order will be kept.
|
||||
</li>
|
||||
<a name="ASC_advDate"></a>
|
||||
<li><strong>ASC_advDate</strong> - Advent Season, selected FirstAdvent or DeadSunday.
|
||||
</li>
|
||||
<a name="ASC_rainSensor"></a>
|
||||
<li><strong>ASC_rainSensor DEVICENAME[:READINGNAME] MAXTRIGGER[:HYSTERESE] [CLOSEDPOS]</strong> - Contains
|
||||
settings for the rain protection. <em>DEVICNAME</em> specifies a rain sensor, the optional
|
||||
@ -890,6 +889,8 @@ sub Initialize {
|
||||
<li><strong>ASC_expert</strong> - ist der Wert 1, so werden erweiterte Informationen bezüglich des NotifyDevs unter set und get angezeigt</li>
|
||||
<a name="ASC_freezeTemp"></a>
|
||||
<li><strong>ASC_freezeTemp</strong> - Temperatur, ab welcher der Frostschutz greifen soll und der Rollladen nicht mehr fährt. Der letzte Fahrbefehl wird gespeichert.</li>
|
||||
<a name="ASC_advDate"></a>
|
||||
<li><strong>ASC_advDate</strong> - Adventszeit, Auswahl ab wann die Adventszeit beginnen soll.</li>
|
||||
<a name="ASC_rainSensor"></a>
|
||||
<li><strong>ASC_rainSensor - DEVICENAME[:READINGNAME] MAXTRIGGER[:HYSTERESE] [CLOSEDPOS:[WAITINGTIME]]</strong> - 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.</li>
|
||||
<a name="ASC_residentsDev"></a>
|
||||
@ -1264,7 +1265,7 @@ sub Initialize {
|
||||
],
|
||||
"release_status": "testing",
|
||||
"license": "GPL_2",
|
||||
"version": "v0.10.10",
|
||||
"version": "v0.10.11",
|
||||
"author": [
|
||||
"Marko Oldenburg <leongaultier@gmail.com>"
|
||||
],
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user