mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 01:46:08 +00:00
98_Siro.pm:add attr SIRO_downLimit
git-svn-id: https://svn.fhem.de/fhem/trunk@19501 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d5860db111
commit
29d1408041
@ -41,6 +41,7 @@ sub Siro_Initialize($) {
|
|||||||
. " SIRO_signalRepeats:1,2,3,4,5,6,7,8,9"
|
. " SIRO_signalRepeats:1,2,3,4,5,6,7,8,9"
|
||||||
. " SIRO_inversPosition:0,1"
|
. " SIRO_inversPosition:0,1"
|
||||||
. " SIRO_Battery_low"
|
. " SIRO_Battery_low"
|
||||||
|
. " SIRO_downLimit:slider,0,1,100"
|
||||||
. " SIRO_signalLongStopRepeats:10,15,20,40,45,50"
|
. " SIRO_signalLongStopRepeats:10,15,20,40,45,50"
|
||||||
. " $readingFnAttributes"
|
. " $readingFnAttributes"
|
||||||
. " SIRO_send_channel:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"
|
. " SIRO_send_channel:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"
|
||||||
@ -295,6 +296,17 @@ sub SendCommand($@) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $hash->{helper}{ignorecmd} eq "on") # send kommand blockiert / keine ausf?hrung
|
||||||
|
{
|
||||||
|
Log3( $name, 5,"Siro_sendCommand: ausführung einmalig blockiert ");
|
||||||
|
|
||||||
|
delete( $hash->{helper}{ignorecmd} );
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log3( $name, 5,"Siro_sendCommand: args1 - $args[1]");
|
Log3( $name, 5,"Siro_sendCommand: args1 - $args[1]");
|
||||||
|
|
||||||
if ( $args[1] eq "longstop" || $hash->{helper}{progmode} eq "on")
|
if ( $args[1] eq "longstop" || $hash->{helper}{progmode} eq "on")
|
||||||
@ -341,8 +353,8 @@ sub SendCommand($@) {
|
|||||||
|
|
||||||
IOWrite( $hash, 'sendMsg', $message ) if AttrVal( $name, 'SIRO_debug', "0" ) ne "1";
|
IOWrite( $hash, 'sendMsg', $message ) if AttrVal( $name, 'SIRO_debug', "0" ) ne "1";
|
||||||
Log3( $name, 5,
|
Log3( $name, 5,
|
||||||
"Siro_sendCommand: name -> $name command -> $cmd channel -> $chan bincmd -> $binCommand bin -> $bin
|
"Siro_sendCommand: name-$name command-$cmd channel-$chan bincmd-$binCommand bin-$bin id-$sendid
|
||||||
message -> $message");
|
message-$message");
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -672,8 +684,8 @@ sub Set($@) {
|
|||||||
# setze actiontime und lastactiontime
|
# setze actiontime und lastactiontime
|
||||||
# umbauen zu bulk update
|
# umbauen zu bulk update
|
||||||
RemoveInternalTimer($name); #alle vorhandenen timer l?schen
|
RemoveInternalTimer($name); #alle vorhandenen timer l?schen
|
||||||
delete( $hash->{helper}{exexcmd} ); # on/off off blockiert befehlsausf?hrung / l?schen vor jedem durchgang
|
#delete( $hash->{helper}{exexcmd} ); # on/off off blockiert befehlsausf?hrung / l?schen vor jedem durchgang
|
||||||
|
$hash->{helper}{exexcmd}="on";
|
||||||
#setze helper neu wenn signal von fb kommt
|
#setze helper neu wenn signal von fb kommt
|
||||||
|
|
||||||
if ($hash->{helper}{remotecmd} eq "on")
|
if ($hash->{helper}{remotecmd} eq "on")
|
||||||
@ -687,11 +699,43 @@ sub Set($@) {
|
|||||||
readingsBulkUpdate( $hash, "LastActionTime", $lastactiontime, 0 );
|
readingsBulkUpdate( $hash, "LastActionTime", $lastactiontime, 0 );
|
||||||
readingsBulkUpdate( $hash, "BetweentActionTime", $betweentime, 0 );
|
readingsBulkUpdate( $hash, "BetweentActionTime", $betweentime, 0 );
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
|
||||||
|
|
||||||
# befehl aus %sendCommands ermitteln
|
# befehl aus %sendCommands ermitteln
|
||||||
my $comand = $sendCommands{$cmd}; # auzuf?hrender befehl
|
my $comand = $sendCommands{$cmd}; # auzuf?hrender befehl
|
||||||
Log3( $name, 5, "Siro-Set: ermittelter Befehl: $comand " );
|
Log3( $name, 5, "Siro-Set: ermittelter Befehl: $comand " );
|
||||||
|
|
||||||
|
###############################
|
||||||
|
# limit testen , falls limit wird on zu level limit
|
||||||
|
my $downlimit = AttrVal( $name, 'SIRO_downLimit','undef' ) ;
|
||||||
|
if ($downlimit ne "undef" && ($comand eq 'on' || $comand eq 'level') && $hash->{helper}{exexcmd} ne "off")
|
||||||
|
# nur wenn befehl nicht von fb kommt
|
||||||
|
{
|
||||||
|
if (!defined $zielposition){$zielposition = 100}
|
||||||
|
if ( $position < $downlimit )
|
||||||
|
{
|
||||||
|
$comand = 'level';
|
||||||
|
$zielposition = $downlimit;
|
||||||
|
}
|
||||||
|
my $sendchan = AttrVal( $name, 'SIRO_send_channel', 'undef' );
|
||||||
|
if ( $sendchan ne $hash->{CHANNEL_RECEIVE} && $position >= $downlimit )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
##################
|
||||||
|
if ($downlimit ne "undef" && ($comand eq 'on' || $comand eq 'level') && $hash->{helper}{exexcmd} eq "off")
|
||||||
|
# nur wenn befehl von fb kommt
|
||||||
|
{
|
||||||
|
if ( $position < $downlimit )
|
||||||
|
{
|
||||||
|
delete( $hash->{helper}{exexcmd} );
|
||||||
|
$hash->{helper}{ignorecmd} ="on";
|
||||||
|
$comand = 'level';
|
||||||
|
$zielposition = $downlimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
############################
|
||||||
# set reset_motor_term reset_motor_term
|
# set reset_motor_term reset_motor_term
|
||||||
if ($comand eq "reset_motor_term")
|
if ($comand eq "reset_motor_term")
|
||||||
{
|
{
|
||||||
@ -700,7 +744,7 @@ sub Set($@) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# pr?fe auf laufende aktion nur bei definierten laufzeiten
|
# pruefe auf laufende aktion nur bei definierten laufzeiten
|
||||||
# wenn vorhanden neuberechnung aller readings
|
# wenn vorhanden neuberechnung aller readings
|
||||||
if ($aktendaction > time && ($downtime ne "undef" || $uptime ne "undef"))
|
if ($aktendaction > time && ($downtime ne "undef" || $uptime ne "undef"))
|
||||||
{
|
{
|
||||||
@ -1114,7 +1158,7 @@ sub Restartset($) {
|
|||||||
my ( $name, $arg ) = split( / /, $input );
|
my ( $name, $arg ) = split( / /, $input );
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
return "" if ( IsDisabled($name) );
|
return "" if ( IsDisabled($name) );
|
||||||
Log3( $name, 5, "Siro-Restartset : aufgerufen");
|
Log3( $name, 0, "Siro-Restartset : aufgerufen");
|
||||||
my $cmd = $hash->{helper}{savedcmds}{cmd1};
|
my $cmd = $hash->{helper}{savedcmds}{cmd1};
|
||||||
my $pos = $hash->{helper}{savedcmds}{cmd2};
|
my $pos = $hash->{helper}{savedcmds}{cmd2};
|
||||||
delete( $hash->{helper}{savedcmds} );
|
delete( $hash->{helper}{savedcmds} );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user