diff --git a/fhem/FHEM/23_LUXTRONIK2.pm b/fhem/FHEM/23_LUXTRONIK2.pm index b3d0d332e..9c2a57425 100644 --- a/fhem/FHEM/23_LUXTRONIK2.pm +++ b/fhem/FHEM/23_LUXTRONIK2.pm @@ -1,5 +1,7 @@ ############################################################### # +# 23_LUXTRONIK2.pm +# # Copyright notice # # (c) 2012,2014 Torsten Poitzsch (torsten.poitzsch@gmx.de) @@ -53,7 +55,7 @@ LUXTRONIK2_Initialize($) $hash->{UndefFn} = "LUXTRONIK2_Undefine"; $hash->{NotifyFn} = "LUXTRONIK2_Notify"; $hash->{SetFn} = "LUXTRONIK2_Set"; - $hash->{AttrFn} = "LUXTRONIK2_Attr"; + $hash->{AttrFn} = "LUXTRONIK2_Attr"; $hash->{AttrList} = "disable:0,1 ". "allowSetParameter:0,1 ". "autoSynchClock:slider,10,5,300 ". @@ -155,10 +157,31 @@ LUXTRONIK2_Notify(@) { if ( exists( $hash->{READINGS}{$oldReading} ) ) { delete($hash->{READINGS}{$oldReading}); Log3 $name,2,"$name: !!! Change/fix in LUXTRONIK2-Modul: '$oldReading' is now '$newReading'"; + } } - } - } - return; + } + return; +} + + +sub ######################################## +LUXTRONIK2_Attr(@) +{ + my ($cmd,$name,$aName,$aVal) = @_; + # $cmd can be "del" or "set" + # $name is device name + # aName and aVal are Attribute name and value + if ($cmd eq "set") { + if ($aName eq "1allowSetParameter") { + eval { qr/$aVal/ }; + if ($@) { + Log3 $name, 3, "LUXTRONIK2: Invalid allowSetParameter in attr $name $aName $aVal: $@"; + return "Invalid allowSetParameter $aVal"; + } + } + } + + return undef; } @@ -241,25 +264,6 @@ LUXTRONIK2_Set($$@) return "Unknown argument $cmd, choose one of $list"; } -sub ######################################## -LUXTRONIK2_Attr(@) -{ - my ($cmd,$name,$aName,$aVal) = @_; - # $cmd can be "del" or "set" - # $name is device name - # aName and aVal are Attribute name and value - if ($cmd eq "set") { - if ($aName eq "1allowSetParameter") { - eval { qr/$aVal/ }; - if ($@) { - Log3 $name, 3, "LUXTRONIK2: Invalid allowSetParameter in attr $name $aName $aVal: $@"; - return "Invalid allowSetParameter $aVal"; - } - } - } - - return undef; -} sub ######################################## LUXTRONIK2_GetUpdate($) @@ -296,7 +300,8 @@ LUXTRONIK2_DoUpdate($) my $readingStartTime = time(); Log3 $name, 5, "$name: Opening connection to host ".$host; - my $socket = new IO::Socket::INET ( PeerAddr => $host, + my $socket = new IO::Socket::INET ( + PeerAddr => $host, PeerPort => 8888, # Type = SOCK_STREAM, # probably needed on some systems Proto => 'tcp' @@ -1270,18 +1275,19 @@ LUXTRONIK2_doStatisticBoilerCoolDown ($$$$$$)

LUXTRONIK2