Add files via upload
This commit is contained in:
		
							
								
								
									
										151
									
								
								FHEM/98_Siro.pm
									
									
									
									
									
								
							
							
						
						
									
										151
									
								
								FHEM/98_Siro.pm
									
									
									
									
									
								
							@@ -17,7 +17,7 @@ package main;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
use warnings;
 | 
					use warnings;
 | 
				
			||||||
my $version = "1.1";
 | 
					my $version = "1.2";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub Siro_Initialize($) {
 | 
					sub Siro_Initialize($) {
 | 
				
			||||||
@@ -94,7 +94,7 @@ sub Siro_Initialize($) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### arbeiten mit packages
 | 
					#### arbeiten mit packages
 | 
				
			||||||
@@ -234,7 +234,7 @@ foreach my $k ( keys %codes ) {
 | 
				
			|||||||
    $siro_c2b{ $codes{$k} } = $k;
 | 
					    $siro_c2b{ $codes{$k} } = $k;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
######################
 | 
					#############################
 | 
				
			||||||
sub Attr(@) {
 | 
					sub Attr(@) {
 | 
				
			||||||
	my ( $cmd, $name, $aName, $aVal ) = @_;
 | 
						my ( $cmd, $name, $aName, $aVal ) = @_;
 | 
				
			||||||
    my $hash = $defs{$name};
 | 
					    my $hash = $defs{$name};
 | 
				
			||||||
@@ -265,7 +265,7 @@ sub Attr(@) {
 | 
				
			|||||||
	Log3( $name,5 , "Siro_attr init done : $init_done");
 | 
						Log3( $name,5 , "Siro_attr init done : $init_done");
 | 
				
			||||||
return;
 | 
					return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
sub Define($$) {
 | 
					sub Define($$) {
 | 
				
			||||||
    my ( $hash, $def ) = @_;
 | 
					    my ( $hash, $def ) = @_;
 | 
				
			||||||
    my @a = split( "[ \t][ \t]*", $def );
 | 
					    my @a = split( "[ \t][ \t]*", $def );
 | 
				
			||||||
@@ -324,15 +324,6 @@ sub Define($$) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	my $webcmd = "webCmd stop:open:close:fav:pct";
 | 
						my $webcmd = "webCmd stop:open:close:fav:pct";
 | 
				
			||||||
	$webcmd = "webCmd stop:open:close:fav" if $hash->{CHANNEL_RECEIVE} eq '0'; 
 | 
						$webcmd = "webCmd stop:open:close:fav" if $hash->{CHANNEL_RECEIVE} eq '0'; 
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@@ -350,7 +341,7 @@ sub Define($$) {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
sub Undef($$) {
 | 
					sub Undef($$) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my ( $hash, $name ) = @_;
 | 
					    my ( $hash, $name ) = @_;
 | 
				
			||||||
@@ -358,34 +349,34 @@ sub Undef($$) {
 | 
				
			|||||||
    return undef;
 | 
					    return undef;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
sub Shutdown($) {
 | 
					sub Shutdown($) {
 | 
				
			||||||
    my ($hash) = @_;
 | 
					    my ($hash) = @_;
 | 
				
			||||||
    my $name = $hash->{NAME};
 | 
					    my $name = $hash->{NAME};
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
sub LoadHelper($) {
 | 
					sub LoadHelper($) {
 | 
				
			||||||
    my ($hash) = @_;
 | 
					    my ($hash) = @_;
 | 
				
			||||||
    my $name = $hash->{NAME};
 | 
					    my $name = $hash->{NAME};
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub Notify($$) {
 | 
					sub Notify($$) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub Delete($$) {
 | 
					sub Delete($$) {
 | 
				
			||||||
    my ( $hash, $name ) = @_;
 | 
					    my ( $hash, $name ) = @_;
 | 
				
			||||||
    return undef;
 | 
					    return undef;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
sub SendCommand($@) {
 | 
					sub SendCommand($@) {
 | 
				
			||||||
    my ( $hash, @args ) = @_;
 | 
					    my ( $hash, @args ) = @_;
 | 
				
			||||||
    my $ret = undef;
 | 
					    my $ret = undef;
 | 
				
			||||||
@@ -471,7 +462,7 @@ sub SendCommand($@) {
 | 
				
			|||||||
    return $ret;
 | 
					    return $ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################################################################
 | 
					#############################
 | 
				
			||||||
sub Parse($$) {
 | 
					sub Parse($$) {
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
    my @args;
 | 
					    my @args;
 | 
				
			||||||
@@ -485,15 +476,6 @@ sub Parse($$) {
 | 
				
			|||||||
    my $name = $hash->{NAME};
 | 
					    my $name = $hash->{NAME};
 | 
				
			||||||
    return "" if ( IsDisabled($name) );
 | 
					    return "" if ( IsDisabled($name) );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	#Log3( $name, 5,"Siro_parse: Incomming msg time -> ".time);
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	#Log3( $name, 5,"Siro_parse: Incomming msg !  -> ".$msg);
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if ( my $lh = $modules{Siro}{defptr}{$testid} ) {
 | 
					    if ( my $lh = $modules{Siro}{defptr}{$testid} ) {
 | 
				
			||||||
        my $name = $lh->{NAME};
 | 
					        my $name = $lh->{NAME};
 | 
				
			||||||
       # Log3 $hash, 5,"Siro_Parse: Incomming msg from IODevice $testid - $name device is defined";
 | 
					       # Log3 $hash, 5,"Siro_Parse: Incomming msg from IODevice $testid - $name device is defined";
 | 
				
			||||||
@@ -660,7 +642,6 @@ sub Parse($$) {
 | 
				
			|||||||
			
 | 
								
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			
 | 
					 | 
				
			||||||
			Log3 $lh, 5, "Siro_Parse: hash->{helper}{remotecmd} - ".$lh->{helper}{remotecmd};
 | 
								Log3 $lh, 5, "Siro_Parse: hash->{helper}{remotecmd} - ".$lh->{helper}{remotecmd};
 | 
				
			||||||
			Log3( $name, 3, "Siro-Parse ($name) : Signal FB emfangen -  $newstate");	
 | 
								Log3( $name, 3, "Siro-Parse ($name) : Signal FB emfangen -  $newstate");	
 | 
				
			||||||
			Log3( $name, 5, "Siro-Parse ($name) : test remote_lock - $lock");
 | 
								Log3( $name, 5, "Siro-Parse ($name) : test remote_lock - $lock");
 | 
				
			||||||
@@ -710,7 +691,7 @@ sub Parse($$) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#############################################################
 | 
					#############################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Call with hash, name, virtual/send, set-args
 | 
					# Call with hash, name, virtual/send, set-args
 | 
				
			||||||
sub Set($@) {
 | 
					sub Set($@) {
 | 
				
			||||||
@@ -726,7 +707,7 @@ sub Set($@) {
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
	Log3( $name,0 , "Das Siromodul wurde geaendert und die einstellungen sind nicht mehr Kompatibel. Bitte das Sirodevice \"$name\" kontrollieren .");
 | 
						Log3( $name,0 , "Das Siromodul wurde geaendert und die einstellungen sind nicht mehr Kompatibel. Bitte das Sirodevice \"$name\" kontrollieren .");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	##################
 | 
						#############################
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	my $actiontime = time; # zeit dieses Aufrufes
 | 
						my $actiontime = time; # zeit dieses Aufrufes
 | 
				
			||||||
	my $lastactiontime = ReadingsVal( $name, 'ActionTime', $actiontime ); # Zeit des letzten Aufrufes
 | 
						my $lastactiontime = ReadingsVal( $name, 'ActionTime', $actiontime ); # Zeit des letzten Aufrufes
 | 
				
			||||||
@@ -747,6 +728,8 @@ sub Set($@) {
 | 
				
			|||||||
	my $favposition = ReadingsVal( $name, 'Favorite-Position', 'nA' ); #gespeicherte Favoritenposition
 | 
						my $favposition = ReadingsVal( $name, 'Favorite-Position', 'nA' ); #gespeicherte Favoritenposition
 | 
				
			||||||
	my $invers = 1; #invertiert position
 | 
						my $invers = 1; #invertiert position
 | 
				
			||||||
	my $oldcmdfrom = ReadingsVal( $name, 'ActionTrigger', 'fhem' );# ActionTrigger der letzten aktion
 | 
						my $oldcmdfrom = ReadingsVal( $name, 'ActionTrigger', 'fhem' );# ActionTrigger der letzten aktion
 | 
				
			||||||
 | 
						my $defchannnel =  $hash->{CHANNEL_RECEIVE};
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	if ($downtime ne "undef" && $uptime ne "undef")
 | 
						if ($downtime ne "undef" && $uptime ne "undef")
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
			$down1time = $downtime/100;
 | 
								$down1time = $downtime/100;
 | 
				
			||||||
@@ -780,7 +763,7 @@ sub Set($@) {
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	#Log3( $name, 0, "SiroTEST $name ".$hash->{CHANNEL_RECEIVE});
 | 
						#Log3( $name, 0, "SiroTEST $name ".$hash->{CHANNEL_RECEIVE});
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if ($hash->{CHANNEL_RECEIVE} eq '0')
 | 
						if ($defchannnel eq '0')
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	%sets = %setszero;
 | 
						%sets = %setszero;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -807,9 +790,29 @@ sub Set($@) {
 | 
				
			|||||||
        return "Unknown argument $cmd, choose one of " . join( " ", @cList );
 | 
					        return "Unknown argument $cmd, choose one of " . join( " ", @cList );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
####################################
 | 
						
 | 
				
			||||||
 | 
					##################
 | 
				
			||||||
 | 
						if ($defchannnel eq '0')
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						Log3( $name, 5, "Siro-def0: newstate $cmd");
 | 
				
			||||||
 | 
						Log3( $name, 5, "Siro-def0: testcmd ".$sets{$cmd});
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						Distributor($name.' '.$cmd.' '.$sets{$cmd});
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						# name befehl befehlscode
 | 
				
			||||||
 | 
						$hash->{helper}{exexcmd}="on";
 | 
				
			||||||
 | 
						SendCommand( $hash, $sendCommands{$cmd} );
 | 
				
			||||||
 | 
						return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					#############################
 | 
				
			||||||
# programmiermodus
 | 
					# programmiermodus
 | 
				
			||||||
####################################
 | 
					#############################
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	#if ( $hash->{helper}{progmode} eq "on" && $cmd eq "sequenz") # sequenz ausf<73>hren 
 | 
						#if ( $hash->{helper}{progmode} eq "on" && $cmd eq "sequenz") # sequenz ausf<73>hren 
 | 
				
			||||||
	if ( defined $hash->{helper}{progmode} and $hash->{helper}{progmode} eq "on" && $cmd eq "sequenz") # sequenz ausf?hren 
 | 
						if ( defined $hash->{helper}{progmode} and $hash->{helper}{progmode} eq "on" && $cmd eq "sequenz") # sequenz ausf?hren 
 | 
				
			||||||
@@ -857,7 +860,7 @@ sub Set($@) {
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
####################################
 | 
					#############################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ($state eq "programming") # keine Befehlsausf?hrung w?hrend einer programmierung
 | 
						if ($state eq "programming") # keine Befehlsausf?hrung w?hrend einer programmierung
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@@ -882,7 +885,7 @@ sub Set($@) {
 | 
				
			|||||||
	$aktcmdfrom = "remote";
 | 
						$aktcmdfrom = "remote";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	delete( $hash->{helper}{remotecmd} );
 | 
						delete( $hash->{helper}{remotecmd} );
 | 
				
			||||||
	#############
 | 
						#############################
 | 
				
			||||||
	# befehl ist von distributor abgesetzt - kam von kanal 0
 | 
						# befehl ist von distributor abgesetzt - kam von kanal 0
 | 
				
			||||||
	Log3( $name, 5, "Siro-Set: param - $param");
 | 
						Log3( $name, 5, "Siro-Set: param - $param");
 | 
				
			||||||
	if ($param eq "fakeremote")
 | 
						if ($param eq "fakeremote")
 | 
				
			||||||
@@ -890,10 +893,7 @@ sub Set($@) {
 | 
				
			|||||||
	$hash->{helper}{exexcmd} = "off" ;
 | 
						$hash->{helper}{exexcmd} = "off" ;
 | 
				
			||||||
	$aktcmdfrom = "remote";
 | 
						$aktcmdfrom = "remote";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	##############
 | 
						#############################
 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	readingsBeginUpdate($hash);
 | 
						readingsBeginUpdate($hash);
 | 
				
			||||||
	readingsBulkUpdate( $hash, "ActionTime", $actiontime, 0 );
 | 
						readingsBulkUpdate( $hash, "ActionTime", $actiontime, 0 );
 | 
				
			||||||
@@ -907,7 +907,7 @@ sub Set($@) {
 | 
				
			|||||||
    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
 | 
						# limit testen , falls limit wird on zu level limit
 | 
				
			||||||
	my $downlimit = AttrVal( $name, 'SIRO_downLimit','undef' ) ;
 | 
						my $downlimit = AttrVal( $name, 'SIRO_downLimit','undef' ) ;
 | 
				
			||||||
	if ($downlimit ne "undef"  && ($comand eq 'on' || $comand eq 'level') && $hash->{helper}{exexcmd} ne "off")
 | 
						if ($downlimit ne "undef"  && ($comand eq 'on' || $comand eq 'level') && $hash->{helper}{exexcmd} ne "off")
 | 
				
			||||||
@@ -925,7 +925,7 @@ sub Set($@) {
 | 
				
			|||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
##################
 | 
					#############################
 | 
				
			||||||
	if ($downlimit ne "undef"  && ($comand eq 'on' || $comand eq 'level') && $hash->{helper}{exexcmd} eq "off")
 | 
						if ($downlimit ne "undef"  && ($comand eq 'on' || $comand eq 'level') && $hash->{helper}{exexcmd} eq "off")
 | 
				
			||||||
	# nur wenn befehl  von fb kommt
 | 
						# nur wenn befehl  von fb kommt
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -938,7 +938,7 @@ sub Set($@) {
 | 
				
			|||||||
			$zielposition = $downlimit;
 | 
								$zielposition = $downlimit;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
############## remote_lock		
 | 
					############################# remote_lock		
 | 
				
			||||||
	if ($comand eq "remote_lock")
 | 
						if ($comand eq "remote_lock")
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
		readingsSingleUpdate( $hash, "remote_lock", $args[1], 1 ) ;
 | 
							readingsSingleUpdate( $hash, "remote_lock", $args[1], 1 ) ;
 | 
				
			||||||
@@ -947,7 +947,7 @@ sub Set($@) {
 | 
				
			|||||||
		
 | 
							
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
############################
 | 
					#############################
 | 
				
			||||||
	# 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")
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -988,9 +988,7 @@ sub Set($@) {
 | 
				
			|||||||
		Log3( $name, 5, "Siro-Set: unterbrochene Aktion $state lief $pastaction mit Korrektur");
 | 
							Log3( $name, 5, "Siro-Set: unterbrochene Aktion $state lief $pastaction mit Korrektur");
 | 
				
			||||||
		Log3( $name, 5, "Siro-Set: Korrektur um $correction sekunden");
 | 
							Log3( $name, 5, "Siro-Set: Korrektur um $correction sekunden");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		################
 | 
							#############################
 | 
				
			||||||
		
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
		Log3( $name, 5, "Siro-Set: Aktionsbeginn bei $position ");
 | 
							Log3( $name, 5, "Siro-Set: Aktionsbeginn bei $position ");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1053,7 +1051,7 @@ sub Set($@) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Log3( $name, 5, "Siro-Set: cmd nach change : $comand");
 | 
							Log3( $name, 5, "Siro-Set: cmd nach change : $comand");
 | 
				
			||||||
###############		
 | 
					#############################		
 | 
				
			||||||
#pct 100 und pct 0 auf on oder off mappen
 | 
					#pct 100 und pct 0 auf on oder off mappen
 | 
				
			||||||
		if ($comand eq "level" and $zielposition eq "100")
 | 
							if ($comand eq "level" and $zielposition eq "100")
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -1074,11 +1072,11 @@ sub Set($@) {
 | 
				
			|||||||
		Log3( $name, 4, "Siro-Set: mapping level 0 - off");
 | 
							Log3( $name, 4, "Siro-Set: mapping level 0 - off");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#################
 | 
					#############################
 | 
				
			||||||
# mappe invers position		
 | 
					# mappe invers position		
 | 
				
			||||||
		# verschoben in routine on/off
 | 
							# verschoben in routine on/off
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
############## on off for timer
 | 
					############################# on off for timer
 | 
				
			||||||
# up/down for timer mappen auf on/off und timer f<>r stop setzen
 | 
					# up/down for timer mappen auf on/off und timer f<>r stop setzen
 | 
				
			||||||
    if ( $comand eq 'upfortimer' ) 
 | 
					    if ( $comand eq 'upfortimer' ) 
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@@ -1087,7 +1085,7 @@ sub Set($@) {
 | 
				
			|||||||
        InternalTimer( time + $args[1], "FHEM::Siro::Restartset", "$name" );
 | 
					        InternalTimer( time + $args[1], "FHEM::Siro::Restartset", "$name" );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
############## on off for timer
 | 
					############################# on off for timer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# up/down for timer mappen auf on/off und timer f<>r stop setzen
 | 
					# up/down for timer mappen auf on/off und timer f<>r stop setzen
 | 
				
			||||||
    if ( $comand eq 'downfortimer' ) 
 | 
					    if ( $comand eq 'downfortimer' ) 
 | 
				
			||||||
@@ -1096,7 +1094,7 @@ sub Set($@) {
 | 
				
			|||||||
        $hash->{helper}{savedcmds}{cmd1} = 'stop';
 | 
					        $hash->{helper}{savedcmds}{cmd1} = 'stop';
 | 
				
			||||||
        InternalTimer( time + $args[1], "FHEM::Siro::Restartset", "$name" );
 | 
					        InternalTimer( time + $args[1], "FHEM::Siro::Restartset", "$name" );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#################
 | 
					#############################
 | 
				
			||||||
	if ($comand eq "fav") # favoritenanfahrt
 | 
						if ($comand eq "fav") # favoritenanfahrt
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
		if ($favposition eq "nA")
 | 
							if ($favposition eq "nA")
 | 
				
			||||||
@@ -1113,7 +1111,7 @@ sub Set($@) {
 | 
				
			|||||||
		$comand = "level";
 | 
							$comand = "level";
 | 
				
			||||||
		$zielposition = $favposition;
 | 
							$zielposition = $favposition;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
####################################
 | 
					#############################
 | 
				
			||||||
# favoritenposition speichern
 | 
					# favoritenposition speichern
 | 
				
			||||||
    if ( $cmd eq "set_favorite" ) {
 | 
					    if ( $cmd eq "set_favorite" ) {
 | 
				
			||||||
     
 | 
					     
 | 
				
			||||||
@@ -1150,7 +1148,7 @@ sub Set($@) {
 | 
				
			|||||||
    return;
 | 
					    return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
###################################################
 | 
					#############################
 | 
				
			||||||
# favoritenposition speichern
 | 
					# favoritenposition speichern
 | 
				
			||||||
    if ( $cmd eq "del_favorite" )
 | 
					    if ( $cmd eq "del_favorite" )
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -1181,8 +1179,7 @@ sub Set($@) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	##################################################
 | 
						#############################
 | 
				
			||||||
	##################################
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# set on ( device faeht runter )
 | 
						# set on ( device faeht runter )
 | 
				
			||||||
	if ($comand eq "on" || $comand eq "downfortimer" )
 | 
						if ($comand eq "on" || $comand eq "downfortimer" )
 | 
				
			||||||
@@ -1239,7 +1236,7 @@ sub Set($@) {
 | 
				
			|||||||
			#befehl ausfuhren
 | 
								#befehl ausfuhren
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
##########################################
 | 
					#############################
 | 
				
			||||||
	# set off ( device faeht hoch )
 | 
						# set off ( device faeht hoch )
 | 
				
			||||||
	if ($comand eq "off" || $comand eq "upfortimer" )
 | 
						if ($comand eq "off" || $comand eq "upfortimer" )
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -1300,7 +1297,7 @@ sub Set($@) {
 | 
				
			|||||||
			#befehl ausfuhren
 | 
								#befehl ausfuhren
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
#################################################	
 | 
					#############################	
 | 
				
			||||||
	# set level ( positionsanfahrt )
 | 
						# set level ( positionsanfahrt )
 | 
				
			||||||
	if ($comand eq "level")
 | 
						if ($comand eq "level")
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -1362,7 +1359,7 @@ sub Set($@) {
 | 
				
			|||||||
		
 | 
							
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
######################################################
 | 
					#############################
 | 
				
			||||||
	# set stop 
 | 
						# set stop 
 | 
				
			||||||
	if ($comand eq "stop" && ReadingsVal( $name, 'LastAction', 'undef' ) ne $comand )
 | 
						if ($comand eq "stop" && ReadingsVal( $name, 'LastAction', 'undef' ) ne $comand )
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -1383,7 +1380,7 @@ sub Set($@) {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
############################################
 | 
					#############################
 | 
				
			||||||
   # batteriecheck
 | 
					   # batteriecheck
 | 
				
			||||||
   if ( AttrVal( $name, 'SIRO_Battery_low','undef' ) ne "undef")
 | 
					   if ( AttrVal( $name, 'SIRO_Battery_low','undef' ) ne "undef")
 | 
				
			||||||
	   {
 | 
						   {
 | 
				
			||||||
@@ -1397,7 +1394,7 @@ sub Set($@) {
 | 
				
			|||||||
  return;
 | 
					  return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#######################
 | 
					#############################
 | 
				
			||||||
sub Delock($) { 
 | 
					sub Delock($) { 
 | 
				
			||||||
# entsperrt device nach programmierung des shutters
 | 
					# entsperrt device nach programmierung des shutters
 | 
				
			||||||
    my ($input) = @_;
 | 
					    my ($input) = @_;
 | 
				
			||||||
@@ -1407,7 +1404,7 @@ sub Delock($) {
 | 
				
			|||||||
	readingsSingleUpdate( $hash, "state", $position , 1 );
 | 
						readingsSingleUpdate( $hash, "state", $position , 1 );
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#######################
 | 
					#############################
 | 
				
			||||||
sub Prog($) { 
 | 
					sub Prog($) { 
 | 
				
			||||||
#wird im programmiermode von internaltimer aufgerufen
 | 
					#wird im programmiermode von internaltimer aufgerufen
 | 
				
			||||||
    my ($input) = @_;
 | 
					    my ($input) = @_;
 | 
				
			||||||
@@ -1418,7 +1415,7 @@ sub Prog($) {
 | 
				
			|||||||
	return;
 | 
						return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
#######################
 | 
					#############################
 | 
				
			||||||
sub Finish($) { 
 | 
					sub Finish($) { 
 | 
				
			||||||
# wird bei errechnetem aktionsende aufgerufen
 | 
					# wird bei errechnetem aktionsende aufgerufen
 | 
				
			||||||
    my ($input) = @_;
 | 
					    my ($input) = @_;
 | 
				
			||||||
@@ -1453,7 +1450,7 @@ sub Finish($) {
 | 
				
			|||||||
	return;
 | 
						return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#####################
 | 
					#############################
 | 
				
			||||||
sub Restartset($) {
 | 
					sub Restartset($) {
 | 
				
			||||||
    my ($input) = @_;
 | 
					    my ($input) = @_;
 | 
				
			||||||
    my ( $name, $arg ) = split( / /, $input );
 | 
					    my ( $name, $arg ) = split( / /, $input );
 | 
				
			||||||
@@ -1467,7 +1464,7 @@ sub Restartset($) {
 | 
				
			|||||||
    Set($hash, $name, $cmd , $pos);
 | 
					    Set($hash, $name, $cmd , $pos);
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#####################
 | 
					#############################
 | 
				
			||||||
sub versionchange($) {
 | 
					sub versionchange($) {
 | 
				
			||||||
    my ($input) = @_;
 | 
					    my ($input) = @_;
 | 
				
			||||||
    my ( $name, $arg ) = split( / /, $input );
 | 
					    my ( $name, $arg ) = split( / /, $input );
 | 
				
			||||||
@@ -1525,7 +1522,7 @@ sub versionchange($) {
 | 
				
			|||||||
	SendCommand( $hash, 'off' );
 | 
						SendCommand( $hash, 'off' );
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
##################
 | 
					#############################
 | 
				
			||||||
sub fhemwebFn($$$$) {
 | 
					sub fhemwebFn($$$$) {
 | 
				
			||||||
my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
					my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
				
			||||||
    my $hash     = $defs{$d};
 | 
					    my $hash     = $defs{$d};
 | 
				
			||||||
@@ -1536,7 +1533,7 @@ my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
				
			|||||||
	if (!defined $progmode){$progmode='off';}
 | 
						if (!defined $progmode){$progmode='off';}
 | 
				
			||||||
	my $msg;
 | 
						my $msg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
############## 
 | 
					############################# 
 | 
				
			||||||
# debugmode
 | 
					# debugmode
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if (AttrVal( $name, 'SIRO_debug', "0" ) eq "1")
 | 
						if (AttrVal( $name, 'SIRO_debug', "0" ) eq "1")
 | 
				
			||||||
@@ -1548,8 +1545,7 @@ my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
				
			|||||||
	$msg.= "<br> <br></td></tr></table>";
 | 
						$msg.= "<br> <br></td></tr></table>";
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
############## 
 | 
					############################# 
 | 
				
			||||||
# debugmode
 | 
					 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if (AttrVal( $name, 'disable', "0" ) eq "1")
 | 
						if (AttrVal( $name, 'disable', "0" ) eq "1")
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@@ -1561,7 +1557,7 @@ my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
#######################	versions<6E>nderung
 | 
					#############################	versions<6E>nderung
 | 
				
			||||||
# kann irgendwann entfernt werden	
 | 
					# kann irgendwann entfernt werden	
 | 
				
			||||||
	if (ReadingsVal( $name, 'last_reset_os', 'undef' ) ne 'undef')
 | 
						if (ReadingsVal( $name, 'last_reset_os', 'undef' ) ne 'undef')
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -1575,7 +1571,7 @@ my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
				
			|||||||
			</td></tr></table>
 | 
								</td></tr></table>
 | 
				
			||||||
			";
 | 
								";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
######################
 | 
					#############################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ( $progmode eq "on")
 | 
						if ( $progmode eq "on")
 | 
				
			||||||
@@ -1671,7 +1667,7 @@ my ( $FW_wname, $d, $room, $pageHash ) =@_;    # pageHash is set for summaryFn.
 | 
				
			|||||||
	return $msg;
 | 
						return $msg;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
################	
 | 
					#############################	
 | 
				
			||||||
sub Siro_icon($) 
 | 
					sub Siro_icon($) 
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	my ($name) = @_;
 | 
						my ($name) = @_;
 | 
				
			||||||
@@ -1693,8 +1689,8 @@ sub Siro_icon($)
 | 
				
			|||||||
	return $ret;
 | 
						return $ret;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
################
 | 
					#############################
 | 
				
			||||||
#####################
 | 
					
 | 
				
			||||||
sub Distributor($) {
 | 
					sub Distributor($) {
 | 
				
			||||||
    my ($input) = @_;
 | 
					    my ($input) = @_;
 | 
				
			||||||
    my ( $name, $arg, $cmd ) = split( / /, $input );
 | 
					    my ( $name, $arg, $cmd ) = split( / /, $input );
 | 
				
			||||||
@@ -1739,11 +1735,6 @@ sub Distributor($) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#foreach my $testdevices(keys %{$modules{Siro}{defptr}})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
1;
 | 
					1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=pod
 | 
					=pod
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user