diff --git a/fhem/FHEM/14_CUL_MAX.pm b/fhem/FHEM/14_CUL_MAX.pm index 138707822..c50e182b4 100644 --- a/fhem/FHEM/14_CUL_MAX.pm +++ b/fhem/FHEM/14_CUL_MAX.pm @@ -69,7 +69,11 @@ CUL_MAX_Define($$) $hash->{retryCount} = 0; $hash->{devices} = (); AssignIoPort($hash); - CUL_MAX_Check($hash); + + if(CUL_MAX_Check($hash)) { + #Doing this on older firmware disables MAX mode + IOWrite($hash, "", "Za". $hash->{addr}); + } #This interface is shared with 00_MAXLAN.pm $hash->{SendDeviceCmd} = \&CUL_MAX_SendDeviceCmd; @@ -109,9 +113,11 @@ CUL_MAX_Check($@) #Looks like "V 1.49 CUL868" $version =~ m/V (.*)\.(.*) CUL.*/; my ($major_version,$minorversion) = ($1, $2); - if($major_version == 1 and $minorversion < 50) { - Log 2, "The current firmware of the CUL has known bugs with respect to MAX! support. Please update." + if($major_version == 1 and $minorversion < 52) { + Log 2, "The current firmware of the CUL has known bugs with respect to MAX! support. Please update."; + return 0; } + return 1; } sub @@ -170,6 +176,7 @@ CUL_MAX_Parse($$) if(exists($msgId2Cmd{$msgTypeRaw})) { if($msgType eq "Ack") { + return undef if($src eq $shash->{addr}); #Ignore packets generated by culfw's auto-Ack Dispatch($shash, "MAX,$isToMe,Ack,$src,$payload", {RAWMSG => $rmsg}); return undef if(!$isToMe);