mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
73_AutoShuttersControl: change hardLockOut mode code
git-svn-id: https://svn.fhem.de/fhem/trunk@17808 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8c4a17af9a
commit
c672ed3b87
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 73_AutoShuttersControl: change hardLockOut mode code
|
||||||
- bugfix: 73_AutoShuttersControl: bug line 623
|
- bugfix: 73_AutoShuttersControl: bug line 623
|
||||||
- feature: 73_AutoShuttersControl: add lockOut support at Z-Wave
|
- feature: 73_AutoShuttersControl: add lockOut support at Z-Wave
|
||||||
- feature: 73_AutoShuttersControl: ASC Attribut support for value zero
|
- feature: 73_AutoShuttersControl: ASC Attribut support for value zero
|
||||||
|
@ -41,7 +41,7 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $version = "0.2.0.9";
|
my $version = "0.2.0.10";
|
||||||
|
|
||||||
sub AutoShuttersControl_Initialize($) {
|
sub AutoShuttersControl_Initialize($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
@ -518,10 +518,10 @@ sub Set($$@) {
|
|||||||
return "usage: $cmd" if ( @args > 1 );
|
return "usage: $cmd" if ( @args > 1 );
|
||||||
readingsSingleUpdate( $hash, $cmd, join( ' ', @args ), 1 );
|
readingsSingleUpdate( $hash, $cmd, join( ' ', @args ), 1 );
|
||||||
}
|
}
|
||||||
elsif ( lc $cmd eq 'lockout' ) {
|
elsif ( lc $cmd eq 'hardlockout' ) {
|
||||||
return "usage: $cmd" if ( @args > 1 );
|
return "usage: $cmd" if ( @args > 1 );
|
||||||
readingsSingleUpdate( $hash, $cmd, join( ' ', @args ), 1 );
|
readingsSingleUpdate( $hash, $cmd, join( ' ', @args ), 1 );
|
||||||
SetHardewareBlockForShutters( $hash, join( ' ', @args ) );
|
HardewareBlockForShutters( $hash, join( ' ', @args ) );
|
||||||
}
|
}
|
||||||
elsif ( lc $cmd eq 'sunrisetimeweholiday' ) {
|
elsif ( lc $cmd eq 'sunrisetimeweholiday' ) {
|
||||||
return "usage: $cmd" if ( @args > 1 );
|
return "usage: $cmd" if ( @args > 1 );
|
||||||
@ -539,7 +539,7 @@ sub Set($$@) {
|
|||||||
else {
|
else {
|
||||||
my $list = "scanForShutters:noArg";
|
my $list = "scanForShutters:noArg";
|
||||||
$list .=
|
$list .=
|
||||||
" renewSetSunriseSunsetTimer:noArg partyMode:on,off lockOut:on,off sunriseTimeWeHoliday:on,off selfDefense:on,off wiggle:all,"
|
" renewSetSunriseSunsetTimer:noArg partyMode:on,off hardLockOut:on,off sunriseTimeWeHoliday:on,off selfDefense:on,off wiggle:all,"
|
||||||
. join( ',', @{ $hash->{helper}{shuttersList} } )
|
. join( ',', @{ $hash->{helper}{shuttersList} } )
|
||||||
if ( ReadingsVal( $name, 'userAttrList', 'none' ) eq 'rolled out' );
|
if ( ReadingsVal( $name, 'userAttrList', 'none' ) eq 'rolled out' );
|
||||||
$list .= " createNewNotifyDev:noArg"
|
$list .= " createNewNotifyDev:noArg"
|
||||||
@ -786,6 +786,11 @@ sub EventProcessingWindowRec($@) {
|
|||||||
|
|
||||||
if ( $events =~ m#state:\s(open|closed|tilted)# ) {
|
if ( $events =~ m#state:\s(open|closed|tilted)# ) {
|
||||||
$shutters->setShuttersDev($shuttersDev);
|
$shutters->setShuttersDev($shuttersDev);
|
||||||
|
|
||||||
|
#### Hardware Lock der Rollläden
|
||||||
|
$shutters->setHardLockOut('off') unless ( $1 eq 'open' or $1 eq 'tilted' );
|
||||||
|
$shutters->setHardLockOut('on') unless ( $1 eq 'closed' );
|
||||||
|
|
||||||
$shutters->setNoOffset(1);
|
$shutters->setNoOffset(1);
|
||||||
|
|
||||||
my $queryShuttersPosWinRecTilted = (
|
my $queryShuttersPosWinRecTilted = (
|
||||||
@ -820,6 +825,7 @@ sub EventProcessingWindowRec($@) {
|
|||||||
# ShuttersCommandSet( $hash, $shuttersDev,
|
# ShuttersCommandSet( $hash, $shuttersDev,
|
||||||
# $shutters->getVentilatePos );
|
# $shutters->getVentilatePos );
|
||||||
# }
|
# }
|
||||||
|
|
||||||
}
|
}
|
||||||
elsif ( $1 eq 'closed'
|
elsif ( $1 eq 'closed'
|
||||||
) # wenn nicht dann wird entsprechend dem Fensterkontakt Event der Rolladen geschlossen oder zum lüften geöffnet
|
) # wenn nicht dann wird entsprechend dem Fensterkontakt Event der Rolladen geschlossen oder zum lüften geöffnet
|
||||||
@ -1537,22 +1543,11 @@ sub RenewSunRiseSetShuttersTimer($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Funktion zum hardwareseitigen setzen des lock-out oder blocking beim Rolladen selbst
|
## Funktion zum hardwareseitigen setzen des lock-out oder blocking beim Rolladen selbst
|
||||||
sub SetHardewareBlockForShutters($$) {
|
sub HardewareBlockForShutters($$) {
|
||||||
my ( $hash, $cmd ) = @_;
|
my ( $hash, $cmd ) = @_;
|
||||||
foreach ( @{ $hash->{helper}{shuttersList} } ) {
|
foreach ( @{ $hash->{helper}{shuttersList} } ) {
|
||||||
$shutters->setShuttersDev($_);
|
$shutters->setShuttersDev($_);
|
||||||
if ( $shutters->getLockOut eq 'hard'
|
$shutters->setHardLockOut($cmd);
|
||||||
and $shutters->getLockOutCmd ne 'none' )
|
|
||||||
{
|
|
||||||
CommandSet( undef, $_ . ' inhibit ' . $cmd )
|
|
||||||
if ( $shutters->getLockOutCmd eq 'inhibit' );
|
|
||||||
CommandSet( undef,
|
|
||||||
$_ . ' ' . ( $cmd eq 'on' ? 'blocked' : 'unblocked' ) )
|
|
||||||
if ( $shutters->getLockOutCmd eq 'blocked' );
|
|
||||||
CommandSet( undef,
|
|
||||||
$_ . ' ' . ( $cmd eq 'on' ? 'protectionOn' : 'protectionOff' ) )
|
|
||||||
if ( $shutters->getLockOutCmd eq 'protection' );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2306,7 +2301,8 @@ BEGIN {
|
|||||||
ReadingsVal
|
ReadingsVal
|
||||||
readingsSingleUpdate
|
readingsSingleUpdate
|
||||||
gettimeofday
|
gettimeofday
|
||||||
InternalTimer)
|
InternalTimer
|
||||||
|
CommandSet)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2335,6 +2331,24 @@ sub getShuttersDev {
|
|||||||
return $self->{shuttersDev};
|
return $self->{shuttersDev};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub setHardLockOut {
|
||||||
|
my ( $self, $cmd ) = @_;
|
||||||
|
|
||||||
|
if ( $shutters->getLockOut eq 'hard'
|
||||||
|
and $shutters->getLockOutCmd ne 'none' )
|
||||||
|
{
|
||||||
|
CommandSet( undef, $self->{shuttersDev} . ' inhibit ' . $cmd )
|
||||||
|
if ( $shutters->getLockOutCmd eq 'inhibit' );
|
||||||
|
CommandSet( undef,
|
||||||
|
$self->{shuttersDev} . ' ' . ( $cmd eq 'on' ? 'blocked' : 'unblocked' ) )
|
||||||
|
if ( $shutters->getLockOutCmd eq 'blocked' );
|
||||||
|
CommandSet( undef,
|
||||||
|
$self->{shuttersDev} . ' ' . ( $cmd eq 'on' ? 'protectionOn' : 'protectionOff' ) )
|
||||||
|
if ( $shutters->getLockOutCmd eq 'protection' );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
sub setNoOffset {
|
sub setNoOffset {
|
||||||
my ( $self, $noOffset ) = @_;
|
my ( $self, $noOffset ) = @_;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user